Class ActionDescriptor

java.lang.Object
org.eclipse.ui.internal.ActionDescriptor
All Implemented Interfaces:
IPluginContribution

public class ActionDescriptor extends Object implements IPluginContribution
When 'action' tag is found in the registry, an object of this class is created. It creates the appropriate action object and captures information that is later used to add this action object into menu/tool bar. This class is reused for global (workbench) menu/tool bar, popup menu actions, as well as view's pulldown and local tool bar.
  • Field Details

  • Constructor Details

    • ActionDescriptor

      public ActionDescriptor(IConfigurationElement actionElement, int targetType)
      Creates a new descriptor with the specified target.
      Parameters:
      actionElement - the configuration element
      targetType - the type of action
    • ActionDescriptor

      public ActionDescriptor(IConfigurationElement actionElement, int targetType, Object target)
      Creates a new descriptor with the target and destination workbench part it will go into.
      Parameters:
      actionElement - the configuration element
      targetType - the type of action
      target - the target object
  • Method Details

    • getAction

      public PluginAction getAction()
      Returns the action object held in this descriptor.
      Returns:
      the action
    • getId

      public String getId()
      Returns action's id as defined in the registry.
      Returns:
      the id
    • getMenuGroup

      public String getMenuGroup()
      Returns named slot (group) in the menu where this action should be added.
      Returns:
      the menu group
    • getMenuPath

      public String getMenuPath()
      Returns menu path where this action should be added. If null, the action will not be added into the menu.
      Returns:
      the menubar path
    • getToolbarGroupId

      public String getToolbarGroupId()
      Returns the named slot (group) in the tool bar where this action should be added.
      Returns:
      the toolbar group id
    • getToolbarId

      public String getToolbarId()
      Returns id of the tool bar where this action should be added. If null, action will not be added to the tool bar.
      Returns:
      the toolbar id
    • toString

      public String toString()
      For debugging only.
      Overrides:
      toString in class Object
    • getLocalId

      public String getLocalId()
      Specified by:
      getLocalId in interface IPluginContribution
      Returns:
      the local id of the contribution. Must not be null. This should correspond to the extension-specific identifier for a given contribution.
    • getPluginId

      public String getPluginId()
      Specified by:
      getPluginId in interface IPluginContribution
      Returns:
      the id of the originating plugin. Can be null if this contribution did not originate from a plugin.
    • getMode

      public int getMode()