Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ccl.util
Class OutputErrorStreamManager

    java.lang.Object
      |
      +--java.util.Observable
            |
            +--ccl.util.OutputErrorStreamManager

public class OutputErrorStreamManager
extends java.util.Observable

Replace std out and err with special stream and let listeners register themselves for every occuring message to print out stuff into a dialog e.g.

Here is an example of how you could use this class:

       OutputErrorStreamManager streamManager = new OutputErrorStreamManager();
       streamManager.setAutoClear( false );
       streamManager.install();
       streamManager.setVisible( false );

       doSomething();

       String output = streamManager.getStreamsBuffer();
       streamManager.setVisible( true );
       streamManager.deinstall();

       System.out.println( "Output of last action was: '" + output + "'" );

Nested Class Summary
`class` | `OutputErrorStreamManager.OutputErrorStream` Special stream which hooks into out or err stream.

Constructor Summary
`OutputErrorStreamManager()` Create manager, but do not intall it.

Method Summary
`void` | `clearStreamsBuffer()` Clear stream output buffers.
`void` | `deinstall()` Uninstall special output stream in Java system and restore back original streams.
`java.lang.String` | `getStreamsBuffer()` Return String with content of everything which has been printed into out and err streams.
`void` | `install()` Install special output stream in Java system.
`void` | `setAutoClear(boolean bAutoClear_)` Clear internal buffer automatically on every flush occasion.
`protected void` | `setChanged()` Indicates that this object has changed.
`void` | `setVisible(boolean bVisible_)` Indicator to supress output into original streams.

Methods inherited from class java.util.Observable
`addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OutputErrorStreamManager

    public OutputErrorStreamManager()

  Create manager, but do not intall it.

Method Detail

### setAutoClear

    public void setAutoClear(boolean bAutoClear_)

  Clear internal buffer automatically on every flush occasion.

### install

    public void install()

  Install special output stream in Java system.

### deinstall

    public void deinstall()

  Uninstall special output stream in Java system and restore back original streams.

### getStreamsBuffer

    public java.lang.String getStreamsBuffer()

  Return String with content of everything which has been printed into out and err streams.

### clearStreamsBuffer

    public void clearStreamsBuffer()

  Clear stream output buffers.

### setVisible

    public void setVisible(boolean bVisible_)

  Indicator to supress output into original streams.

### setChanged

    protected void setChanged()

  Indicates that this object has changed.

  Overrides:
    `setChanged` in class `java.util.Observable`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD