Package org.eclipse.ui.internal
Class ActionDescriptor
java.lang.Object
org.eclipse.ui.internal.ActionDescriptor
- All Implemented Interfaces:
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Pulldown style constant.static final String
Push style constant.static final String
Radio style constant.static final String
Toggle style constant.static final int
Editor constant.static final int
Popup constant.static final int
View constant.static final int
Workbench constant.static final int
Workbench pulldown constant. -
Constructor Summary
ConstructorDescriptionActionDescriptor
(IConfigurationElement actionElement, int targetType) Creates a new descriptor with the specified target.ActionDescriptor
(IConfigurationElement actionElement, int targetType, Object target) Creates a new descriptor with the target and destination workbench part it will go into. -
Method Summary
Modifier and TypeMethodDescriptionReturns the action object held in this descriptor.getId()
Returns action's id as defined in the registry.Returns named slot (group) in the menu where this action should be added.Returns menu path where this action should be added.int
getMode()
Returns the named slot (group) in the tool bar where this action should be added.Returns id of the tool bar where this action should be added.toString()
For debugging only.
-
Field Details
-
T_POPUP
public static final int T_POPUPPopup constant. Value0x1
.- See Also:
-
T_VIEW
public static final int T_VIEWView constant. Value0x2
.- See Also:
-
T_WORKBENCH
public static final int T_WORKBENCHWorkbench constant. Value0x3
.- See Also:
-
T_EDITOR
public static final int T_EDITOREditor constant. Value0x4
.- See Also:
-
T_WORKBENCH_PULLDOWN
public static final int T_WORKBENCH_PULLDOWNWorkbench pulldown constant. Value0x5
.- See Also:
-
STYLE_PUSH
Push style constant. Valuepush
.- See Also:
-
STYLE_RADIO
Radio style constant. Valueradio
.- See Also:
-
STYLE_TOGGLE
Toggle style constant. Valuetoggle
.- See Also:
-
STYLE_PULLDOWN
Pulldown style constant. Valuepulldown
.- See Also:
-
-
Constructor Details
-
ActionDescriptor
Creates a new descriptor with the specified target.- Parameters:
actionElement
- the configuration elementtargetType
- the type of action
-
ActionDescriptor
Creates a new descriptor with the target and destination workbench part it will go into.- Parameters:
actionElement
- the configuration elementtargetType
- the type of actiontarget
- the target object
-
-
Method Details
-
getAction
Returns the action object held in this descriptor.- Returns:
- the action
-
getId
Returns action's id as defined in the registry.- Returns:
- the id
-
getMenuGroup
Returns named slot (group) in the menu where this action should be added.- Returns:
- the menu group
-
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
Returns the named slot (group) in the tool bar where this action should be added.- Returns:
- the toolbar group id
-
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
For debugging only. -
getLocalId
- Specified by:
getLocalId
in interfaceIPluginContribution
- Returns:
- the local id of the contribution. Must not be
null
. This should correspond to the extension-specific identifier for a given contribution.
-
getPluginId
- Specified by:
getPluginId
in interfaceIPluginContribution
- Returns:
- the id of the originating plugin. Can be
null
if this contribution did not originate from a plugin.
-
getMode
public int getMode()
-