Runtime

## org.eclipse.gmf.runtime.common.ui.action
Class ActionManager

    java.lang.Object
      org.eclipse.gmf.runtime.common.ui.action.ActionManager

public class ActionManager
extends java.lang.Object

Responsible for managing the running of actions. All actions (delegates and handlers) channel their run requests through an action manager. An action manager keeps track of the action that was last run and fires events to interested listeners whenever an action is run.

Field Summary
`protected static java.lang.String` `EMPTY_STRING` The empty string.
`protected static java.lang.String` `SPACE` A string containing only a space character.

Constructor Summary
`ActionManager(IOperationHistory operationHistory)` Intializes me with an operation history.

Method Summary
`void` `addActionManagerChangeListener(IActionManagerChangeListener listener)` Adds the specified listener to the list of action manager change listeners for this action manager.
`void` `clear()` Clears this action manager by discarding the last action that was run.
`protected void` `fireActionManagerChange(ActionManagerChangeEvent event)` Notifies the listeners for this action manager that the specified event has occurred.
`protected IActionWithProgress` `getAction()` Retrieves the value of the `action` instance variable.
`static ActionManager` `getDefault()` Retrieves the default action manager.
`protected java.util.List` `getListeners()` Retrieves the value of the `listeners` instance variable.
`IOperationHistory` `getOperationHistory()` Gets my operation history.
`void` `removeActionManagerChangeListener(IActionManagerChangeListener listener)` Removes the specified listener from the list of action manager change listeners for this action manager.
`void` `run(IActionWithProgress theAction)` Runs the specified action.
`protected void` `setAction(IActionWithProgress action)` Sets the `action` instance variable to the specified value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EMPTY_STRING

    protected static final java.lang.String EMPTY_STRING

  The empty string.

  See Also:
    Constant Field Values

### SPACE

    protected static final java.lang.String SPACE

  A string containing only a space character.

  See Also:
    Constant Field Values

Constructor Detail

### ActionManager

    public ActionManager(IOperationHistory operationHistory)

  Intializes me with an operation history.

Parameters:
  `operationHistory` - The operation history for this action manager.

Method Detail

### getDefault

    public static ActionManager getDefault()

  Retrieves the default action manager.

  Returns:
    The default action manager.

### getOperationHistory

    public final IOperationHistory getOperationHistory()

  Gets my operation history.

  Returns:
    my operation history

### getAction

    protected final IActionWithProgress getAction()

  Retrieves the value of the `action` instance variable.

  Returns:
    The value of the `action` instance variable.

### setAction

    protected final void setAction(IActionWithProgress action)

  Sets the `action` instance variable to the specified value.

  Parameters:
    `action` - The new value for the `action` instance variable.

### getListeners

    protected final java.util.List getListeners()

  Retrieves the value of the `listeners` instance variable.

  Returns:
    The value of the `listeners` instance varible.

### addActionManagerChangeListener

    public void addActionManagerChangeListener(IActionManagerChangeListener listener)

  Adds the specified listener to the list of action manager change listeners for this action manager.

  Parameters:
    `listener` - The listener to be added.

### removeActionManagerChangeListener

    public void removeActionManagerChangeListener(IActionManagerChangeListener listener)

  Removes the specified listener from the list of action manager change listeners for this action manager.

  Parameters:
    `listener` - The listener to be removed.

### fireActionManagerChange

    protected void fireActionManagerChange(ActionManagerChangeEvent event)

  Notifies the listeners for this action manager that the specified event has occurred.

  Parameters:
    `event` - The action manager change event to be fired.

### clear

    public void clear()

  Clears this action manager by discarding the last action that was run.

### run

    public void run(IActionWithProgress theAction)

  Runs the specified action.

  Parameters:
    `theAction` - The action to be run.
  Throws:
    `java.lang.UnsupportedOperationException` - If the action cannot be run.
    `java.lang.RuntimeException` - if any exception or error occurs while running the action

Runtime

Guidelines for using Eclipse APIs.

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