com.bluemarsh.jswat.action
Class ActionTable

java.lang.Object
  |
  +--com.bluemarsh.jswat.action.ActionTable

public class ActionTable
extends java.lang.Object

This class holds the application actions and provides access to them.

Author:
Nathan Fiedler

Field Summary
protected static java.lang.String ACTION_SUFFIX
          Suffix added to command string to retrieve action classes.
protected static java.util.Hashtable actionTable
          Table of available actions in our program.
 
Constructor Summary
ActionTable()
           
 
Method Summary
static javax.swing.Action getAction(java.lang.String cmd)
          Retrieves the action corresponding to the given command string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_SUFFIX

protected static final java.lang.String ACTION_SUFFIX
Suffix added to command string to retrieve action classes.

actionTable

protected static java.util.Hashtable actionTable
Table of available actions in our program. Other classes can look up actions by their action string using the getAction() method.
Constructor Detail

ActionTable

public ActionTable()
Method Detail

getAction

public static javax.swing.Action getAction(java.lang.String cmd)
Retrieves the action corresponding to the given command string. This will first look in the list of actions registered with ActionTable. If the action is not there, it will try to instantiate the action. If successful, it adds the action to the list of registered actions and returns a reference to the action. Else it does nothing and returns null.
Parameters:
cmd - command string to find action for.
Returns:
action matching command string or null if not found.