Examples of JaspiraAction


Examples of org.openbp.jaspira.action.JaspiraAction

   */
  private void createActions()
  {
    actions = new JaspiraAction [NACTIONS];

    actions [ACTION_INDEX_ADD] = new JaspiraAction(resourceCollection, "propertybrowser.addelement")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Add a new node to the collection
        final AbstractNode newPos = addNewNode();
        if (newPos != null)
        {
          // Set the focus to the edit column of the next row (usually the 'name' field of the new node)
          // Adding a new node caused a model change, so select after all model change events have been processed.
          // (Don't ask, it works...)
          SwingUtilities.invokeLater(new Runnable()
          {
            public void run()
            {
              SwingUtilities.invokeLater(new Runnable()
              {
                public void run()
                {
                  selectNode(newPos, 1, 1);
                }
              });
            }
          });
        }
      }
    };

    actions [ACTION_INDEX_COPY] = new JaspiraAction(resourceCollection, "propertybrowser.copyelement")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Copy the node contents to the clipboard
        copyNode();

        // We have copied something, make sure the paste action reflects this.
        updateActionState();
      }
    };

    actions [ACTION_INDEX_CUT] = new JaspiraAction(resourceCollection, "propertybrowser.cutelement")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Copy the node contents to the clipboard
        copyNode();

        // Remove the node from the collection
        AbstractNode newPos = removeNode();
        if (newPos != null)
        {
          // Set the focus to the edit column of the next row (usually the 'name' field of the new node)
          selectNode(newPos, 0, 0);
        }

        // We have copied something, make sure the paste action reflects this.
        updateActionState();
      }
    };

    actions [ACTION_INDEX_PASTE] = new JaspiraAction(resourceCollection, "propertybrowser.pasteelement")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Paste an element from the clipboard to a new node of the collection
        final AbstractNode newPos = pasteNode();
        if (newPos != null)
        {
          // Set the focus to the edit column of the next row (usually the 'name' field of the new node)
          // Adding a new node caused a model change, so select after all model change events have been processed.
          // (Don't ask, it works...)
          SwingUtilities.invokeLater(new Runnable()
          {
            public void run()
            {
              SwingUtilities.invokeLater(new Runnable()
              {
                public void run()
                {
                  selectNode(newPos, 1, 1);
                }
              });
            }
          });
        }
      }
    };

    actions [ACTION_INDEX_REMOVE] = new JaspiraAction(resourceCollection, "propertybrowser.removeelement")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Remove the node from the collection
        AbstractNode newPos = removeNode();
        if (newPos != null)
        {
          // Set the focus to the edit column of the next row (usually the 'name' field of the new node)
          selectNode(newPos, 0, 0);
        }
      }
    };

    actions [ACTION_INDEX_MOVEUP] = new JaspiraAction(resourceCollection, "propertybrowser.moveelementup")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Move the node one position up in the collection
        moveNodeUp();
      }
    };

    actions [ACTION_INDEX_MOVEDOWN] = new JaspiraAction(resourceCollection, "propertybrowser.moveelementdown")
    {
      public void actionPerformed(ActionEvent ae)
      {
        // Move the node one position down in the collection
        moveNodeDown();
View Full Code Here

Examples of org.openbp.jaspira.action.JaspiraAction

    actionMap.setParent(SwingUtilities.getUIActionMap(this));

    // Enter the key bindings of our actions in the maps
    for (int i = 0; i < actions.length; ++i)
    {
      JaspiraAction action = actions [i];

      KeySequence [] sequences = action.getKeySequences();
      if (sequences != null)
      {
        for (int is = 0; is < sequences.length; ++is)
        {
          KeySequence sequence = sequences [is];
View Full Code Here

Examples of org.openbp.jaspira.action.JaspiraAction

    {
      toolbar = new JaspiraToolbar();

      toolbar.add(filterMgr.getFilterToolbar());

      JaspiraAction action = getAction("plugin.itembrowser.togglefunctionalgroup");
      if (action != null)
      {
        toolbar.addSeparator();
        action.setEnabled(true);
        toolbar.add(action);
      }
    }

    return toolbar;
View Full Code Here

Examples of org.openbp.jaspira.action.JaspiraAction

    saveDisabled = false;

    // Enable the save button
    if (!saveImmediately)
    {
      JaspiraAction action = ActionMgr.getInstance().getAction("standard.file.save");
      if (action != null)
        action.setEnabled(objectModified);
    }
  }
View Full Code Here

Examples of org.openbp.jaspira.action.JaspiraAction

      boolean haveModel = ie.isDataFlavorSupported(ClientFlavors.MODEL);
      boolean haveItem = ie.isDataFlavorSupported(ClientFlavors.ITEM);
      boolean haveProcess = ie.isDataFlavorSupported(ClientFlavors.PROCESS_ITEM);

      JaspiraAction group;

      if (isMenu)
      {
        // New item group
        group = new JaspiraAction(ItemBrowserPlugin.this, "submenu.new");

        addNewItemActions(group);

        ie.add(group);
      }

      // Manage items group
      group = new JaspiraAction("popup.itembrowser.manage", null, null, null, null, 1, JaspiraAction.TYPE_GROUP);

      if (removeAction != null)
      {
        if (isMenu)
        {
          if (isPopup && (haveModel | haveItem))
          {
            group.addMenuChild(removeAction);
          }
        }
        else
        {
          group.addToolbarChild(removeAction);
        }
      }

      ie.add(group);

      // Item extras group
      group = new JaspiraAction("popup.itembrowser.extras", null, null, null, null, 2, JaspiraAction.TYPE_GROUP);

      if (isMenu)
      {
        if (isPopup && (haveModel | haveProcess))
        {
          if (runAction != null)
          {
            group.addMenuChild(runAction);
          }
        }
      }
      else
      {
        if (runAction != null)
        {
          group.addToolbarChild(runAction);
        }
      }

      ie.add(group);
View Full Code Here

Examples of org.openbp.jaspira.action.JaspiraAction

    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

Examples of org.openbp.jaspira.action.JaspiraAction

    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

Examples of org.openbp.jaspira.action.JaspiraAction

    {
      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

Examples of org.openbp.jaspira.action.JaspiraAction

   */
  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

Examples of org.openbp.jaspira.action.JaspiraAction

          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
TOP
Copyright © 2018 www.massapi.com. 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.