public class ViewActionBarContributor
extends org.eclipse.ui.part.EditorActionBarContributor
implements org.eclipse.jface.action.IMenuListener, org.eclipse.ui.IPropertyListener
IEditingDomainProvider
. It automatically hooks up the Undo, Redo,
Cut, Copy, Paste, and Delete actions on the Edit menu to the corresponding
commands supported by the EditingDomain
.
The editor site'selection provider is used to keep the Cut, Copy, Paste, and
Delete actions up-to-date. 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 |
---|---|
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.action.ControlAction |
controlAction
This is the action used to control or uncontrol a contained object.
|
protected org.eclipse.emf.edit.ui.action.CopyAction |
copyAction
This is the action used to implement copy.
|
protected org.eclipse.emf.edit.ui.action.CutAction |
cutAction
This is the action used to implement cut.
|
protected org.eclipse.emf.edit.ui.action.DeleteAction |
deleteAction
This is the action used to implement delete.
|
protected org.eclipse.emf.edit.ui.action.LoadResourceAction |
loadResourceAction
This is the action used to load a resource.
|
protected org.eclipse.emf.edit.ui.action.PasteAction |
pasteAction
This is the action used to implement paste.
|
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 |
---|
ViewActionBarContributor()
This creates an instance of the contributor.
|
ViewActionBarContributor(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.CopyAction |
createCopyAction()
Returns the action used to implement copy.
|
protected org.eclipse.emf.edit.ui.action.CutAction |
createCutAction()
Returns the action used to implement cut.
|
protected org.eclipse.emf.edit.ui.action.DeleteAction |
createDeleteAction()
Returns the action used to implement delete.
|
protected org.eclipse.emf.edit.ui.action.PasteAction |
createPasteAction()
Returns the action used to implement paste.
|
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.IViewPart |
getActiveView() |
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(java.lang.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 |
setActiveView(org.eclipse.ui.IViewPart part) |
void |
shareGlobalActions(org.eclipse.ui.part.IPage page,
org.eclipse.ui.IActionBars actionBars) |
void |
update() |
protected org.eclipse.emf.edit.ui.action.DeleteAction deleteAction
protected org.eclipse.emf.edit.ui.action.CutAction cutAction
protected org.eclipse.emf.edit.ui.action.CopyAction copyAction
protected org.eclipse.emf.edit.ui.action.PasteAction pasteAction
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.LoadResourceAction loadResourceAction
protected org.eclipse.emf.edit.ui.action.ControlAction controlAction
protected org.eclipse.emf.edit.ui.action.ValidateAction validateAction
public static final int ADDITIONS_LAST_STYLE
protected int style
public ViewActionBarContributor()
public ViewActionBarContributor(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.DeleteAction createDeleteAction()
deleteAction
protected org.eclipse.emf.edit.ui.action.CutAction createCutAction()
cutAction
protected org.eclipse.emf.edit.ui.action.CopyAction createCopyAction()
copyAction
protected org.eclipse.emf.edit.ui.action.PasteAction createPasteAction()
pasteAction
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)
public org.eclipse.ui.IViewPart getActiveView()
public void setActiveView(org.eclipse.ui.IViewPart part)
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(java.lang.Object source, int id)
propertyChanged
in interface org.eclipse.ui.IPropertyListener