gov.sns.application
Class Console

java.lang.Object
  |
  +--gov.sns.application.Console

public class Console
extends java.lang.Object

The Console captures standard output and standard error streams. Both are displayed in a console window. One console serves the entire application. Standard output appears in black text while standard error appears in red text.


Nested Class Summary
protected  class Console.ConsoleErrHandler
          The internal class whose instance handles the error stream.
protected  class Console.ConsoleOutHandler
          The internal class whose instance handles the output stream.
 
Field Summary
protected static Console console
           
protected  javax.swing.text.DefaultStyledDocument document
           
protected  Console.ConsoleErrHandler errStream
           
protected  javax.swing.text.Style errStyle
           
protected  javax.swing.JFrame frame
           
protected  boolean neverShown
           
protected  Console.ConsoleOutHandler outStream
           
protected  javax.swing.text.Style outStyle
           
protected  java.io.PrintStream standardErr
           
protected  java.io.PrintStream standardOut
           
protected  javax.swing.JTextPane textView
           
 
Constructor Summary
Console()
          Creates a new instance of Console
 
Method Summary
static void captureErr()
          Sets the console to capture standard error.
static void captureOutput()
          Sets the console to capture standard output.
static void hide()
          Hide the console.
static void showNear(java.awt.Component sender)
          Show the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

protected static Console console

standardOut

protected java.io.PrintStream standardOut

standardErr

protected java.io.PrintStream standardErr

outStream

protected Console.ConsoleOutHandler outStream

errStream

protected Console.ConsoleErrHandler errStream

frame

protected javax.swing.JFrame frame

neverShown

protected boolean neverShown

textView

protected javax.swing.JTextPane textView

outStyle

protected javax.swing.text.Style outStyle

errStyle

protected javax.swing.text.Style errStyle

document

protected javax.swing.text.DefaultStyledDocument document
Constructor Detail

Console

public Console()
Creates a new instance of Console

Method Detail

captureOutput

public static void captureOutput()
Sets the console to capture standard output.


captureErr

public static void captureErr()
Sets the console to capture standard error.


showNear

public static void showNear(java.awt.Component sender)
Show the console. If the console has never been shown before, place it relative to the sender, otherwise simply show it where it was last placed by the user. However, if the console window is on a different screen than the sender, bring the console window back and display it relative to the sender.

Parameters:
sender - The component relative to which the console should be positioned

hide

public static void hide()
Hide the console.