1 | /** | | 1 | /** |
2 | * Show menu to display/hide the extension point compartment. | | 2 | * Build a collection of menu items relevant for a right-click |
3 | * @return the menu | | 3 | * pop-up menu on a Stereotype. |
4 | * @see org.argouml.uml.diagram.ui.FigNodeModelElement#buildShowPopUp() | | 4 | * {@inheritDoc} |
5 | */ | | 5 | */ |
6 | @Override | | 6 | @Override |
7 | protected ArgoJMenu buildShowPopUp() { | | 7 | public Vector getPopUpActions(MouseEvent me) { |
8 | ArgoJMenu showMenu = super.buildShowPopUp(); | | 8 | Vector popUpActions = super.getPopUpActions(me); |
9 | Iterator i = ActionCompartmentDisplay.getActions().iterator(); | | 9 | |
10 | while (i.hasNext()) { | | 10 | // Add... |
11 | showMenu.add((Action) i.next()); | | 11 | ArgoJMenu addMenu = new ArgoJMenu("menu.popup.add"); |
12 | } | | 12 | // TODO: Add Tags & Constraints |
13 | return showMenu; | | 13 | // addMenu.add(TargetManager.getInstance().getAddAttributeAction()); |
14 | } | | 14 | // addMenu.add(TargetManager.getInstance().getAddOperationAction()); |
| | | 15 | addMenu.add(new ActionAddNote()); |
| | | 16 | addMenu.add(new ActionNewTagDefinition()); |
| | | 17 | addMenu.add(ActionEdgesDisplay.getShowEdges()); |
| | | 18 | addMenu.add(ActionEdgesDisplay.getHideEdges()); |
| | | 19 | popUpActions.add(popUpActions.size() - getPopupAddOffset(), addMenu); |
| | | 20 | |
| | | 21 | // Show ... |
| | | 22 | ArgoJMenu showMenu = new ArgoJMenu("menu.popup.show"); |
| | | 23 | for (Action action : ActionCompartmentDisplay.getActions()) { |
| | | 24 | showMenu.add(action); |
| | | 25 | } |
| | | 26 | if (showMenu.getComponentCount() > 0) { |
| | | 27 | popUpActions.add(popUpActions.size() - getPopupAddOffset(), |
| | | 28 | showMenu); |
| | | 29 | } |
| | | 30 | |
| | | 31 | // Modifiers ... |
| | | 32 | popUpActions.add(popUpActions.size() - getPopupAddOffset(), |
| | | 33 | buildModifierPopUp(ABSTRACT | LEAF | ROOT)); |
| | | 34 | |
| | | 35 | // Visibility ... |
| | | 36 | popUpActions.add(popUpActions.size() - getPopupAddOffset(), |
| | | 37 | buildVisibilityPopUp()); |
| | | 38 | |
| | | 39 | return popUpActions; |
| | | 40 | } |