Runtime

## org.eclipse.gmf.runtime.emf.ui.action
Class AbstractModelActionHandler

    java.lang.Object
      org.eclipse.core.commands.common.EventManager
          org.eclipse.jface.action.AbstractAction
              org.eclipse.jface.action.Action
                  org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler
                      org.eclipse.gmf.runtime.emf.ui.action.AbstractModelActionHandler

All Implemented Interfaces:
  IOperationHistoryListener, org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress, org.eclipse.gmf.runtime.common.ui.action.IDisposableAction, IAction, ISelectionChangedListener, IPropertyListener

    public abstract class AbstractModelActionHandler

extends org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler

The abstract parent of all concrete action handlers that execute model commands. Concrete subclasses must provide a definition of the `doRun()` method to gather any required input and execute a model command.

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress
`org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress.WorkIndicatorType`

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, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT`

Constructor Summary
`protected` `AbstractModelActionHandler(IWorkbenchPage workbenchPage)` Constructs a new model action handler for the specified workbench page.
`protected` `AbstractModelActionHandler(IWorkbenchPart workbenchPart)` Constructs a new model action handler for the specified workbench part.

Method Summary
`protected IStatus` `execute(IUndoableOperation operation, IProgressMonitor progressMonitor, IAdaptable info)` Convenience method for subclasses to execute an undoable operation on the action manager's operation history.
`protected abstract TransactionalEditingDomain` `getEditingDomain()` Gets my editing domain.
`protected IStatus` `getStatus()` Gets the status of running this action delegate.
`protected boolean` `isReadOnly()` Answers whether or not I am a read-only action.
`protected boolean` `isSelectionListener()`
`void` `run(IProgressMonitor progressMonitor)` Runs this model action handler as a read action.
`protected void` `setStatus(IStatus status)` Sets the action delegate status.

Methods inherited from class org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler

`contributedToPart, dispose, doRun, getActionManager, getLabel, getOperationHistory, getPartListener, getSelection, getStructuredSelection, getUndoContext, getWorkbenchPage, getWorkbenchPart, getWorkIndicatorType, handle, historyNotification, init, isDisposed, isOperationHistoryListener, isPropertyListener, isRunnable, isSetup, needsSetup, openErrorDialog, propertyChanged, run, runWithEvent, selectionChanged, setDisposed, setPartSelector, setSetup, setup, setWorkbenchPart`

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, 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, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText`

Methods inherited from interface org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress
`refresh`

Constructor Detail

### AbstractModelActionHandler

    protected AbstractModelActionHandler(IWorkbenchPart workbenchPart)

  Constructs a new model action handler for the specified workbench part.

  Parameters:
    `workbenchPart` - The workbench part to which this model action handler applies.

### AbstractModelActionHandler

    protected AbstractModelActionHandler(IWorkbenchPage workbenchPage)

  Constructs a new model action handler for the specified workbench page.

  Parameters:
    `workbenchPage` - The workbench page to which this model action handler applies.

Method Detail

### isSelectionListener

    protected boolean isSelectionListener()

  Overrides:
    `isSelectionListener` in class `org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler`
  See Also:
    `AbstractActionHandler.isSelectionListener()`

### run

    public final void run(IProgressMonitor progressMonitor)

  Runs this model action handler as a read action.

  Specified by:
    `run` in interface `org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress`
  Overrides:
    `run` in class `org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler`
  See Also:
    `IActionWithProgress.run(IProgressMonitor)`

### getEditingDomain

    protected abstract TransactionalEditingDomain getEditingDomain()

  Gets my editing domain. Can be `null` if I don't modify model resources.

  Returns:
    my editing domain.

### isReadOnly

    protected boolean isReadOnly()

  Answers whether or not I am a read-only action. Returns `false` by default. Subclasses may override.

  Returns:
    `false`

### getStatus

    protected IStatus getStatus()

  Gets the status of running this action delegate.

  Returns:
    my status

### setStatus

    protected void setStatus(IStatus status)

  Sets the action delegate status. Subclasses should set the status when they execute a command.

  Parameters:
    `status` - the new status

### execute

    protected IStatus execute(IUndoableOperation operation,
                              IProgressMonitor progressMonitor,
                              IAdaptable info)

  Convenience method for subclasses to execute an undoable operation on the action manager's operation history. Sets my status to the status of the operation execution, and returns that status.

  Parameters:
    `operation` - the operation to be executed
    `progressMonitor` - the progress monitor
    `info` - the adaptable info, may be `null`
  Returns:
    the status of the operation execution.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.