public abstract class ActionBarContributor extends EditorActionBarContributor
Constructor and Description |
---|
ActionBarContributor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAction(IAction action)
Adds the given action to the action registry.
|
protected void |
addGlobalActionKey(java.lang.String key)
Indicates the existence of a global action identified by the specified
key.
|
protected void |
addRetargetAction(RetargetAction action)
Adds the specified RetargetAction to this contributors
ActionRegistry . |
protected abstract void |
buildActions()
Creates and initializes Actions managed by this contributor.
|
protected abstract void |
declareGlobalActionKeys()
Subclasses must implement to declare additional global actions IDs.
|
void |
dispose()
Disposes the contributor.
|
protected IAction |
getAction(java.lang.String id)
Retrieves an action from the action registry using the given ID.
|
protected ActionRegistry |
getActionRegistry()
returns this contributor's ActionRegsitry.
|
void |
init(IActionBars bars) |
void |
setActiveEditor(IEditorPart editor) |
contributeToCoolBar, contributeToMenu, contributeToStatusLine, contributeToToolBar, getActionBars, getPage, init
protected void addAction(IAction action)
action
- the action to addprotected void addGlobalActionKey(java.lang.String key)
setActiveEditor(IEditorPart)
). Keys provided
here will result in corresponding actions being obtained from the active
editor's ActionRegistry
, 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.key
- the key identifying the global actionprotected void addRetargetAction(RetargetAction action)
ActionRegistry
. The RetargetAction is also added as a
IPartListener
of the contributor's page. Also, the retarget
action's ID is flagged as a global action key, by calling
addGlobalActionKey(String)
.action
- the retarget action being addedprotected abstract void buildActions()
protected abstract void declareGlobalActionKeys()
addGlobalActionKey(String)
need to be added.addGlobalActionKey(String)
public void dispose()
RetargetAction
s that were
IPartListener
s on the
IWorkbenchPage
and disposes them. Also disposes
the action registry.
Subclasses may extend this method to perform additional cleanup.
dispose
in interface IEditorActionBarContributor
dispose
in class EditorActionBarContributor
EditorActionBarContributor.dispose()
protected IAction getAction(java.lang.String id)
id
- the ID of the sought actionnull
or the action if foundprotected ActionRegistry getActionRegistry()
public void init(IActionBars bars)
init
in class EditorActionBarContributor
EditorActionBarContributor.init(IActionBars)
public void setActiveEditor(IEditorPart editor)
setActiveEditor
in interface IEditorActionBarContributor
setActiveEditor
in class EditorActionBarContributor
IEditorActionBarContributor.setActiveEditor(IEditorPart)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.