Package org.eclipse.gef.ui.actions
Class ActionBarContributor
java.lang.Object
org.eclipse.ui.part.EditorActionBarContributor
org.eclipse.gef.ui.actions.ActionBarContributor
- All Implemented Interfaces:
IEditorActionBarContributor
Contributes actions to the workbench. !!Warning: This class is subject to
change.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the given action to the action registry.protected voidaddGlobalActionKey(String key) Indicates the existence of a global action identified by the specified key.protected voidaddRetargetAction(RetargetAction action) Adds the specified RetargetAction to this contributorsActionRegistry.protected abstract voidCreates and initializes Actions managed by this contributor.protected abstract voidSubclasses must implement to declare additional global actions IDs.voiddispose()Disposes the contributor.protected IActionRetrieves an action from the action registry using the given ID.protected ActionRegistryreturns this contributor's ActionRegsitry.voidinit(IActionBars bars) voidsetActiveEditor(IEditorPart editor) Methods inherited from class org.eclipse.ui.part.EditorActionBarContributor
contributeToCoolBar, contributeToMenu, contributeToStatusLine, contributeToToolBar, getActionBars, getPage, init
-
Constructor Details
-
ActionBarContributor
public ActionBarContributor()
-
-
Method Details
-
addAction
Adds the given action to the action registry.- Parameters:
action- the action to add
-
addGlobalActionKey
Indicates the existence of a global action identified by the specified key. This global action is defined outside the scope of this contributor, such as the Workbench's undo action, or an action provided by a workbench ActionSet. The list of global action keys is used whenever the active editor is changed (setActiveEditor(IEditorPart)). Keys provided here will result in corresponding actions being obtained from the active editor'sActionRegistry, and those actions will be registered with the ActionBars for this contributor. The editor's action handler and the global action must have the same key.- Parameters:
key- the key identifying the global action
-
addRetargetAction
Adds the specified RetargetAction to this contributorsActionRegistry. The RetargetAction is also added as aIPartListenerof the contributor's page. Also, the retarget action's ID is flagged as a global action key, by callingaddGlobalActionKey(String).- Parameters:
action- the retarget action being added
-
buildActions
protected abstract void buildActions()Creates and initializes Actions managed by this contributor. -
declareGlobalActionKeys
protected abstract void declareGlobalActionKeys()Subclasses must implement to declare additional global actions IDs. Only IDs which were not already added directly or indirectly usingaddGlobalActionKey(String)need to be added.- See Also:
-
dispose
public void dispose()Disposes the contributor. Removes allRetargetActions that wereIPartListeners on theIWorkbenchPageand disposes them. Also disposes the action registry.Subclasses may extend this method to perform additional cleanup.
- Specified by:
disposein interfaceIEditorActionBarContributor- Overrides:
disposein classEditorActionBarContributor- See Also:
-
getAction
Retrieves an action from the action registry using the given ID.- Parameters:
id- the ID of the sought action- Returns:
nullor the action if found
-
getActionRegistry
returns this contributor's ActionRegsitry.- Returns:
- the ActionRegistry
-
init
- Overrides:
initin classEditorActionBarContributor- See Also:
-
setActiveEditor
- Specified by:
setActiveEditorin interfaceIEditorActionBarContributor- Overrides:
setActiveEditorin classEditorActionBarContributor- See Also:
-