| | |
| | | |
| | | private boolean forceRefreshWhenOpening; |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public JMenuBar getMenuBar() |
| | | { |
| | | if (menuBar == null) |
| | |
| | | return menuBar; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getTitle() |
| | | { |
| | | return INFO_CTRL_PANEL_MANAGE_ENTRIES_TITLE.get(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public GenericDialog.ButtonType getBrowseButtonType() |
| | | { |
| | | return GenericDialog.ButtonType.CLOSE; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void createBrowserController(ControlPanelInfo info) |
| | | { |
| | | super.createBrowserController(info); |
| | | entryPane.setController(controller); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void okClicked() |
| | | { |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toBeDisplayed(boolean visible) |
| | | { |
| | | super.toBeDisplayed(visible); |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected Component createMainPanel() |
| | | { |
| | | JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
| | |
| | | { |
| | | TreeSelectionListener treeSelectionListener = new TreeSelectionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void valueChanged(TreeSelectionEvent ev) |
| | | { |
| | | if (ignoreTreeSelectionEvents) |
| | |
| | | final DragSource dragSource = DragSource.getDefaultDragSource(); |
| | | final DragSourceListener dragSourceListener = new DragSourceListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dragDropEnd(DragSourceDropEvent dsde) |
| | | { |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dragEnter(DragSourceDragEvent dsde) |
| | | { |
| | | DragSourceContext context = dsde.getDragSourceContext(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dragOver(DragSourceDragEvent dsde) |
| | | { |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dropActionChanged(DragSourceDragEvent dsde) |
| | | { |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dragExit(DragSourceEvent dsde) |
| | | { |
| | | } |
| | | }; |
| | | final DragGestureListener dragGestureListener = new DragGestureListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void dragGestureRecognized(DragGestureEvent e) |
| | | { |
| | | //Get the selected node |
| | |
| | | ); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setInfo(ControlPanelInfo info) |
| | | { |
| | | super.setInfo(info); |
| | | entryPane.setInfo(info); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | final ServerDescriptor desc = ev.getNewDescriptor(); |
| | |
| | | LDAPEntryReader reader; |
| | | CustomSearchResult sr; |
| | | Throwable t; |
| | | @Override |
| | | public void run() |
| | | { |
| | | while (true) |
| | |
| | | } |
| | | SwingUtilities.invokeAndWait(new Runnable() |
| | | { |
| | | @Override |
| | | public void run() |
| | | { |
| | | reader.backgroundTaskCompleted(sr, t); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Adds a pop up menu to the tree. |
| | | * |
| | | */ |
| | | /** Adds a pop up menu to the tree. */ |
| | | private void addPopupMenu() |
| | | { |
| | | popup = new JPopupMenu(); |
| | |
| | | INFO_CTRL_PANEL_NEW_USER_MENU.get()); |
| | | popupNewUserMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newUser(); |
| | |
| | | INFO_CTRL_PANEL_NEW_GROUP_MENU.get()); |
| | | popupNewGroupMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newGroup(); |
| | |
| | | INFO_CTRL_PANEL_NEW_ORGANIZATIONAL_UNIT_MENU.get()); |
| | | popupNewOUMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newOrganizationalUnit(); |
| | |
| | | INFO_CTRL_PANEL_NEW_ORGANIZATION_MENU.get()); |
| | | popupNewOrganizationMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newOrganization(); |
| | |
| | | INFO_CTRL_PANEL_NEW_DOMAIN_MENU.get()); |
| | | popupNewDomainMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newDomain(); |
| | |
| | | INFO_CTRL_PANEL_NEW_FROM_LDIF_MENU.get()); |
| | | popupNewEntryFromLDIFMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newEntryFromLDIF(); |
| | |
| | | INFO_CTRL_PANEL_RESET_USER_PASSWORD_MENU.get()); |
| | | popupResetUserPasswordMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | resetUserPassword(); |
| | |
| | | INFO_CTRL_PANEL_ADD_TO_GROUP_MENU.get()); |
| | | popupAddToGroupMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | addToGroup(); |
| | |
| | | INFO_CTRL_PANEL_DUPLICATE_ENTRY_MENU.get()); |
| | | popupDuplicateEntryMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | duplicateEntry(); |
| | |
| | | INFO_CTRL_PANEL_COPY_DN_MENU.get()); |
| | | popupCopyDNMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | copyDN(); |
| | |
| | | INFO_CTRL_PANEL_DELETE_ENTRY_MENU.get()); |
| | | popupDeleteMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | deleteClicked(); |
| | |
| | | { |
| | | newGroupPanel = new NewGroupPanel(); |
| | | newGroupPanel.setInfo(getInfo()); |
| | | /* First argument: Component to associate the target with |
| | | * Second argument: DropTargetListener |
| | | */ |
| | | /* First argument: Component to associate the target with Second argument: DropTargetListener */ |
| | | newGroupDlg = new GenericDialog(Utilities.getFrame(this), newGroupPanel); |
| | | Utilities.centerGoldenMean(newGroupDlg, |
| | | Utilities.getParentDialog(this)); |
| | |
| | | { |
| | | ClipboardOwner owner = new ClipboardOwner() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void lostOwnership( Clipboard aClipboard, |
| | | Transferable aContents) { |
| | | //do nothing |
| | |
| | | frame.setVisible(true); |
| | | } |
| | | |
| | | /** |
| | | * The specific menu bar of this panel. |
| | | * |
| | | */ |
| | | /** The specific menu bar of this panel. */ |
| | | class BrowseMenuBar extends GenericMenuBar |
| | | { |
| | | private static final long serialVersionUID = 505187832236882370L; |
| | |
| | | INFO_CTRL_PANEL_NEW_BROWSER_WINDOW_MENU.get()); |
| | | newWindow.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newWindow(); |
| | |
| | | INFO_CTRL_PANEL_CLOSE_MENU.get()); |
| | | close.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | closeClicked(); |
| | |
| | | { |
| | | private boolean ignoreEvents; |
| | | private JRadioButtonMenuItem lastSelected = menus[0]; |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | if (ignoreEvents) |
| | |
| | | entryPane.getController().getFollowReferrals()); |
| | | sortUserData.addActionListener(new ActionListener() |
| | | { |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | try |
| | |
| | | }); |
| | | followReferrals.addActionListener(new ActionListener() |
| | | { |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | try |
| | |
| | | menu.add(refresh); |
| | | refresh.addActionListener(new ActionListener() |
| | | { |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | refreshClicked(); |
| | |
| | | INFO_CTRL_PANEL_NEW_USER_MENU.get()); |
| | | newUserMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newUser(); |
| | |
| | | INFO_CTRL_PANEL_NEW_GROUP_MENU.get()); |
| | | newGroupMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newGroup(); |
| | |
| | | INFO_CTRL_PANEL_NEW_ORGANIZATIONAL_UNIT_MENU.get()); |
| | | newOUMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newOrganizationalUnit(); |
| | |
| | | INFO_CTRL_PANEL_NEW_ORGANIZATION_MENU.get()); |
| | | newOrganizationMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newOrganization(); |
| | |
| | | INFO_CTRL_PANEL_NEW_DOMAIN_MENU.get()); |
| | | newDomainMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newDomain(); |
| | |
| | | INFO_CTRL_PANEL_NEW_FROM_LDIF_MENU.get()); |
| | | newEntryFromLDIFMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | newEntryFromLDIF(); |
| | |
| | | INFO_CTRL_PANEL_RESET_USER_PASSWORD_MENU.get()); |
| | | resetPasswordMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | resetUserPassword(); |
| | |
| | | INFO_CTRL_PANEL_ADD_TO_GROUP_MENU.get()); |
| | | addToGroupMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | addToGroup(); |
| | |
| | | INFO_CTRL_PANEL_DUPLICATE_ENTRY_MENU.get()); |
| | | duplicateEntryMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | duplicateEntry(); |
| | |
| | | INFO_CTRL_PANEL_COPY_DN_MENU.get()); |
| | | copyDNMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | copyDN(); |
| | |
| | | INFO_CTRL_PANEL_DELETE_ENTRY_MENU.get()); |
| | | deleteMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | deleteClicked(); |
| | |
| | | INFO_CTRL_PANEL_DELETE_BASE_DN_MENU.get()); |
| | | deleteBaseDNMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | deleteBaseDN(); |
| | |
| | | INFO_CTRL_PANEL_DELETE_BACKEND_MENU.get()); |
| | | deleteBackendMenuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | deleteBackend(); |