ghm.follow.io
Class JTextComponentDestination

java.lang.Object
  extended by ghm.follow.io.FilterableOutputDestination
      extended by ghm.follow.io.JTextComponentDestination
All Implemented Interfaces:
OutputDestination
Direct Known Subclasses:
FilteredDestination

public class JTextComponentDestination
extends FilterableOutputDestination

Implementation of OutputDestination which appends Strings to a JTextComponent.

Author:
Carl Hall
See Also:
OutputDestination, JTextCompnent

Field Summary
protected  boolean autoPositionCaret
           
protected  javax.swing.text.JTextComponent comp
           
 
Constructor Summary
JTextComponentDestination(javax.swing.text.JTextComponent comp, boolean autoPositionCaret)
          Construct a new JTextCompnentDestination.
 
Method Summary
 void addFilteredView()
          Add a filtered view to this destination.
 boolean autoPositionCaret()
           
 void clear()
          Clear all previous text.
 javax.swing.text.JTextComponent getJTextComponent()
           
 void handlePrint(java.lang.String s)
           
 void removeFilteredView()
          Remove a filtered view
 void setAutoPositionCaret(boolean autoPositionCaret)
           
 void setJTextComponent(javax.swing.text.JTextComponent comp)
           
 
Methods inherited from class ghm.follow.io.FilterableOutputDestination
addView, notifyViews, print, removeView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comp

protected javax.swing.text.JTextComponent comp

autoPositionCaret

protected boolean autoPositionCaret
Constructor Detail

JTextComponentDestination

public JTextComponentDestination(javax.swing.text.JTextComponent comp,
                                 boolean autoPositionCaret)
Construct a new JTextCompnentDestination.

Parameters:
jTextPane - text will be appended to this text area
autoPositionCaret - if true, caret will be automatically moved to the bottom of the text area when text is appended
Method Detail

getJTextComponent

public javax.swing.text.JTextComponent getJTextComponent()

setJTextComponent

public void setJTextComponent(javax.swing.text.JTextComponent comp)

addFilteredView

public void addFilteredView()
Add a filtered view to this destination. Filtered views show only a subset of the total output based on filter conditions.

Since:
1.8.0

removeFilteredView

public void removeFilteredView()
Remove a filtered view

Since:
1.8.0

autoPositionCaret

public boolean autoPositionCaret()
Returns:
whether caret will be automatically moved to the bottom of the text area when text is appended

setAutoPositionCaret

public void setAutoPositionCaret(boolean autoPositionCaret)
Parameters:
autoPositionCaret - if true, caret will be automatically moved to the bottom of the text area when text is appended

handlePrint

public void handlePrint(java.lang.String s)
Specified by:
handlePrint in class FilterableOutputDestination

clear

public void clear()
Description copied from interface: OutputDestination
Clear all previous text.



Copyright © 2008. All Rights Reserved.