com.bluemarsh.jswat
Class MacroManager

java.lang.Object
  |
  +--com.bluemarsh.jswat.DefaultManager
        |
        +--com.bluemarsh.jswat.MacroManager
All Implemented Interfaces:
Manager, SessionListener

public class MacroManager
extends DefaultManager

Class MacroManager is responsible for managing the macros defined by the user.

Author:
Nathan Fiedler

Field Summary
protected  java.util.Hashtable macroList
          List of available macros.
 
Fields inherited from class com.bluemarsh.jswat.DefaultManager
swat
 
Constructor Summary
MacroManager()
          Constructs a MacroManager with the default input field.
 
Method Summary
 void createMacro(java.lang.String name, java.util.Vector cmnds)
          Creates a command macro.
 java.util.Vector getMacro(java.lang.String name)
          Remove the given command macro.
 java.util.Iterator macroNames()
          Builds and returns a list of the names of all the defined macros, in alphabetical order.
 void removeMacro(java.lang.String name)
          Remove the given command macro.
 
Methods inherited from class com.bluemarsh.jswat.DefaultManager
activate, close, deactivate, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

macroList

protected java.util.Hashtable macroList
List of available macros. Key is the macro name, value is a Vector of command strings.
Constructor Detail

MacroManager

public MacroManager()
Constructs a MacroManager with the default input field.
Method Detail

createMacro

public void createMacro(java.lang.String name,
                        java.util.Vector cmnds)
Creates a command macro. Subsequent uses of the macro name will result in executing the matching command.
Parameters:
name - name of new macro.
cmnds - command strings for macro.

getMacro

public java.util.Vector getMacro(java.lang.String name)
Remove the given command macro.
Parameters:
name - name of macro to remove.
Returns:
defined macro, or null if none.

macroNames

public java.util.Iterator macroNames()
Builds and returns a list of the names of all the defined macros, in alphabetical order.
Returns:
sorted list of macro names, or null if none.

removeMacro

public void removeMacro(java.lang.String name)
Remove the given command macro.
Parameters:
name - name of macro to remove.