public class EditingDomainActionBarContributor
extends MultiPageEditorActionBarContributor
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 |
---|---|
protected 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 ControlAction |
controlAction
This is the action used to control or uncontrol a contained object.
|
protected CopyAction |
copyAction
This is the action used to implement copy.
|
protected CutAction |
cutAction
This is the action used to implement cut.
|
protected DeleteAction |
deleteAction
This is the action used to implement delete.
|
protected DiagnosticDecorator.LiveValidator.LiveValidationAction |
liveValidationAction
This is the action used to perform validation.
|
protected LoadResourceAction |
loadResourceAction
This is the action used to load a resource.
|
protected PasteAction |
pasteAction
This is the action used to implement paste.
|
protected RedoAction |
redoAction
This is the action used to implement redo.
|
protected int |
style
This is used to encode the style bits.
|
protected UndoAction |
undoAction
This is the action used to implement undo.
|
protected ValidateAction |
validateAction
This is the action used to perform validation.
|
Constructor and Description |
---|
EditingDomainActionBarContributor()
This creates an instance of the contributor.
|
EditingDomainActionBarContributor(int style)
This creates an instance of the contributor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate() |
protected void |
addGlobalActions(IMenuManager menuManager)
This inserts global actions before the "additions-end" separator.
|
void |
contributeToMenu(IMenuManager menuManager) |
void |
contributeToStatusLine(IStatusLineManager statusLineManager) |
void |
contributeToToolBar(IToolBarManager toolBarManager) |
protected CopyAction |
createCopyAction()
Returns the action used to implement copy.
|
protected CutAction |
createCutAction()
Returns the action used to implement cut.
|
protected DeleteAction |
createDeleteAction()
Returns the action used to implement delete.
|
protected PasteAction |
createPasteAction()
Returns the action used to implement paste.
|
protected RedoAction |
createRedoAction()
Returns the action used to implement redo.
|
protected UndoAction |
createUndoAction()
Returns the action used to implement undo.
|
void |
deactivate() |
IEditorPart |
getActiveEditor() |
void |
init(IActionBars actionBars) |
void |
menuAboutToShow(IMenuManager menuManager)
This implements
org.eclipse.jface.action.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 |
setActiveEditor(IEditorPart part) |
void |
setActivePage(IEditorPart part) |
void |
setActiveView(IViewPart part)
Deprecated.
|
void |
shareGlobalActions(IPage page,
IActionBars actionBars) |
void |
update() |
protected IEditorPart activeEditor
protected DeleteAction deleteAction
protected CutAction cutAction
protected CopyAction copyAction
protected PasteAction pasteAction
protected UndoAction undoAction
protected RedoAction redoAction
protected LoadResourceAction loadResourceAction
protected ControlAction controlAction
protected ValidateAction validateAction
protected DiagnosticDecorator.LiveValidator.LiveValidationAction liveValidationAction
public static final int ADDITIONS_LAST_STYLE
protected int style
public EditingDomainActionBarContributor()
public EditingDomainActionBarContributor(int style)
public void init(IActionBars actionBars)
protected DeleteAction createDeleteAction()
deleteAction
protected CutAction createCutAction()
cutAction
protected CopyAction createCopyAction()
copyAction
protected PasteAction createPasteAction()
pasteAction
protected UndoAction createUndoAction()
undoAction
protected RedoAction createRedoAction()
redoAction
protected boolean removeAllReferencesOnDelete()
public void contributeToMenu(IMenuManager menuManager)
public void contributeToStatusLine(IStatusLineManager statusLineManager)
public void contributeToToolBar(IToolBarManager toolBarManager)
public void shareGlobalActions(IPage page, IActionBars actionBars)
@Deprecated public void setActiveView(IViewPart part)
public IEditorPart getActiveEditor()
public void setActiveEditor(IEditorPart part)
public void setActivePage(IEditorPart part)
public void deactivate()
public void activate()
public void update()
public void menuAboutToShow(IMenuManager menuManager)
org.eclipse.jface.action.IMenuListener
to help fill the context menus with contributions from the Edit menu.protected void addGlobalActions(IMenuManager menuManager)
public void propertyChanged(java.lang.Object source, int id)