Class ActionBarContributor

java.lang.Object
org.eclipse.ui.part.EditorActionBarContributor
org.eclipse.gef.ui.actions.ActionBarContributor
All Implemented Interfaces:
IEditorActionBarContributor

public abstract class ActionBarContributor extends EditorActionBarContributor
Contributes actions to the workbench. !!Warning: This class is subject to change.
  • Constructor Details

    • ActionBarContributor

      public ActionBarContributor()
  • Method Details

    • addAction

      protected void addAction(IAction action)
      Adds the given action to the action registry.
      Parameters:
      action - the action to add
    • addGlobalActionKey

      protected void addGlobalActionKey(String key)
      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'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.
      Parameters:
      key - the key identifying the global action
    • addRetargetAction

      protected void addRetargetAction(RetargetAction action)
      Adds the specified RetargetAction to this contributors 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).
      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 using addGlobalActionKey(String) need to be added.
      See Also:
    • dispose

      public void dispose()
      Disposes the contributor. Removes all RetargetActions that were IPartListeners on the IWorkbenchPage and disposes them. Also disposes the action registry.

      Subclasses may extend this method to perform additional cleanup.

      Specified by:
      dispose in interface IEditorActionBarContributor
      Overrides:
      dispose in class EditorActionBarContributor
      See Also:
    • getAction

      protected IAction getAction(String id)
      Retrieves an action from the action registry using the given ID.
      Parameters:
      id - the ID of the sought action
      Returns:
      null or the action if found
    • getActionRegistry

      protected ActionRegistry getActionRegistry()
      returns this contributor's ActionRegsitry.
      Returns:
      the ActionRegistry
    • init

      public void init(IActionBars bars)
      Overrides:
      init in class EditorActionBarContributor
      See Also:
    • setActiveEditor

      public void setActiveEditor(IEditorPart editor)
      Specified by:
      setActiveEditor in interface IEditorActionBarContributor
      Overrides:
      setActiveEditor in class EditorActionBarContributor
      See Also: