Runtime

## org.eclipse.gmf.runtime.common.ui.services.action.contributionitem
Class ActionRegistry

    java.lang.Object
      org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ActionRegistry

    public class ActionRegistry

extends java.lang.Object

An action registry used for action life cycle management

Constructor Summary
`ActionRegistry()`

Method Summary
`void` `dispose()` Calls dispose on all actions which implement the `IDisposableAction` interface so they can perform their own clean-up.
`IAction` `getAction(java.lang.Object key)` Returns the action with the given key.
`protected java.util.Iterator` `getActions()` Returns an `Iterator` of all the actions.
`void` `init()` Calls init on all actions which implement the `IDisposableAction` interface so they can do their initialization.
`void` `registerAction(IAction action)` Register an action with this registry.
`void` `registerAction(java.lang.String id, IAction action)` Register an action with this registry using the given id.

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

Constructor Detail

### ActionRegistry

    public ActionRegistry()

Method Detail

### init

    public void init()

  Calls init on all actions which implement the `IDisposableAction` interface so they can do their initialization.

### dispose

    public void dispose()

  Calls dispose on all actions which implement the `IDisposableAction` interface so they can perform their own clean-up.

### getAction

    public IAction getAction(java.lang.Object key)

  Returns the action with the given key. The key is the ID of the action (see `registerAction(IAction)`and `registerAction(String, IAction)`).

  Parameters:
    `key` - the key
  Returns:
    the action

### getActions

    protected java.util.Iterator getActions()

  Returns an `Iterator` of all the actions.

  Returns:
    the iterator

### registerAction

    public void registerAction(IAction action)

  Register an action with this registry. The action must have an id associated with it, which will be used as the key to later obtain the action using `getAction(Object)`.

  Parameters:
    `action` - the action to be registered

### registerAction

    public void registerAction(java.lang.String id,
                               IAction action)

  Register an action with this registry using the given id. The string `id` will be used as the key to later obtain the action using `getAction(Object)`.

  Parameters:
    `id` - the action ID
    `action` - the action

Runtime

Guidelines for using Eclipse APIs.

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