org.jdesktop.wonderland.common.security
Class Action

java.lang.Object
  extended by org.jdesktop.wonderland.common.security.Action
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChildrenAction, ComponentAction, ConnectAction, ModifyAction, MoveAction, ViewAction

public abstract class Action
extends java.lang.Object
implements java.io.Serializable

An action that a user can perform on a resource. This is the common superclass of all actions in the Wonderland system. An action can be any class that extends Action and has a public, no-argument construtor.

Actions are typically referred to by class, so are not designed to be stateful or mutable.

Author:
jkaplan
See Also:
Serialized Form

Constructor Summary
protected Action(java.lang.String name)
          Create a new top-level action with the given name
protected Action(java.lang.String name, java.lang.Class parentClass)
          Create a new action with the given name and parent
protected Action(java.lang.String name, java.lang.Class parentClass, java.lang.String displayName, java.lang.String toolTip)
          Create a new action with the given name and parent
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two actions are the same if they have the same name
 java.lang.String getDisplayName()
          Get the name to display for this action.
static
<T extends Action>
T
getInstance(java.lang.Class<T> actionClazz)
          Instantiate an action class
 java.lang.String getName()
          Get this action's name
 Action getParent()
          Get this actions parent
 java.lang.Class getParentClass()
          Get the class of this action's parent.
 java.lang.String getToolTip()
          Get the tool tip associated with this action
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

protected Action(java.lang.String name)
Create a new top-level action with the given name

Parameters:
name - the name of the action to created

Action

protected Action(java.lang.String name,
                 java.lang.Class parentClass)
Create a new action with the given name and parent

Parameters:
name - the name of the action to create
parentClass - the class of this action's parent

Action

protected Action(java.lang.String name,
                 java.lang.Class parentClass,
                 java.lang.String displayName,
                 java.lang.String toolTip)
Create a new action with the given name and parent

Parameters:
name - the name of the action to create
parentClass - the class of this action's parent
Method Detail

getName

public java.lang.String getName()
Get this action's name

Returns:
the action's name

getParent

public Action getParent()
Get this actions parent

Returns:
this action's parent, or null if this action is the top-level

getParentClass

public java.lang.Class getParentClass()
Get the class of this action's parent. By default, an action is assigned the same value as its parent.

Returns:
the class of this action's parent, or null if this action is the top-level

getDisplayName

public java.lang.String getDisplayName()
Get the name to display for this action.

Returns:
the display name, or null if the display name is the same as the name

getToolTip

public java.lang.String getToolTip()
Get the tool tip associated with this action

Returns:
the tool tip for this action, or null if the action has no tool tip

equals

public boolean equals(java.lang.Object obj)
Two actions are the same if they have the same name

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare to
Returns:
true if the object is an Action with the same name as this one

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getInstance

public static <T extends Action> T getInstance(java.lang.Class<T> actionClazz)
Instantiate an action class

Parameters:
class - the action class to instantiate
Returns:
the instantiated action


Open Wonderland - http://openwonderland.org