org.eclipse.emf.edit.ui.action
Class EditingDomainActionBarContributor

org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
All Implemented Interfaces:
org.eclipse.ui.IPropertyListener

public class EditingDomainActionBarContributor
implements org.eclipse.ui.IPropertyListener

This is a contributor for an editor, multipage or otherwise, that implements 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 everytime the editor fires to its IPropertyListeners.

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 popup menu.


Field Summary
protected  org.eclipse.ui.IEditorPart activeEditor
          This keeps track of the current editor part.
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  PasteAction pasteAction
          This is the action used to implement paste.
protected  RedoAction redoAction
          This is the action used to implement redo.
protected  UndoAction undoAction
          This is the action used to implement undo.
 
Constructor Summary
EditingDomainActionBarContributor()
          This creates an instance the contributor.
 
Method Summary
 void activate()
           
 void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
           
 void contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)
           
 void contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)
           
 void deactivate()
           
 void init(org.eclipse.ui.IActionBars actionBars)
           
 void menuAboutToShow(org.eclipse.jface.action.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)
           
 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()
           
 

Field Detail

activeEditor

protected org.eclipse.ui.IEditorPart activeEditor
This keeps track of the current editor part.

deleteAction

protected DeleteAction deleteAction
This is the action used to implement delete.

cutAction

protected CutAction cutAction
This is the action used to implement cut.

copyAction

protected CopyAction copyAction
This is the action used to implement copy.

pasteAction

protected PasteAction pasteAction
This is the action used to implement paste.

undoAction

protected UndoAction undoAction
This is the action used to implement undo.

redoAction

protected RedoAction redoAction
This is the action used to implement redo.
Constructor Detail

EditingDomainActionBarContributor

public EditingDomainActionBarContributor()
This creates an instance the contributor.
Method Detail

init

public void init(org.eclipse.ui.IActionBars actionBars)

contributeToMenu

public void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)

contributeToStatusLine

public void contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)

contributeToToolBar

public void contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)

shareGlobalActions

public void shareGlobalActions(org.eclipse.ui.part.IPage page,
                               org.eclipse.ui.IActionBars actionBars)

setActiveView

public void setActiveView(org.eclipse.ui.IViewPart part)
Deprecated.  


setActiveEditor

public void setActiveEditor(org.eclipse.ui.IEditorPart part)

setActivePage

public void setActivePage(org.eclipse.ui.IEditorPart part)

deactivate

public void deactivate()

activate

public void activate()

update

public void update()

menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implements org.eclipse.jface.action.IMenuListener to help fill the context menus with contributions from the Edit menu.

propertyChanged

public void propertyChanged(java.lang.Object source,
                            int id)
Specified by:
propertyChanged in interface org.eclipse.ui.IPropertyListener

Copyright 2001-2002 IBM Corporation and others.
All Rights Reserved.