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
ConstructorDescriptionCreates an empty editor action bar contributor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
contributeToMenu
(IMenuManager menu) Contributes to the given menu.void
contributeToStatusLine
(IStatusLineManager statusLineManager) Contributes to the given status line.void
dispose()
TheEditorActionBarContributor
implementation of thisIEditorActionBarContributor
method does nothing, subclasses may override.protected final IAction
getAction
(ITextEditor editor, String actionId) Returns the action registered with the given text editor.protected final IEditorPart
Returns the active editor part.void
setActiveEditor
(IEditorPart part) TheBasicTextEditorActionContributor
implementation of thisIEditorActionBarContributor
method 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 theinit
method.
-
-
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, ornull
actionId
- the action id- Returns:
- the action, or
null
if none
-
setActiveEditor
TheBasicTextEditorActionContributor
implementation of thisIEditorActionBarContributor
method installs the global action handler for the given text editor by calling a private helper method.Subclasses may extend.
- Specified by:
setActiveEditor
in interfaceIEditorActionBarContributor
- Overrides:
setActiveEditor
in classEditorActionBarContributor
- Parameters:
part
- the new target editor
-
contributeToMenu
Description copied from class:EditorActionBarContributor
Contributes to the given menu.The
EditorActionBarContributor
implementation of this method does nothing. Subclasses may reimplement to add to the menu portion of this contribution.- Overrides:
contributeToMenu
in classEditorActionBarContributor
- Parameters:
menu
- the manager that controls the menu
-
contributeToStatusLine
Description copied from class:EditorActionBarContributor
Contributes to the given status line.The
EditorActionBarContributor
implementation of this method does nothing. Subclasses may reimplement to add to the status line portion of this contribution.- Overrides:
contributeToStatusLine
in classEditorActionBarContributor
- Parameters:
statusLineManager
- the manager of the status line
-
dispose
public void dispose()Description copied from class:EditorActionBarContributor
TheEditorActionBarContributor
implementation of thisIEditorActionBarContributor
method does nothing, subclasses may override.- Specified by:
dispose
in interfaceIEditorActionBarContributor
- Overrides:
dispose
in classEditorActionBarContributor
-