Package org.openbp.jaspira.action

Examples of org.openbp.jaspira.action.JaspiraAction$PriorityComparator


   * Updates the actions undo and redo.
   * Set the actions active or not.
   */
  public void updateActions()
  {
    JaspiraAction undo = ActionMgr.getInstance().getAction("undo.undo");
    if (undo != null)
    {
      if (canUndo())
      {
        String cmdName = ((Transaction) undoStack.getFirst()).getDisplayName();

        if (cmdName != null)
        {
          String text = undoText + ": " + cmdName;
          undo.setDisplayName(text);
          undo.setDescription(text);
        }
        else
        {
          undo.setDisplayName(undoText);
          undo.setDescription(undoDescription);
        }
        undo.setEnabled(true);
      }
      else
      {
        undo.setDisplayName(undoText);
        undo.setEnabled(false);
      }
    }

    JaspiraAction redo = ActionMgr.getInstance().getAction("undo.redo");
    if (redo != null)
    {
      if (canRedo())
      {
        String cmdName = ((Transaction) redoStack.getFirst()).getDisplayName();

        if (cmdName != null)
        {
          String text = redoText + ": " + cmdName;
          redo.setDisplayName(text);
          redo.setDescription(text);
        }
        else
        {
          redo.setDisplayName(redoText);
          redo.setDescription(redoDescription);
        }
        redo.setEnabled(true);
      }
      else
      {
        redo.setDisplayName(redoText);
        redo.setEnabled(false);
      }
    }
  }
View Full Code Here


      // Reset the wait cursor
      ApplicationUtil.waitCursorOff();
    }

    // Disable the save button initially
    JaspiraAction action = getAction("standard.file.save");
    if (action != null)
    {
      action.setEnabled(false);
    }

    // Make the tool tips stay long enough to be read
    ToolTipManager.sharedInstance().setDismissDelay(10000);
