Runtime

## org.eclipse.gmf.runtime.common.ui.util
Class ActionGroupCache

    java.lang.Object
      org.eclipse.gmf.runtime.common.ui.util.ActionGroupCache

public class ActionGroupCache
extends java.lang.Object

Cache for holding the ActionGroups created for part descriptors. This allows them to be properly disposed of when nolonger needed. There are not a lot of ActionGroups so try to be most efficient when none

Constructor Summary
`ActionGroupCache()`

Method Summary
`void` `addActionGroup(java.lang.String actionGroupId, ActionGroup actionGroup, IWorkbenchPartDescriptor partDescriptor)` Add the action group just created with the id to the cache for the part supplied
`boolean` `contains(IWorkbenchPartDescriptor partDescriptor)` Identifies if there are any action groups associated with the part descriptor supplied.
`void` `dispose(IWorkbenchPartDescriptor partDescriptor)` disposes all the action groups associated with the partDescriptor supplied.
`ActionGroup` `getActionGroup(java.lang.String actionGroupId, IWorkbenchPartDescriptor partDescriptor)` Get the cached ActionGroup for the part descriptor with the id supplied

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

Constructor Detail

### ActionGroupCache

    public ActionGroupCache()

Method Detail

### dispose

    public void dispose(IWorkbenchPartDescriptor partDescriptor)

  disposes all the action groups associated with the partDescriptor supplied.

  Parameters:
    `partDescriptor` - - part whose action groups are to be disposed.

### contains

    public boolean contains(IWorkbenchPartDescriptor partDescriptor)

  Identifies if there are any action groups associated with the part descriptor supplied.

  Parameters:
    `partDescriptor` - part to check if it has any action groups.
  Returns:
    true if there are action groups associated, false otherwise

### getActionGroup

    public ActionGroup getActionGroup(java.lang.String actionGroupId,
                                      IWorkbenchPartDescriptor partDescriptor)

  Get the cached ActionGroup for the part descriptor with the id supplied

  Parameters:
    `actionGroupId` - id of the action group to retrieve
    `partDescriptor` - part whose action group is to be retrieved
  Returns:
    the ActionGroup previously created for the part, otherwise null

### addActionGroup

    public void addActionGroup(java.lang.String actionGroupId,
                               ActionGroup actionGroup,
                               IWorkbenchPartDescriptor partDescriptor)

  Add the action group just created with the id to the cache for the part supplied

  Parameters:
    `actionGroupId` - id of the action group to be cached
    `actionGroup` - action group to cache
    `partDescriptor` - part group was created for

Runtime

Guidelines for using Eclipse APIs.

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