public class EditorActionBarContributor extends Object implements IEditorActionBarContributor
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 changesConstructor and Description |
---|
EditorActionBarContributor()
Creates an empty editor action bar contributor.
|
Modifier and Type | Method and Description |
---|---|
void |
contributeToCoolBar(ICoolBarManager coolBarManager)
Contributes to the given cool bar.
|
void |
contributeToMenu(IMenuManager menuManager)
Contributes to the given menu.
|
void |
contributeToStatusLine(IStatusLineManager statusLineManager)
Contributes to the given status line.
|
void |
contributeToToolBar(IToolBarManager toolBarManager)
Contributes to the given tool bar.
|
void |
dispose()
The
EditorActionBarContributor implementation of this
IEditorActionBarContributor method does nothing,
subclasses may override. |
IActionBars |
getActionBars()
Returns this contributor's action bars.
|
IWorkbenchPage |
getPage()
Returns this contributor's workbench page.
|
void |
init(IActionBars bars)
This method calls:
contributeToMenu with bars ' menu manager
contributeToToolBar with bars ' tool bar
manager
contributeToCoolBar with bars ' cool bar
manager if IActionBars is of extended type IActionBars2
contributeToStatusLine with bars ' status line
manager
The given action bars are also remembered and made accessible via
getActionBars . |
void |
init(IActionBars bars,
IWorkbenchPage page)
The
EditorActionBarContributor implementation of this
IEditorActionBarContributor method remembers the page
then forwards the call to init(IActionBars) for
backward compatibility |
void |
setActiveEditor(IEditorPart targetEditor)
Sets the active editor for the contributor.
|
public EditorActionBarContributor()
init
method.public void contributeToMenu(IMenuManager menuManager)
The EditorActionBarContributor
implementation of this method
does nothing. Subclasses may reimplement to add to the menu portion of this
contribution.
menuManager
- the manager that controls the menupublic void contributeToStatusLine(IStatusLineManager statusLineManager)
The EditorActionBarContributor
implementation of this method
does nothing. Subclasses may reimplement to add to the status line portion of
this contribution.
statusLineManager
- the manager of the status linepublic void contributeToToolBar(IToolBarManager toolBarManager)
The EditorActionBarContributor
implementation of this method
does nothing. Subclasses may reimplement to add to the tool bar portion of
this contribution.
toolBarManager
- the manager that controls the workbench tool barpublic void contributeToCoolBar(ICoolBarManager coolBarManager)
The EditorActionBarContributor
implementation 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.
coolBarManager
- the manager that controls the workbench cool bar.public IActionBars getActionBars()
public IWorkbenchPage getPage()
public void dispose()
EditorActionBarContributor
implementation of this
IEditorActionBarContributor
method does nothing,
subclasses may override.dispose
in interface IEditorActionBarContributor
public void init(IActionBars bars, IWorkbenchPage page)
EditorActionBarContributor
implementation of this
IEditorActionBarContributor
method remembers the page
then forwards the call to init(IActionBars)
for
backward compatibilityinit
in interface IEditorActionBarContributor
bars
- the action barspage
- the workbench page for this contributorpublic void init(IActionBars bars)
contributeToMenu
with bars
' menu managercontributeToToolBar
with bars
' tool bar
managercontributeToCoolBar
with bars
' cool bar
manager if IActionBars
is of extended type IActionBars2
contributeToStatusLine
with bars
' status line
managergetActionBars
.bars
- the action barspublic void setActiveEditor(IEditorPart targetEditor)
The EditorActionBarContributor
implementation 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.
setActiveEditor
in interface IEditorActionBarContributor
targetEditor
- the new target editor
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.