com.gridsystems.config.tools
Class TextVerifier

java.lang.Object
  extended by javax.swing.InputVerifier
      extended by com.gridsystems.config.tools.TextVerifier
Direct Known Subclasses:
FileVerifier, IpVerifier, NumberVerifier, PasswordVerifier, PatternVerifier

public abstract class TextVerifier
extends javax.swing.InputVerifier

InputVerifier subclass that can be also used in non-Swing environments.

It substitutes the default verify(JComponent) method by a verify(String) method. Although not so general as its superclass, it is a valid implementation for text fields.

Version:
1.0
Author:
Rodrigo Ruiz Aguayo

Field Summary
protected  ErrorSupport support
          The error message.
 
Constructor Summary
TextVerifier(ErrorSupport support)
          Creates an instance.
 
Method Summary
abstract  void cleanErrors()
          Removes from the error support manager the list of errors of this verifier.
protected  void updateError(java.lang.String id, boolean add)
          Shows the error message if a validation error occurs.
 boolean verify(javax.swing.JComponent c)
          
abstract  boolean verify(java.lang.String text)
          Validates a text string.
 
Methods inherited from class javax.swing.InputVerifier
shouldYieldFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

support

protected ErrorSupport support
The error message.

Constructor Detail

TextVerifier

public TextVerifier(ErrorSupport support)
Creates an instance.

Parameters:
support - Error message support.
Method Detail

verify

public boolean verify(javax.swing.JComponent c)

Specified by:
verify in class javax.swing.InputVerifier

verify

public abstract boolean verify(java.lang.String text)
Validates a text string.

Parameters:
text - The string to validate
Returns:
true if the text is valid

updateError

protected void updateError(java.lang.String id,
                           boolean add)
Shows the error message if a validation error occurs.

Parameters:
id - The error identifier
add - The error action

cleanErrors

public abstract void cleanErrors()
Removes from the error support manager the list of errors of this verifier.

This method will be used on field deactivation.



Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.