예제 #1
0
  /**
   * Constructs a new popupmenu. The given parameter role determines what the purpose is of the
   * actions that can be created via this popupmenu. The parameter must comply to the interface
   * Roles defined on ActionNewAction.
   *
   * @param role the role
   * @param list the list
   */
  public PopupMenuNewAction(String role, UMLMutableLinkedList list) {
    super();

    JMenu newMenu = new JMenu();
    newMenu.setText(Translator.localize("action.new"));
    newMenu.add(ActionNewCallAction.getInstance());
    ActionNewCallAction.getInstance().setTarget(list.getTarget());
    ActionNewCallAction.getInstance().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewCreateAction.getInstance());
    ActionNewCreateAction.getInstance().setTarget(list.getTarget());
    ActionNewCreateAction.getInstance().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewDestroyAction.getiNSTANCE());
    ActionNewDestroyAction.getiNSTANCE().setTarget(list.getTarget());
    ActionNewDestroyAction.getiNSTANCE().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewReturnAction.getInstance());
    ActionNewReturnAction.getInstance().setTarget(list.getTarget());
    ActionNewReturnAction.getInstance().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewSendAction.getInstance());
    ActionNewSendAction.getInstance().setTarget(list.getTarget());
    ActionNewSendAction.getInstance().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewTerminateAction.getInstance());
    ActionNewTerminateAction.getInstance().setTarget(list.getTarget());
    ActionNewTerminateAction.getInstance().putValue(ActionNewAction.ROLE, role);
    newMenu.add(ActionNewUninterpretedAction.getInstance());
    ActionNewUninterpretedAction.getInstance().setTarget(list.getTarget());
    ActionNewUninterpretedAction.getInstance().putValue(ActionNewAction.ROLE, role);
    add(newMenu);

    addSeparator();

    ActionRemoveModelElement.SINGLETON.setObjectToRemove(
        ActionNewAction.getAction(role, list.getTarget()));
    add(ActionRemoveModelElement.SINGLETON);
  }
예제 #2
0
 protected Object[] getEffectActions() {
   Object[] actions = {
     ActionNewCallAction.getButtonInstance(),
     ActionNewCreateAction.getButtonInstance(),
     ActionNewDestroyAction.getButtonInstance(),
     ActionNewReturnAction.getButtonInstance(),
     ActionNewSendAction.getButtonInstance(),
     ActionNewTerminateAction.getButtonInstance(),
     ActionNewUninterpretedAction.getButtonInstance(),
     ActionNewActionSequence.getButtonInstance(),
   };
   ToolBarUtility.manageDefault(actions, "transition.state.effect");
   return actions;
 }
예제 #3
0
 protected Action getActionTerminateAction() {
   if (actionTerminateAction == null) {
     actionTerminateAction = ActionNewTerminateAction.getButtonInstance();
   }
   return actionTerminateAction;
 }