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

java.lang.Object
  |
  +--org.eclipse.ui.part.EditorActionBarContributor
        |
        +--org.eclipse.ui.part.MultiPageEditorActionBarContributor
              |
              +--org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
All Implemented Interfaces:
org.eclipse.ui.IEditorActionBarContributor, org.eclipse.jface.action.IMenuListener, org.eclipse.ui.IPropertyListener
Direct Known Subclasses:
EcoreActionBarContributor, GenModelActionBarContributor, MappingEditor.ActionBarContributor

public class EditingDomainActionBarContributor
extends org.eclipse.ui.part.MultiPageEditorActionBarContributor
implements org.eclipse.jface.action.IMenuListener, 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 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()
           
 
Methods inherited from class org.eclipse.ui.part.EditorActionBarContributor
dispose, getActionBars, getPage, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
Overrides:
init in class org.eclipse.ui.part.EditorActionBarContributor

contributeToMenu

public void contributeToMenu(org.eclipse.jface.action.IMenuManager menuManager)
Overrides:
contributeToMenu in class org.eclipse.ui.part.EditorActionBarContributor

contributeToStatusLine

public void contributeToStatusLine(org.eclipse.jface.action.IStatusLineManager statusLineManager)
Overrides:
contributeToStatusLine in class org.eclipse.ui.part.EditorActionBarContributor

contributeToToolBar

public void contributeToToolBar(org.eclipse.jface.action.IToolBarManager toolBarManager)
Overrides:
contributeToToolBar in class org.eclipse.ui.part.EditorActionBarContributor

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)
Overrides:
setActiveEditor in class org.eclipse.ui.part.MultiPageEditorActionBarContributor

setActivePage

public void setActivePage(org.eclipse.ui.IEditorPart part)
Overrides:
setActivePage in class org.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 implements IMenuListener to help fill the context menus with contributions from the Edit menu.
Specified by:
menuAboutToShow in interface org.eclipse.jface.action.IMenuListener

propertyChanged

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

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