javatools.swing
Class TextComponentChecker

java.lang.Object
  |
  +--javatools.swing.TextComponentChecker
Direct Known Subclasses:
NoSpacesTCChecker, NotEmptyTCChecker, NumericTCChecker, PositiveTCChecker

public abstract class TextComponentChecker
extends java.lang.Object

It is used to manage checking in a text component.


Constructor Summary
TextComponentChecker()
          Creates new TextComponentChecker
 
Method Summary
 void dispatchEvent(java.awt.event.KeyEvent evt)
          Dispatches a KeyEvent to this object.
 java.lang.String getText()
          Returns the text contained in the managed component.
abstract  boolean isValid()
          Checks if the component contains a correct value.
 void setRefTextComponent(javax.swing.text.JTextComponent refComp)
          Sets the referenced text component.
 void syncCheckerText()
          It is useful if text in the component changes without control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextComponentChecker

public TextComponentChecker()
Creates new TextComponentChecker

Method Detail

dispatchEvent

public void dispatchEvent(java.awt.event.KeyEvent evt)
Dispatches a KeyEvent to this object. Call it IN EACH KEY EVENT (KeyPressed, KeyReleased, KeyTyped.

Parameters:
evt - The generated event.

getText

public java.lang.String getText()
Returns the text contained in the managed component.

Returns:
The needed text.

isValid

public abstract boolean isValid()
Checks if the component contains a correct value.

Returns:
true: It is correct. false: It is not correct.

setRefTextComponent

public void setRefTextComponent(javax.swing.text.JTextComponent refComp)
Sets the referenced text component.

Parameters:
refComp - The component to be checked.

syncCheckerText

public void syncCheckerText()
It is useful if text in the component changes without control.