View Full Code Here

      {
        sequences[i] = new KeySequence(sto.nextToken());
      }

      // Simply perform a requestFocus operation when activated
      JaspiraAction action = new JaspiraAction(getName(), getTitle(), getDescription(), null, sequences, 0, JaspiraAction.TYPE_ACTION)
      {
        public void actionPerformed(ActionEvent ae)
        {
          focusPlugin();
        }
View Full Code Here

    {
      if (!(ie.getSourcePlugin() instanceof FinderResultPlugin))
        return EVENT_IGNORED;

      // Create the group to manage the results
      JaspiraAction group = new JaspiraAction("popup.manage", null, null, null, null, 10, JaspiraAction.TYPE_GROUP);
      if (refreshAction != null)
      {
        group.addMenuChild(refreshAction);
      }
      if (clearListAction != null)
      {
        group.addMenuChild(clearListAction);
      }
      ie.add(group);
      return EVENT_CONSUMED;
    }
View Full Code Here

    {
      if (!(ie.getSourcePlugin() instanceof FinderResultPlugin))
        return EVENT_IGNORED;

      // Create the group to manage the results
      JaspiraAction group = new JaspiraAction("popup.manage.finder", null, null, null, null, 10, JaspiraAction.TYPE_GROUP);
      if (refreshAction != null)
      {
        group.addToolbarChild(refreshAction);
      }
      if (clearListAction != null)
      {
        group.addToolbarChild(clearListAction);
      }
      ie.add(group);
      return EVENT_CONSUMED;
    }
View Full Code Here

     */
    public JaspiraEventHandlerCode toolbar(InteractionEvent ie)
    {
      if (ie.getSourcePlugin() instanceof Modeler)
      {
        JaspiraAction group;

        group = new JaspiraAction("breakpoint", null, null, null, null, 2, JaspiraAction.TYPE_GROUP);
        if (toggleBreakpointsAction != null)
        {
          group.addToolbarChild(toggleBreakpointsAction);
        }
        if (clearBreakpointsAction != null)
        {
          group.addToolbarChild(clearBreakpointsAction);
        }
        ie.add(group);

        group = new JaspiraAction("step", null, null, null, null, 3, JaspiraAction.TYPE_GROUP);
        if (stepIntoAction != null)
        {
          group.addToolbarChild(stepIntoAction);
        }
        if (stepOverAction != null)
        {
          group.addToolbarChild(stepOverAction);
        }
        if (stepOutAction != null)
        {
          group.addToolbarChild(stepOutAction);
        }
        if (stepNextAction != null)
        {
          group.addToolbarChild(stepNextAction);
        }
        if (resumeAction != null)
        {
          group.addToolbarChild(resumeAction);
        }
        if (stopAction != null)
        {
          group.addToolbarChild(stopAction);
        }
        ie.add(group);

        return EVENT_HANDLED;
      }
View Full Code Here

   * @param socketFigure The referred socket figure
   */
  public static void addParamMenu(InteractionEvent ie, final Modeler modeler, final SocketFigure socketFigure)
  {
    // Popup menu item group
    JaspiraAction group = null;

    NodeSocket socket = socketFigure.getNodeSocket();
    for (Iterator it = socket.getParams(); it.hasNext();)
    {
      final NodeParam param = (NodeParam) it.next();

      // Create an action that toggles the parameter visibility
      JaspiraAction action = new JaspiraAction(modeler, "modeler.edit.paramvisibility.prototype")
      {
        public void actionPerformed(ActionEvent e)
        {
          // Reinitialize the socket contents
          modeler.startUndo("Show/hide Parameter");

          modeler.getDrawingView().clearSelection();

          // Toggle the parameter visibility
          param.setVisible(!param.isVisible());

          // Rebuild the parmeter list, displaying the visible parameters only
          socketFigure.reinitParams(false);

          modeler.endUndo();

          modeler.getDrawingView().redraw();
        }
      };

      // Provide the parameter name or display name as action title
      String name;
      if (DisplayObjectPlugin.getInstance().isTitleModeText())
        name = param.getDisplayText();
      else
        name = param.getName();
      action.setDisplayName(name);

      // Enable the action only if we may hide the parameter
      boolean canHide = !param.isVisible() || canHideParam(param);
      action.setEnabled(canHide);

      // The action selection state reflects the parameter visiblity
      action.setSelected(param.isVisible());

      // Add the action to the 'Parameters' group
      if (group == null)
      {
        // TODO Feature 5 Add the 'show/hide all' menu items

        // Create the 'Parameters' menu group
        group = new JaspiraAction(modeler, "modeler.edit.paramvisibility");
      }
      group.addMenuChild(action);
    }

    if (group != null)
View Full Code Here

     * @param ie Interaction event to add the menus to
     * @param socket Socket the context menu should refer to
     */
    private void setupSocketContextMenu(InteractionEvent ie, final NodeSocket socket)
    {
      JaspiraAction group = new JaspiraAction("popupbreakpoint", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);

      // Menu item: Toggle breakpoint
      group.addMenuChild(new JaspiraAction(DebuggerPlugin.this, "debugger.client.togglebreakpoint")
      {
        public void actionPerformed(ActionEvent e)
        {
          fireEvent(new QualifierEvent(DebuggerPlugin.this, "debugger.client.togglebreakpoint", socket.getQualifier()));
        }
      });

      ie.add(group);

      if (haltedPosition != null)
      {
        // Menu item: Step until; add this only if we have a halted process
        group = new JaspiraAction("popupstep", null, null, null, null, 3, JaspiraAction.TYPE_GROUP);

        group.addMenuChild(new JaspiraAction(DebuggerPlugin.this, "debugger.client.stepuntil")
        {
          public void actionPerformed(ActionEvent e)
          {
            fireEvent(new QualifierEvent(DebuggerPlugin.this, "debugger.client.stepuntil", socket.getQualifier()));
          }
View Full Code Here

        // Log as warning
        LogUtil.error(getClass(), "Error instantiating custom model object configurator $0.", className, e);
      }
    }

    templateAction = new JaspiraAction(modeler, "modeler.popup.custom");
  }
View Full Code Here

    {
      CustomModelObjectConfiguratorDescriptor desc = configurator.checkAppliance(mo);
      if (desc != null)
      {
        final CustomModelObjectConfigurator foundConfigurator = configurator;
        JaspiraAction action = new JaspiraAction(desc.getName(), desc.getDisplayName(), desc.getDescription(), null, null, desc.getPriority(), JaspiraAction.TYPE_ACTION)
        {
          public void actionPerformed(ActionEvent e)
          {
            if (foundConfigurator.displayActivityConfigurationDialog(mo))
            {
              modeler.getDrawing().setModified();
            }
          }
        };
        action.setIcon(templateAction.getIcon());
        group.addMenuChild(action);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.openbp.jaspira.action.JaspiraAction$PriorityComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.