Package org.openbp.jaspira.action

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


    Box btnPane = Box.createHorizontalBox();
    JaspiraToolbarButton setPWBtn = new JaspiraToolbarButton(new PWAction(resourceCollection, "passwordwidget.newbtn"));
    setPWBtn.setIconSize(12);
    btnPane.add(setPWBtn);
    JaspiraToolbarButton removePWBtn = new JaspiraToolbarButton(new JaspiraAction(resourceCollection, "passwordwidget.removebtn")
    {
      public void actionPerformed(ActionEvent ae)
      {
        setValue(null);
        notifyOptionMgrOfOptionChange();
View Full Code Here


    public JaspiraEventHandlerCode toolbar(InteractionEvent ie)
    {
      if (ie.getSourcePlugin() != PropertyBrowserPlugin.this)
        return EVENT_IGNORED;

      JaspiraAction group;

      group = new JaspiraAction("propertybrowser.modify", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);
      group.addToolbarChild(propertyBrowser.getAddAction());
      group.addToolbarChild(propertyBrowser.getCopyAction());
      group.addToolbarChild(propertyBrowser.getCutAction());
      group.addToolbarChild(propertyBrowser.getPasteAction());
      group.addToolbarChild(propertyBrowser.getRemoveAction());
      ie.add(group);

      group = new JaspiraAction("propertybrowser.order", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);
      group.addToolbarChild(propertyBrowser.getMoveUpAction());
      group.addToolbarChild(propertyBrowser.getMoveDownAction());
      ie.add(group);

      group = new JaspiraAction("propertybrowser.save", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);
      group.addToolbarChild(getAction("standard.file.save"));
      ie.add(group);

      return EVENT_HANDLED;
    }
View Full Code Here

    {
      if (ie.isDataFlavorSupported(ClientFlavors.PROCESS_ITEM))
      {
        final ProcessItem process = (ProcessItem) ie.getSafeTransferData(ClientFlavors.PROCESS_ITEM);

        JaspiraAction action = new JaspiraAction(ImageExportPlugin.this, "export")
        {
          public void actionPerformed(ActionEvent ae)
          {
            int type = OptionMgr.getInstance().getIntegerOption("imageexporter.imagetype", SupportedImageTypes.DEFAULT);
            final String typeName = (String) SupportedImageTypes.NAME_BY_IMAGE_TYPE.get(new Integer(type));
View Full Code Here

   */
  protected boolean handleKeySequence(KeySequence ks)
  {
    if (actionsBySequence != null)
    {
      JaspiraAction action = (JaspiraAction) actionsBySequence.get(ks);
      if (action != null && action.isEnabled())
      {
        action.actionPerformed(new ActionEvent(this, 0, null));
        return true;
      }
    }

    return false;
View Full Code Here

          int n = actionNames.size();
          for (int i = 0; i < n; i++)
          {
            String actionName = (String) actionNames.get(i);

            JaspiraAction action = new JaspiraAction(this, actionName);
            if (installAction(action))
            {
              if (eventActionNames == null)
              {
                eventActionNames = new ArrayList();
              }
              eventActionNames.add(actionName);
            }
          }
        }
      }
    }

    // Register the user actions
    Collection externalActions = getExternalActions();
    if (externalActions != null)
    {
      for (Iterator it = externalActions.iterator(); it.hasNext();)
      {
        JaspiraAction action = (JaspiraAction) it.next();

        installAction(action);
      }
    }
View Full Code Here

        }
      }

      ActionMgr am = ActionMgr.getInstance();

      JaspiraAction copyAction = am.getAction("global.clipboard.copy");
      if (copyAction != null)
        copyAction.setEnabled(canCopy);

      JaspiraAction cutAction = am.getAction("global.clipboard.cut");
      if (cutAction != null)
        cutAction.setEnabled(canCut);

      JaspiraAction deleteAction = am.getAction("global.clipboard.delete");
      if (deleteAction != null)
        deleteAction.setEnabled(canDelete);

      JaspiraAction pasteAction = am.getAction("global.clipboard.paste");
      if (pasteAction != null)
        pasteAction.setEnabled(canPaste);

      return EVENT_IGNORED;
    }
View Full Code Here

      if (ie.getSourcePlugin() != NodeItemEditorPlugin.this)
        return EVENT_IGNORED;

      DataFlavor [] flavor = ie.getTransferDataFlavors();

      JaspiraAction group = new JaspiraAction("popup", null, null, null, null, 100, JaspiraAction.TYPE_GROUP);

      for (int i = 0; i < flavor.length; i++)
      {
        if (flavor [i].equals(ModelerFlavors.FIGURE))
        {
          Figure figure = (Figure) ie.getSafeTransferData(flavor [i]);
          workspaceView.singleSelect(figure);
        }

        if (flavor [i].equals(ModelerFlavors.COLORIZABLE))
        {
          final Colorizable col = (Colorizable) ie.getSafeTransferData(flavor [i]);

          if (col.getFillColor() != null && !col.getFillColor().equals(col.getDefaultFillColor()))
          {
            group.addMenuChild(new JaspiraAction(NodeItemEditorPlugin.this, "modeler.edit.resetcolor")
            {
              public void actionPerformed(ActionEvent e)
              {
                col.setFillColor(col.getDefaultFillColor());
                col.invalidate();
              }
            });
          }
        }

        final NodeItemEditorPlugin modeler = NodeItemEditorPlugin.this;
        boolean copyEnabled = modeler.canCopy();
        boolean cutEnabled = modeler.canCut();
        boolean deleteEnabled = modeler.canDelete();
        boolean pasteEnabled = modeler.canPaste(ClipboardMgr.getInstance().getCurrentEntry());
        if (copyEnabled || deleteEnabled || cutEnabled || pasteEnabled)
        {
          JaspiraAction copyPasteGroup = new JaspiraAction("copypaste", null, null, null, null, 2, JaspiraAction.TYPE_GROUP);

          JaspiraAction ja;

          ja = new JaspiraAction(modeler, "modeler.edit.copy")
          {
            public void actionPerformed(ActionEvent e)
            {
              copy();
            }
          };
          ja.setEnabled(copyEnabled);
          copyPasteGroup.addMenuChild(ja);

          ja = new JaspiraAction(modeler, "modeler.edit.cut")
          {
            public void actionPerformed(ActionEvent e)
            {
              cut();
            }
          };
          ja.setEnabled(cutEnabled);
          copyPasteGroup.addMenuChild(ja);

          ja = new JaspiraAction(modeler, "modeler.edit.paste")
          {
            public void actionPerformed(ActionEvent e)
            {
              Transferable transferable = ClipboardMgr.getInstance().getCurrentEntry();
              paste(transferable);
            }
          };
          ja.setEnabled(pasteEnabled);
          copyPasteGroup.addMenuChild(ja);

          ie.add(copyPasteGroup);

          ja = new JaspiraAction(modeler, "modeler.edit.delete")
          {
            public void actionPerformed(ActionEvent e)
            {
              delete();
            }
          };
          ja.setEnabled(deleteEnabled);
          ie.add(ja);

        }
      }
View Full Code Here

      ModelObject mo = (ModelObject) ie.getSafeTransferData(ClientFlavors.MODEL_OBJECT);

      List associations = mo.getAssociations();
      if (associations != null)
      {
        JaspiraAction group = new JaspiraAction(AssociationPlugin.this, "submenu.open");

        int n = associations.size();
        for (int iAssoc = 0; iAssoc < n; ++iAssoc)
        {
          Association association = (Association) associations.get(iAssoc);

          String hintMsg = null;
          OpenEventInfo [] openEventInfo = null;

          if (association.getAssociatedObject() == null)
          {
            // Association present, but no associated object.
            // The association contains a hint message, e. g. "Object has not yet been generated"
            hintMsg = association.getHintMsg();
          }
          else
          {
            // Check the mime types supported by this object
            String [] types = association.getAssociationTypes();
            if (types == null || types.length == 0)
            {
              hintMsg = getPluginResourceCollection().getRequiredString("messages.hints.noassociation");
            }
            else
            {
              // Now check if any plugin is able to open this kind of MIME type
              // The association manager will broadcast the plugin.association.supports event in order
              // to determine the open event name that can be used to open the object of the association
              openEventInfo = determineOpenEvents(types, AssociationPlugin.this);

              if (openEventInfo == null)
              {
                hintMsg = getPluginResourceCollection().getRequiredString("messages.hints.wrongassociation");
              }
            }
          }

          if (openEventInfo != null)
          {
            // We are able to open this object.
            // Create an open action for each open event information
            for (int iEvent = 0; iEvent < openEventInfo.length; ++iEvent)
            {
              OpenAction openAction = new OpenAction(association, openEventInfo [iEvent], !mo.isModifiable());
              openAction.setPriority(iAssoc * 10 + iEvent);
              group.addMenuChild(openAction);
            }
          }
          else
          {
            // Open not possible.
            // Create a dummy action for the association that displays a hint message
            JaspiraAction emptyAction = new JaspiraAction(association);
            emptyAction.setDescription(hintMsg);
            emptyAction.setEnabled(false);
            emptyAction.setPriority(iAssoc * 10);
            group.addMenuChild(emptyAction);
          }
        }

        ie.add(group);
 
View Full Code Here

        final Item item = (Item) ie.getSafeTransferData(ClientFlavors.ITEM);

        if (!(item instanceof Model))
        {
          // Add the 'Add to toolbox' action
          JaspiraAction action = new JaspiraAction(UserToolBoxPlugin.this, "toolbox.add")
          {
            public void actionPerformed(ActionEvent ae)
            {
              addToolBoxItem(new ToolBoxItem(item.getDisplayText(), ItemIconMgr.getInstance().getIcon(item, FlexibleSize.MEDIUM), item.getDescriptionText(), new ItemTransferable(item)));
              refreshContent();

              // Bring the toolbox to the front, but don't switch pages
              showPlugin(false);
            }
          };

          String s = action.getDisplayName();
          String tt = getToolBoxTitle();
          if (tt != null)
          {
            // Append the name of the toolbox to the action title
            s = s + ": " + tt;
          }
          action.setDisplayName(s);

          ie.add(action);
        }
      }
View Full Code Here

      if (!ie.isDataFlavorSupported(StandardFlavors.JASPIRA_PAGE))
      {
        return EVENT_IGNORED;
      }

      JaspiraAction group = new JaspiraAction("popup.page", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);

      // 'Open page in new frame' popup menu
      group.addMenuChild(new JaspiraAction(ApplicationBase.this, "frame.openinframe")
      {
        public void actionPerformed(ActionEvent e)
        {
          JaspiraPage page = (JaspiraPage) ie.getSafeTransferData(StandardFlavors.JASPIRA_PAGE);
          if (page != null)
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.