com.bluemarsh.jswat.command
Class helpCommand

java.lang.Object
  |
  +--com.bluemarsh.jswat.command.JSwatCommand
        |
        +--com.bluemarsh.jswat.command.helpCommand

public class helpCommand
extends JSwatCommand

Defines the class that handles the 'help' command.

Author:
Nathan Fiedler

Field Summary
protected  java.lang.String currentCategory
          The current interactive help category.
 
Fields inherited from class com.bluemarsh.jswat.command.JSwatCommand
logCategory, primitiveTypeNames, swat
 
Constructor Summary
helpCommand()
           
 
Method Summary
protected  void handleCategorySelection(Log out, CommandManager cmdman, java.lang.String input)
          User has selected a help category.
protected  void handleUp(Log out, CommandManager cmdman)
          Go up one help category.
 void perform(Session session, com.bluemarsh.util.StringTokenizer args, Log out)
          Perform the 'help' command.
protected  void printCategory(Log out, java.lang.String category)
          Prints the strings for the named help category, preceeded by the standard category header, and followed by the standard category footer.
protected  void printFooter(Log out, java.lang.String category)
          Prints the standard category footer, along with the given category name in square brackets (e.g.
 void receiveInput(Session session, Log out, CommandManager cmdman, java.lang.String input)
          Called by the CommandManager when new input has been received from the user.
 
Methods inherited from class com.bluemarsh.jswat.command.JSwatCommand
argumentsMatch, createObject, description, findClassesByPattern, getCommandName, getPromptString, help, help, missingArgs, resolveOverload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentCategory

protected java.lang.String currentCategory
The current interactive help category.
Constructor Detail

helpCommand

public helpCommand()
Method Detail

handleCategorySelection

protected void handleCategorySelection(Log out,
                                       CommandManager cmdman,
                                       java.lang.String input)
User has selected a help category.
Parameters:
out - Output to write messages to.
cmdman - CommandManager that's calling us.
input - Trimmed input from user.

handleUp

protected void handleUp(Log out,
                        CommandManager cmdman)
Go up one help category.
Parameters:
out - Output to write messages to.
cmdman - CommandManager that's calling us.

perform

public void perform(Session session,
                    com.bluemarsh.util.StringTokenizer args,
                    Log out)
Perform the 'help' command.
Overrides:
perform in class JSwatCommand
Parameters:
session - JSwat session on which to operate.
args - Tokenized string of command arguments.
out - Output to write messages to.

printCategory

protected void printCategory(Log out,
                             java.lang.String category)
Prints the strings for the named help category, preceeded by the standard category header, and followed by the standard category footer.
Parameters:
log - Output to write messages to.
category - Help category to display.

printFooter

protected void printFooter(Log out,
                           java.lang.String category)
Prints the standard category footer, along with the given category name in square brackets (e.g. "[cat]:").
Parameters:
out - Output to write messages to.
category - Help category to display.

receiveInput

public void receiveInput(Session session,
                         Log out,
                         CommandManager cmdman,
                         java.lang.String input)
Called by the CommandManager when new input has been received from the user. This asynchronously follows a call to CommandManager.grabInput()
Overrides:
receiveInput in class JSwatCommand
Parameters:
session - JSwat session on which to operate.
out - Output to write messages to.
cmdman - CommandManager that's calling us.
input - Input from user.