| | |
| | | */ |
| | | package org.opends.guitools.controlpanel.task; |
| | | |
| | | import static org.forgerock.opendj.ldap.requests.Requests.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.opends.admin.ads.util.ConnectionWrapper; |
| | | import org.opends.guitools.controlpanel.browser.BrowserController; |
| | | import org.opends.guitools.controlpanel.browser.ConnectionWithControls; |
| | | import org.opends.guitools.controlpanel.datamodel.BackendDescriptor; |
| | | import org.opends.guitools.controlpanel.datamodel.BaseDNDescriptor; |
| | | import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; |
| | |
| | | |
| | | try |
| | | { |
| | | ConnectionWrapper conn; |
| | | |
| | | if (parentNode != null) |
| | | { |
| | | conn = controller.findConnectionForDisplayedEntry(parentNode); |
| | | ConnectionWithControls conn = controller.findConnectionForDisplayedEntry(parentNode); |
| | | useAdminCtx = controller.isConfigurationNode(parentNode); |
| | | printProgressCreatingEntry(); |
| | | conn.add(newAddRequest(Converters.from(newEntry))); |
| | | } |
| | | else |
| | | { |
| | | conn = getInfo().getConnection(); |
| | | ConnectionWrapper conn = getInfo().getConnection(); |
| | | useAdminCtx = true; |
| | | printProgressCreatingEntry(); |
| | | conn.getConnection().add(Converters.from(newEntry)); |
| | | } |
| | | |
| | | SwingUtilities.invokeLater(new Runnable() |
| | | { |
| | | @Override |
| | | public void run() |
| | | { |
| | | printEquivalentCommand(); |
| | | getProgressDialog().appendProgressHtml( |
| | | Utilities.getProgressWithPoints( |
| | | INFO_CTRL_PANEL_CREATING_ENTRY.get(dn), |
| | | ColorAndFontConstants.progressFont)); |
| | | } |
| | | }); |
| | | |
| | | conn.getConnection().add(Converters.from(newEntry)); |
| | | |
| | | SwingUtilities.invokeLater(new Runnable() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private void printProgressCreatingEntry() |
| | | { |
| | | SwingUtilities.invokeLater(new Runnable() |
| | | { |
| | | @Override |
| | | public void run() |
| | | { |
| | | printEquivalentCommand(); |
| | | getProgressDialog().appendProgressHtml( |
| | | Utilities.getProgressWithPoints( |
| | | INFO_CTRL_PANEL_CREATING_ENTRY.get(dn), |
| | | ColorAndFontConstants.progressFont)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** Prints the equivalent command-line in the progress dialog. */ |
| | | private void printEquivalentCommand() |
| | | { |