Package org.eclipse.ui.texteditor
Class BasicTextEditorActionContributor
java.lang.Object
org.eclipse.ui.part.EditorActionBarContributor
org.eclipse.ui.texteditor.BasicTextEditorActionContributor
- All Implemented Interfaces:
IEditorActionBarContributor
- Direct Known Subclasses:
TextEditorActionContributor
Manages the installation and removal of global actions for the same type of
editors.
If instantiated and used as-is, this contributor connects to all of the workbench defined global editor actions the corresponding actions of the current editor. It also adds addition actions for searching and navigation (go to line) as well as a set of status fields.
Subclasses may override the following methods:
contributeToMenu- extend to contribute to menucontributeToToolBar- reimplement to contribute to tool barcontributeToStatusLine- reimplement to contribute to status linesetActiveEditor- extend to react to editor changes
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty editor action bar contributor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeToMenu(IMenuManager menu) Contributes to the given menu.voidcontributeToStatusLine(IStatusLineManager statusLineManager) Contributes to the given status line.voiddispose()TheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod does nothing, subclasses may override.protected final IActiongetAction(ITextEditor editor, String actionId) Returns the action registered with the given text editor.protected final IEditorPartReturns the active editor part.voidsetActiveEditor(IEditorPart part) TheBasicTextEditorActionContributorimplementation of thisIEditorActionBarContributormethod installs the global action handler for the given text editor by calling a private helper method.Methods inherited from class org.eclipse.ui.part.EditorActionBarContributor
contributeToCoolBar, contributeToToolBar, getActionBars, getPage, init, init
-
Constructor Details
-
BasicTextEditorActionContributor
public BasicTextEditorActionContributor()Creates an empty editor action bar contributor. The action bars are furnished later via theinitmethod.- See Also:
-
-
Method Details
-
getActiveEditorPart
Returns the active editor part.- Returns:
- the active editor part
-
getAction
Returns the action registered with the given text editor.- Parameters:
editor- the editor, ornullactionId- the action id- Returns:
- the action, or
nullif none
-
setActiveEditor
TheBasicTextEditorActionContributorimplementation of thisIEditorActionBarContributormethod installs the global action handler for the given text editor by calling a private helper method.Subclasses may extend.
- Specified by:
setActiveEditorin interfaceIEditorActionBarContributor- Overrides:
setActiveEditorin classEditorActionBarContributor- Parameters:
part- the new target editor
-
contributeToMenu
Description copied from class:EditorActionBarContributorContributes to the given menu.The
EditorActionBarContributorimplementation of this method does nothing. Subclasses may reimplement to add to the menu portion of this contribution.- Overrides:
contributeToMenuin classEditorActionBarContributor- Parameters:
menu- the manager that controls the menu
-
contributeToStatusLine
Description copied from class:EditorActionBarContributorContributes 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.- Overrides:
contributeToStatusLinein classEditorActionBarContributor- Parameters:
statusLineManager- the manager of the status line
-
dispose
public void dispose()Description copied from class:EditorActionBarContributorTheEditorActionBarContributorimplementation of thisIEditorActionBarContributormethod does nothing, subclasses may override.- Specified by:
disposein interfaceIEditorActionBarContributor- Overrides:
disposein classEditorActionBarContributor
-