Eclipse GEF
2.1

org.eclipse.gef.ui.actions
Class EditorPartAction

java.lang.Object
  |
  +--org.eclipse.jface.action.Action
        |
        +--org.eclipse.gef.ui.actions.EditorPartAction
All Implemented Interfaces:
Disposable, IAction, UpdateAction
Direct Known Subclasses:
CopyTemplateAction, PrintAction, SaveAction, SelectionAction, StackAction

public abstract class EditorPartAction
extends Action
implements Disposable, UpdateAction

Base class for actions used by GEF editors.


Field Summary
 
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, IMAGE, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
EditorPartAction(IEditorPart editor)
          Creates a new EditorPartAction and sets the editor.
 
Method Summary
protected abstract  boolean calculateEnabled()
          Calculates and returns the enabled state of this action.
 void dispose()
          Called when the action is about to be disposed.
protected  void execute(Command command)
          Executes the given Command.
protected  CommandStack getCommandStack()
          Returns the editor's command stack.
protected  IEditorPart getEditorPart()
          Returns the editor associated with this action.
protected  void init()
          Initializes this action.
 boolean isEnabled()
          Calls calculateEnabled() to determine the enabled state of this action.
protected  void refresh()
          Refreshes the properties of this action.
protected  void setEditorPart(IEditorPart part)
          Sets the editor.
 void update()
           
 
Methods inherited from class org.eclipse.jface.action.Action
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, removeAcceleratorText, removePropertyChangeListener, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorPartAction

public EditorPartAction(IEditorPart editor)
Creates a new EditorPartAction and sets the editor.

Parameters:
editor - The editor to be associated with this action.
Method Detail

calculateEnabled

protected abstract boolean calculateEnabled()
Calculates and returns the enabled state of this action.


dispose

public void dispose()
Called when the action is about to be disposed.

Specified by:
dispose in interface Disposable

execute

protected void execute(Command command)
Executes the given Command.


getCommandStack

protected CommandStack getCommandStack()
Returns the editor's command stack.


getEditorPart

protected IEditorPart getEditorPart()
Returns the editor associated with this action.


init

protected void init()
Initializes this action.


isEnabled

public boolean isEnabled()
Calls calculateEnabled() to determine the enabled state of this action.

Specified by:
isEnabled in interface IAction
Overrides:
isEnabled in class Action

refresh

protected void refresh()
Refreshes the properties of this action.


setEditorPart

protected void setEditorPart(IEditorPart part)
Sets the editor.


update

public void update()
Specified by:
update in interface UpdateAction
See Also:
org.eclipse.gef.UpdateAction#update()

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.