jcaas.util
Class Console

java.lang.Object
  extended by jcaas.util.Console

public class Console
extends java.lang.Object

This class represents an input/output console for the program running in JDI. This class will open a window with a TextArea and a TextField. The TextArea will be the output from stdout and stderr. The TextField is where the user can enter text that will then be fed to the program's stdin. The Console runs in its own thread, and has an OutputThread as its child.

Author:
steppm

Constructor Summary
Console(java.lang.Process vm, JDIHandler[] _handlers)
          Constructor.
 
Method Summary
 void closeWindow()
          Closes the console frame
 void finish()
          Alert this Console that it should stop.
 boolean isDead()
          Checks to see if the Console is dead (finished running, or error) A Console is unusable after it is dead.
 boolean isRunning()
          Checks to see if the Console is still running.
 void kill()
          Forcably cause this Console to stop, as in response to a UI command, for example.
 void start()
          Starts the Console going.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Console

public Console(java.lang.Process vm,
               JDIHandler[] _handlers)
Constructor. Takes a process from the JDI and a list of JDIHandlers. The JDIHandlers will get handleSTDOUT/STDERR events from the OutputThread, but no handleEvents.

Parameters:
vm - the process for the JDI program
_handlers - a list of JDIHandlers
Method Detail

start

public void start()
Starts the Console going. This will start the OutputThread as well.


isRunning

public boolean isRunning()
Checks to see if the Console is still running.

Returns:
true iff the Console is still running (i.e. not done)

isDead

public boolean isDead()
Checks to see if the Console is dead (finished running, or error) A Console is unusable after it is dead.

Returns:
true iff the Console is dead.

closeWindow

public void closeWindow()
Closes the console frame


kill

public void kill()
Forcably cause this Console to stop, as in response to a UI command, for example.


finish

public void finish()
Alert this Console that it should stop. Like kill(), but less forceful.