|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--ccl.util.OutputErrorStreamManager
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 |
public OutputErrorStreamManager()
Method Detail |
public void setAutoClear(boolean bAutoClear_)
public void install()
public void deinstall()
public java.lang.String getStreamsBuffer()
public void clearStreamsBuffer()
public void setVisible(boolean bVisible_)
protected void setChanged()
setChanged
in class java.util.Observable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |