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

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by org.eclipse.emf.edit.ui.action.DelegatingCommandAction
All Implemented Interfaces:
java.util.EventListener, IAction, ISelectionChangedListener, ISelectionListener

public class DelegatingCommandAction
extends Action
implements ISelectionListener, ISelectionChangedListener

This class wraps an IActionDelegate, e.g., a CommandAction, to make it into an Action. Even if the action delegate implements IActionDelegate2, this class will still only use the older interface (i.e. it will not call init, runWithEvent, or dispose, since it does not have the information required to do so).


Field Summary
protected  IActionDelegate actionDelegate
          This is the action delegate we're wrapping.
protected  IEditorActionDelegate editorActionDelegate
          Deprecated. As of EMF 2.1.0, replaced by actionDelegate.
protected  IEditorPart editorPart
          Deprecated. As of EMF 2.1.0, replaced by workbenchPart.
protected  IWorkbenchPart workbenchPart
          This is the current workbench part.
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
DelegatingCommandAction(IActionDelegate actionDelegate)
          This constructs an instance.
DelegatingCommandAction(IEditorActionDelegate editorActionDelegate)
          This constructor is simply retained for binary compatibility.
 
Method Summary
protected  void handleSelection(ISelection selection)
           
protected  void registerSelectionListener(IEditorPart editorPart)
          Deprecated. As of EMF 2.1.0, replaced by registerSelectionListener.
protected  void registerSelectionListener(IWorkbenchPart workbenchPart)
           
 void run()
           
protected  void selectionChanged(ISelection selection)
           
 void selectionChanged(IWorkbenchPart part, ISelection selection)
           
 void selectionChanged(SelectionChangedEvent event)
           
 void setActiveEditor(IEditorPart editorPart)
          Deprecated. As of EMF 2.1.0, replaced by setActiveWorkbenchPart(org.eclipse.ui.IWorkbenchPart).
 void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)
           
protected  void unregisterSelectionListener(IEditorPart editorPart)
          Deprecated. As of EMF 2.1.0, replaced by unregisterSelectionListener.
protected  void unregisterSelectionListener(IWorkbenchPart workbenchPart)
           
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

actionDelegate

protected IActionDelegate actionDelegate
This is the action delegate we're wrapping.

Since:
2.1.0

editorActionDelegate

@Deprecated
protected IEditorActionDelegate editorActionDelegate
Deprecated. As of EMF 2.1.0, replaced by actionDelegate.
If the action delegate is associated with an editor, is also recorded here. This field was retained for backwards compatibility.


workbenchPart

protected IWorkbenchPart workbenchPart
This is the current workbench part.


editorPart

@Deprecated
protected IEditorPart editorPart
Deprecated. As of EMF 2.1.0, replaced by workbenchPart.
If the workbench part is an editor, it is also recorded here. This field was retained for backwards compatibility.

Constructor Detail

DelegatingCommandAction

public DelegatingCommandAction(IActionDelegate actionDelegate)
This constructs an instance.

Since:
2.1.0

DelegatingCommandAction

public DelegatingCommandAction(IEditorActionDelegate editorActionDelegate)
This constructor is simply retained for binary compatibility. It just calls the new form.

Method Detail

selectionChanged

public void selectionChanged(SelectionChangedEvent event)
Specified by:
selectionChanged in interface ISelectionChangedListener

selectionChanged

public void selectionChanged(IWorkbenchPart part,
                             ISelection selection)
Specified by:
selectionChanged in interface ISelectionListener

selectionChanged

protected void selectionChanged(ISelection selection)

handleSelection

protected void handleSelection(ISelection selection)

registerSelectionListener

protected void registerSelectionListener(IWorkbenchPart workbenchPart)
Since:
2.1.0

registerSelectionListener

@Deprecated
protected void registerSelectionListener(IEditorPart editorPart)
Deprecated. As of EMF 2.1.0, replaced by registerSelectionListener.


unregisterSelectionListener

protected void unregisterSelectionListener(IWorkbenchPart workbenchPart)
Since:
2.1.0

unregisterSelectionListener

@Deprecated
protected void unregisterSelectionListener(IEditorPart editorPart)
Deprecated. As of EMF 2.1.0, replaced by unregisterSelectionListener.


setActiveEditor

@Deprecated
public void setActiveEditor(IEditorPart editorPart)
Deprecated. As of EMF 2.1.0, replaced by setActiveWorkbenchPart(org.eclipse.ui.IWorkbenchPart).


setActiveWorkbenchPart

public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)

run

public void run()
Specified by:
run in interface IAction
Overrides:
run in class Action

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