Class EditorActionBarContributor
- All Implemented Interfaces:
IEditorActionBarContributor
- Direct Known Subclasses:
BasicTextEditorActionContributor,CompareEditorContributor,MultiPageEditorActionBarContributor
IEditorActionBarContributor.
If instantiated and used as-is, nothing is contribututed. Clients should subclass in order to contribute to some or all of the action bars.
Subclasses may reimplement the following methods:
contributeToMenu- reimplement to contribute to menucontributeToToolBar- reimplement to contribute to tool barcontributeToStatusLine- reimplement to contribute to status linesetActiveEditor- reimplement to react to editor changes
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty editor action bar contributor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeToCoolBar(ICoolBarManager coolBarManager) Contributes to the given cool bar.voidcontributeToMenu(IMenuManager menuManager) Contributes to the given menu.voidcontributeToStatusLine(IStatusLineManager statusLineManager) Contributes to the given status line.voidcontributeToToolBar(IToolBarManager toolBarManager) Contributes to the given tool bar.voiddispose()TheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod does nothing, subclasses may override.Returns this contributor's action bars.getPage()Returns this contributor's workbench page.voidinit(IActionBars bars) This method calls:contributeToMenuwithbars' menu managercontributeToToolBarwithbars' tool bar managercontributeToCoolBarwithbars' cool bar manager ifIActionBarsis of extended typeIActionBars2contributeToStatusLinewithbars' status line manager The given action bars are also remembered and made accessible viagetActionBars.voidinit(IActionBars bars, IWorkbenchPage page) TheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod remembers the page then forwards the call toinit(IActionBars)for backward compatibilityvoidsetActiveEditor(IEditorPart targetEditor) Sets the active editor for the contributor.
-
Constructor Details
-
EditorActionBarContributor
public EditorActionBarContributor()Creates an empty editor action bar contributor. The action bars are furnished later via theinitmethod.
-
-
Method Details
-
contributeToMenu
Contributes to the given menu.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement to add to the menu portion of this contribution.- Parameters:
menuManager- the manager that controls the menu
-
contributeToStatusLine
Contributes to the given status line.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement to add to the status line portion of this contribution.- Parameters:
statusLineManager- the manager of the status line
-
contributeToToolBar
Contributes to the given tool bar.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement to add to the tool bar portion of this contribution.- Parameters:
toolBarManager- the manager that controls the workbench tool bar
-
contributeToCoolBar
Contributes to the given cool bar.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement to add to the cool bar portion of this contribution. There can only be contributions from a cool bar or a tool bar.- Parameters:
coolBarManager- the manager that controls the workbench cool bar.- Since:
- 3.0
-
getActionBars
Returns this contributor's action bars.- Returns:
- the action bars
-
getPage
Returns this contributor's workbench page.- Returns:
- the workbench page
-
dispose
public void dispose()TheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod does nothing, subclasses may override.- Specified by:
disposein interfaceIEditorActionBarContributor
-
init
TheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod remembers the page then forwards the call toinit(IActionBars)for backward compatibility- Specified by:
initin interfaceIEditorActionBarContributor- Parameters:
bars- the action barspage- the workbench page for this contributor
-
init
This method calls:contributeToMenuwithbars' menu managercontributeToToolBarwithbars' tool bar managercontributeToCoolBarwithbars' cool bar manager ifIActionBarsis of extended typeIActionBars2contributeToStatusLinewithbars' status line manager
getActionBars.- Parameters:
bars- the action bars
-
setActiveEditor
Sets the active editor for the contributor.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement. This generally entails disconnecting from the old editor, connecting to the new editor, and updating the actions to reflect the new editor.- Specified by:
setActiveEditorin interfaceIEditorActionBarContributor- Parameters:
targetEditor- the new target editor
-