com.ibm.carma.ui.view
Class RAMActionRegistry

java.lang.Object
  extended by com.ibm.carma.ui.view.RAMActionRegistry

public class RAMActionRegistry
extends java.lang.Object

Registry of action states to display in CARMA viewers. The registry can be populated by the com.ibm.carma.ui.ramBrowserActions extension point, or programmaticaly using the setRAMActionState(String, String, RAMActionState) method. The action states are held individually per RAM based on the RAM id.

Since:
7.0.1
See Also:
RAMActionState

Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 RAMActionState getRAMActionState(java.lang.String ramId, java.lang.String actionId)
          Retrieves the stored display state for the given RAM ID and action ID.
 RAMActionState getRegisteredActionState(java.lang.String actionId, org.eclipse.ui.actions.ActionContext context)
          Determines the action state for the given ActionContext
static RAMActionRegistry getRegistry()
          Returns the action state registry.
 boolean isActionRegistered(java.lang.String ramId, java.lang.String actionId)
          Checks if a non-default action state is registered for the RAM.
 void setRAMActionState(java.lang.String ramId, java.lang.String actionId, RAMActionState enabled)
          Sets the action state in the registry for the given ram and action ID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

getRegistry

public static RAMActionRegistry getRegistry()
Returns the action state registry. If the registry has not been created, a new instance is created and initially populated with data from the Eclipse extension providers.

Returns:
the instance of the registry

setRAMActionState

public void setRAMActionState(java.lang.String ramId,
                              java.lang.String actionId,
                              RAMActionState enabled)
Sets the action state in the registry for the given ram and action ID

Parameters:
ramId - the RAM ID to store the action state against
actionId - the action Id to define state for
enabled - the display state

getRAMActionState

public RAMActionState getRAMActionState(java.lang.String ramId,
                                        java.lang.String actionId)
Retrieves the stored display state for the given RAM ID and action ID.

Parameters:
ramId - the RAM ID to retrieve the action state against
actionId - the action ID to retrieve state for
Returns:
the stored action display state

isActionRegistered

public boolean isActionRegistered(java.lang.String ramId,
                                  java.lang.String actionId)
Checks if a non-default action state is registered for the RAM.

Parameters:
ramId - the RAM ID to retrieve the action state for
actionId - the action ID to check
Returns:
true if the action state is set for the given RAM

getRegisteredActionState

public RAMActionState getRegisteredActionState(java.lang.String actionId,
                                               org.eclipse.ui.actions.ActionContext context)
Determines the action state for the given ActionContext

Parameters:
actionId - The action to inspect for state
context - the context in which the action should be inspected
Returns:
the action state for the given action in context