@Override public Point getPopupLocation(MouseEvent event) { if (event != null) { TreePath path = getClosestPathForLocation(event.getX(), event.getY()); if (path == null) { return null; } setSelectionPath(path); treePopupMenu.removeAll(); addPopupMenuItems(path); return event.getPoint(); } return null; }
private void handleOverflowAddittion(int visibleButtons) { Component[] comps = getAllComponents(); removeAll(); overflowToolbar.setOrientation(getOrientation() == HORIZONTAL ? VERTICAL : HORIZONTAL); popup.removeAll(); for (Component comp : comps) { if (visibleButtons > 0) { add(comp); if (comp.isVisible()) { visibleButtons--; } } else { overflowToolbar.add(comp); } } popup.add(overflowToolbar); add(overflowButton); }
private void handleOverflowRemoval() { if (overflowToolbar.getComponents().length > 0) { remove(overflowButton); handleIconResize(); for (Component comp : overflowToolbar.getComponents()) { add(comp); } overflowToolbar.removeAll(); popup.removeAll(); } }
@Override public void popupMenuCanceled(PopupMenuEvent e) { popup.removeAll(); } });
@Override public void removeAll() { if(popupMenu != null){ popupMenu.removeAll(); } }
@Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { popup.removeAll(); } @Override
private void restoreMenuItems() { menu.removeAll(); for (Component component : menuItems) { menu.add(component); } } }
private void restoreMenuItems() { menu.removeAll(); for (Component component : menuItems) { menu.add(component); } } }
/** * @inheritDoc * */ @Override public void removeAll() { getPopupMenu().removeAll(); }
/** * @inheritDoc * */ @Override public void removeAll() { getPopupMenu().removeAll(); }
/** * @inheritDoc * */ public void removeAll() { getPopupMenu().removeAll(); }
private void buildRangesMenu () { menu.removeAll(); ShapeSet.addAllShapeSets(menu, selectionListener); }
private void buildShapesMenu () { menu.removeAll(); // Add all shapes within current range ShapeSet.addSetShapes(ranges.current, menu, selectionListener); }
/** * @inheritDoc * */ @Override public void removeAll() { getPopupMenu().removeAll(); }
@Override public void popupMenuWillBecomeVisible(final PopupMenuEvent arg0) { popupMenu.removeAll(); populatePopupMenu(getSelectedFiles(), popupMenu); }
/** * @inheritDoc * */ @Override public void removeAll() { getPopupMenu().removeAll(); }
@Override public void run() { if (popup != null) popup.removeAll(); if (menu != null) menu.removeAll(); Collection objects0 = objects; TriggerMenuController.this.objects = new ArrayList(); for (Object o : objects0) { addMenuFromObject(o); } } });
public void setOnlyUpdatableDatastores(final boolean onlyUpdatableDatastores) { _onlyUpdatableDatastores = onlyUpdatableDatastores; final JPopupMenu menu = _createDatastoreButton.getMenu(); menu.removeAll(); populateCreateDatastoreMenu(menu); }
private void closing(){ closed = true; menu.removePopupMenuListener( listener ); menu.removeAll(); fireClosed(); } }
/** Gets popup menu. Overrides superclass. Adds lazy menu items creation. */ public JPopupMenu getPopupMenu() { JPopupMenu pm = super.getPopupMenu(); pm.removeAll(); pm.add(new AddNavigationRuleAction()); pm.add(new AddNavigationCaseAction()); pm.add(new JSeparator()); pm.add(new AddManagedBeanAction()); pm.pack(); return pm; } }