Shell is an abstract class. It contains a constructor that takes one parameter, which is the name of the shell to display in the console window and various other places:
public Shell
(
String name
)
;
This class defines the following abstract methods, which your shell must override:
public void printInfoMessage
( | console) ; | |
console) ; |
This method is invoked by the console when the user selects the shell in question. It should print a short informational message, outlining the main capabilities of the shell.
public void execute
( | console, | |
console, | ||
output, | ||
command) ; |
This method is called when the user enters a command. The complete command line is passed in as one string; how it is parsed is entirely up to you.
The output object is either the console window itself, or a special BufferOutput object if the user elected to have the command output go into a new buffer.
Note that both the console and output objects implement the Output interface. As a convention, fatal errors (for example, parse errors in shell commands) should be printed in the console; everything else should go to the output instance.
public void stop
( | console) ; | |
console) ; |
If your shell executes commands in a separate thread, this method should stop the currently running thread, if any.
public boolean waitFor
( | console) ; | |
console) ; |
This method should block until the currently running command has completed, and return true if the command executed successfully, false otherwise. If no command is currently running, it should return the status of the most recently run command.