Package org.eclipse.emfforms.spi.editor
Class EMFUndoRedoActionBarContributor
- java.lang.Object
-
- org.eclipse.ui.part.EditorActionBarContributor
-
- org.eclipse.ui.part.MultiPageEditorActionBarContributor
-
- org.eclipse.emfforms.spi.editor.EMFUndoRedoActionBarContributor
-
- All Implemented Interfaces:
org.eclipse.jface.action.IMenuListener,org.eclipse.ui.IEditorActionBarContributor,org.eclipse.ui.IPropertyListener
public class EMFUndoRedoActionBarContributor extends org.eclipse.ui.part.MultiPageEditorActionBarContributor implements org.eclipse.jface.action.IMenuListener, org.eclipse.ui.IPropertyListenerThis is a contributor for an editor, multi-page or otherwise, that implementsIEditingDomainProvider. It automatically hooks up the Undo, Redo actions on the Edit menu to the corresponding commands supported by theEditingDomain. The actions are also refreshed every time the editor fires to itsIPropertyListeners.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.ui.IEditorPartactiveEditorThis keeps track of the current editor part.static intADDITIONS_LAST_STYLEThis style bit indicates that the "additions" separator should come after the "edit" separator.protected org.eclipse.emf.edit.ui.provider.DiagnosticDecorator.LiveValidator.LiveValidationActionliveValidationActionThis is the action used to perform validation.protected org.eclipse.emf.edit.ui.action.RedoActionredoActionThis is the action used to implement redo.protected intstyleThis is used to encode the style bits.protected org.eclipse.emf.edit.ui.action.UndoActionundoActionThis is the action used to implement undo.protected org.eclipse.emf.edit.ui.action.ValidateActionvalidateActionThis is the action used to perform validation.
-
Constructor Summary
Constructors Constructor Description EMFUndoRedoActionBarContributor()This creates an instance of the contributor.EMFUndoRedoActionBarContributor(int style)This creates an instance of the contributor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate()protected voidaddGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)This inserts global actions before the "additions-end" separator.voidcontributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)voidcontributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)voidcontributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)protected org.eclipse.emf.edit.ui.action.RedoActioncreateRedoAction()Returns the action used to implement redo.protected org.eclipse.emf.edit.ui.action.UndoActioncreateUndoAction()Returns the action used to implement undo.voiddeactivate()org.eclipse.ui.IEditorPartgetActiveEditor()voidinit(org.eclipse.ui.IActionBars actionBars)voidmenuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)This implementsIMenuListenerto help fill the context menus with contributions from the Edit menu.voidpropertyChanged(java.lang.Object source, int id)protected booleanremoveAllReferencesOnDelete()This determines whether or not the delete action should clean up all references to the deleted objects.voidsetActiveEditor(org.eclipse.ui.IEditorPart part)voidsetActivePage(org.eclipse.ui.IEditorPart part)voidsetActiveView(org.eclipse.ui.IViewPart part)Deprecated.voidshareGlobalActions(org.eclipse.ui.part.IPage page, org.eclipse.ui.IActionBars actionBars)voidupdate()
-
-
-
Field Detail
-
activeEditor
protected org.eclipse.ui.IEditorPart activeEditor
This keeps track of the current editor part.
-
undoAction
protected org.eclipse.emf.edit.ui.action.UndoAction undoAction
This is the action used to implement undo.
-
redoAction
protected org.eclipse.emf.edit.ui.action.RedoAction redoAction
This is the action used to implement redo.
-
validateAction
protected org.eclipse.emf.edit.ui.action.ValidateAction validateAction
This is the action used to perform validation.
-
liveValidationAction
protected org.eclipse.emf.edit.ui.provider.DiagnosticDecorator.LiveValidator.LiveValidationAction liveValidationAction
This is the action used to perform validation.- Since:
- 2.9
-
ADDITIONS_LAST_STYLE
public static final int ADDITIONS_LAST_STYLE
This style bit indicates that the "additions" separator should come after the "edit" separator.- See Also:
- Constant Field Values
-
style
protected int style
This is used to encode the style bits.
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IActionBars actionBars)
- Overrides:
initin classorg.eclipse.ui.part.EditorActionBarContributor
-
createUndoAction
protected org.eclipse.emf.edit.ui.action.UndoAction createUndoAction()
Returns the action used to implement undo.- Since:
- 2.6
- See Also:
undoAction
-
createRedoAction
protected org.eclipse.emf.edit.ui.action.RedoAction createRedoAction()
Returns the action used to implement redo.- Since:
- 2.6
- See Also:
redoAction
-
removeAllReferencesOnDelete
protected boolean removeAllReferencesOnDelete()
This determines whether or not the delete action should clean up all references to the deleted objects. It is false by default, to provide the same beahviour, by default, as in EMF 2.1 and before. You should probably override this method to return true, in order to get the new, more useful beahviour.- Since:
- 2.2
-
contributeToMenu
public void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
- Overrides:
contributeToMenuin classorg.eclipse.ui.part.EditorActionBarContributor
-
contributeToStatusLine
public void contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)
- Overrides:
contributeToStatusLinein classorg.eclipse.ui.part.EditorActionBarContributor
-
contributeToToolBar
public void contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)
- Overrides:
contributeToToolBarin classorg.eclipse.ui.part.EditorActionBarContributor
-
shareGlobalActions
public void shareGlobalActions(org.eclipse.ui.part.IPage page, org.eclipse.ui.IActionBars actionBars)
-
setActiveView
@Deprecated public void setActiveView(org.eclipse.ui.IViewPart part)
Deprecated.
-
getActiveEditor
public org.eclipse.ui.IEditorPart getActiveEditor()
-
setActiveEditor
public void setActiveEditor(org.eclipse.ui.IEditorPart part)
- Specified by:
setActiveEditorin interfaceorg.eclipse.ui.IEditorActionBarContributor- Overrides:
setActiveEditorin classorg.eclipse.ui.part.MultiPageEditorActionBarContributor
-
setActivePage
public void setActivePage(org.eclipse.ui.IEditorPart part)
- Specified by:
setActivePagein classorg.eclipse.ui.part.MultiPageEditorActionBarContributor
-
deactivate
public void deactivate()
-
activate
public void activate()
-
update
public void update()
-
menuAboutToShow
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implementsIMenuListenerto help fill the context menus with contributions from the Edit menu.- Specified by:
menuAboutToShowin interfaceorg.eclipse.jface.action.IMenuListener
-
addGlobalActions
protected void addGlobalActions(org.eclipse.jface.action.IMenuManager menuManager)
This inserts global actions before the "additions-end" separator.
-
propertyChanged
public void propertyChanged(java.lang.Object source, int id)- Specified by:
propertyChangedin interfaceorg.eclipse.ui.IPropertyListener
-
-