public class EMFUndoRedoActionBarContributor
extends org.eclipse.ui.part.MultiPageEditorActionBarContributor
implements org.eclipse.jface.action.IMenuListener, org.eclipse.ui.IPropertyListener
IEditingDomainProvider
.
It automatically hooks up the Undo, Redo actions on the Edit menu
to the corresponding commands supported by the EditingDomain
.
The actions are also refreshed every time the editor fires to its IPropertyListener
s.
Another very useful feature of this contributor is that it can be used as follows:
((IMenuListener) ((IEditorSite) getSite()).getActionBarContributor()).menuAboutToShow(menuManager);to contribute the Edit menu actions to a pop-up menu.
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.ui.IEditorPart |
activeEditor
This keeps track of the current editor part.
|
static int |
ADDITIONS_LAST_STYLE
This style bit indicates that the "additions" separator should come after the "edit" separator.
|
protected org.eclipse.emf.edit.ui.provider.DiagnosticDecorator.LiveValidator.LiveValidationAction |
liveValidationAction
This is the action used to perform validation.
|
protected org.eclipse.emf.edit.ui.action.RedoAction |
redoAction
This is the action used to implement redo.
|
protected int |
style
This is used to encode the style bits.
|
protected org.eclipse.emf.edit.ui.action.UndoAction |
undoAction
This is the action used to implement undo.
|
protected org.eclipse.emf.edit.ui.action.ValidateAction |
validateAction
This is the action used to perform validation.
|
Constructor and Description |
---|
EMFUndoRedoActionBarContributor()
This creates an instance of the contributor.
|
EMFUndoRedoActionBarContributor(int style)
This creates an instance of the contributor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected void |
addGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)
This inserts global actions before the "additions-end" separator.
|
void |
contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager) |
void |
contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager) |
void |
contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager) |
protected org.eclipse.emf.edit.ui.action.RedoAction |
createRedoAction()
Returns the action used to implement redo.
|
protected org.eclipse.emf.edit.ui.action.UndoAction |
createUndoAction()
Returns the action used to implement undo.
|
void |
deactivate() |
org.eclipse.ui.IEditorPart |
getActiveEditor() |
void |
init(org.eclipse.ui.IActionBars actionBars) |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implements
IMenuListener to help fill the context menus with contributions
from the Edit menu. |
void |
propertyChanged(Object source,
int id) |
protected boolean |
removeAllReferencesOnDelete()
This determines whether or not the delete action should clean up all references to the deleted objects.
|
void |
setActiveEditor(org.eclipse.ui.IEditorPart part) |
void |
setActivePage(org.eclipse.ui.IEditorPart part) |
void |
setActiveView(org.eclipse.ui.IViewPart part)
Deprecated.
|
void |
shareGlobalActions(org.eclipse.ui.part.IPage page,
org.eclipse.ui.IActionBars actionBars) |
void |
update() |
protected org.eclipse.ui.IEditorPart activeEditor
protected org.eclipse.emf.edit.ui.action.UndoAction undoAction
protected org.eclipse.emf.edit.ui.action.RedoAction redoAction
protected org.eclipse.emf.edit.ui.action.ValidateAction validateAction
protected org.eclipse.emf.edit.ui.provider.DiagnosticDecorator.LiveValidator.LiveValidationAction liveValidationAction
public static final int ADDITIONS_LAST_STYLE
protected int style
public EMFUndoRedoActionBarContributor()
public EMFUndoRedoActionBarContributor(int style)
public void init(org.eclipse.ui.IActionBars actionBars)
init
in class org.eclipse.ui.part.EditorActionBarContributor
protected org.eclipse.emf.edit.ui.action.UndoAction createUndoAction()
undoAction
protected org.eclipse.emf.edit.ui.action.RedoAction createRedoAction()
redoAction
protected boolean removeAllReferencesOnDelete()
public void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
contributeToMenu
in class org.eclipse.ui.part.EditorActionBarContributor
public void contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)
contributeToStatusLine
in class org.eclipse.ui.part.EditorActionBarContributor
public void contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)
contributeToToolBar
in class org.eclipse.ui.part.EditorActionBarContributor
public void shareGlobalActions(org.eclipse.ui.part.IPage page, org.eclipse.ui.IActionBars actionBars)
@Deprecated public void setActiveView(org.eclipse.ui.IViewPart part)
public org.eclipse.ui.IEditorPart getActiveEditor()
public void setActiveEditor(org.eclipse.ui.IEditorPart part)
setActiveEditor
in interface org.eclipse.ui.IEditorActionBarContributor
setActiveEditor
in class org.eclipse.ui.part.MultiPageEditorActionBarContributor
public void setActivePage(org.eclipse.ui.IEditorPart part)
setActivePage
in class org.eclipse.ui.part.MultiPageEditorActionBarContributor
public void deactivate()
public void activate()
public void update()
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
IMenuListener
to help fill the context menus with contributions
from the Edit menu.menuAboutToShow
in interface org.eclipse.jface.action.IMenuListener
protected void addGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)
public void propertyChanged(Object source, int id)
propertyChanged
in interface org.eclipse.ui.IPropertyListener
Copyright © 2018. All rights reserved.