| | |
| | | private JMenuItem popupNewOrganizationMenuItem; |
| | | private JMenuItem popupNewDomainMenuItem; |
| | | private JMenuItem popupResetUserPasswordMenuItem; |
| | | private JMenuItem popupDuplicateEntryMenuItem; |
| | | |
| | | private LDAPEntryPanel entryPane; |
| | | |
| | |
| | | private GenericDialog newEntryFromLDIFDlg; |
| | | private NewEntryFromLDIFPanel newEntryFromLDIFPanel; |
| | | |
| | | private GenericDialog duplicateEntryDlg; |
| | | private DuplicateEntryPanel duplicateEntryPanel; |
| | | |
| | | private boolean ignoreTreeSelectionEvents = false; |
| | | |
| | | private ArrayList<LDAPEntryReader> entryReaderQueue = |
| | |
| | | popupDeleteMenuItem.setEnabled(enableDelete); |
| | | menuBar.deleteMenuItem.setEnabled(enableDelete); |
| | | |
| | | boolean enableCopyDN = (paths != null) && (paths.length > 0); |
| | | boolean enableCopyDN = path != null; |
| | | popupCopyDNMenuItem.setEnabled(enableCopyDN); |
| | | menuBar.copyDNMenuItem.setEnabled(enableCopyDN); |
| | | |
| | | boolean enableDuplicateEntry = enableCopyDN; |
| | | popupDuplicateEntryMenuItem.setEnabled(enableDuplicateEntry); |
| | | menuBar.duplicateEntryMenuItem.setEnabled(enableDuplicateEntry); |
| | | |
| | | boolean enableAddToGroup = enableCopyDN; |
| | | popupAddToGroupMenuItem.setEnabled(enableAddToGroup); |
| | | menuBar.addToGroupMenuItem.setEnabled(enableAddToGroup); |
| | |
| | | popup.add(popupAddToGroupMenuItem); |
| | | popupAddToGroupMenuItem.setEnabled(false); |
| | | |
| | | popup.add(new JSeparator()); |
| | | |
| | | popupDuplicateEntryMenuItem = Utilities.createMenuItem( |
| | | INFO_CTRL_PANEL_DUPLICATE_ENTRY_MENU.get()); |
| | | popupDuplicateEntryMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | duplicateEntry(); |
| | | } |
| | | }); |
| | | popup.add(popupDuplicateEntryMenuItem); |
| | | |
| | | popupCopyDNMenuItem = Utilities.createMenuItem( |
| | | INFO_CTRL_PANEL_COPY_DN_MENU.get()); |
| | | popupCopyDNMenuItem.addActionListener(new ActionListener() |
| | |
| | | copyDN(); |
| | | } |
| | | }); |
| | | popup.add(new JSeparator()); |
| | | popup.add(popupCopyDNMenuItem); |
| | | popupCopyDNMenuItem.setEnabled(false); |
| | | |
| | | popup.add(new JSeparator()); |
| | | |
| | | popupDeleteMenuItem = Utilities.createMenuItem( |
| | |
| | | newEntryFromLDIFDlg.setVisible(true); |
| | | } |
| | | |
| | | private void duplicateEntry() |
| | | { |
| | | duplicateEntryDlg = null; |
| | | if (duplicateEntryDlg == null) |
| | | { |
| | | if (duplicateEntryPanel == null) |
| | | { |
| | | duplicateEntryPanel = new DuplicateEntryPanel(); |
| | | duplicateEntryPanel.setInfo(getInfo()); |
| | | } |
| | | duplicateEntryDlg = new GenericDialog(Utilities.getFrame(this), |
| | | duplicateEntryPanel); |
| | | Utilities.centerGoldenMean(duplicateEntryDlg, |
| | | Utilities.getParentDialog(this)); |
| | | } |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | BasicNode node = null; |
| | | if ((paths != null) && (paths.length == 1)) |
| | | { |
| | | TreePath path = paths[0]; |
| | | node = (BasicNode)path.getLastPathComponent(); |
| | | } |
| | | duplicateEntryPanel.setEntryToDuplicate(node, controller); |
| | | duplicateEntryDlg.setVisible(true); |
| | | } |
| | | |
| | | private void deleteClicked() |
| | | { |
| | | ArrayList<Message> errors = new ArrayList<Message>(); |
| | |
| | | JMenuItem newOrganizationMenuItem; |
| | | JMenuItem newDomainMenuItem; |
| | | JMenuItem newEntryFromLDIFMenuItem; |
| | | JMenuItem duplicateEntryMenuItem; |
| | | |
| | | /** |
| | | * Constructor. |
| | |
| | | menu.add(addToGroupMenuItem); |
| | | |
| | | menu.add(new JSeparator()); |
| | | |
| | | duplicateEntryMenuItem = Utilities.createMenuItem( |
| | | INFO_CTRL_PANEL_DUPLICATE_ENTRY_MENU.get()); |
| | | duplicateEntryMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | duplicateEntry(); |
| | | } |
| | | }); |
| | | duplicateEntryMenuItem.setEnabled(false); |
| | | menu.add(duplicateEntryMenuItem); |
| | | |
| | | copyDNMenuItem = Utilities.createMenuItem( |
| | | INFO_CTRL_PANEL_COPY_DN_MENU.get()); |
| | | copyDNMenuItem.addActionListener(new ActionListener() |