com.isti.util.gui.textvalidator
Class TextMinMaxValidator

java.lang.Object
  extended by com.isti.util.gui.textvalidator.TextBasicValidator
      extended by com.isti.util.gui.textvalidator.TextMinMaxValidator
All Implemented Interfaces:
AllowedCharactersConstants, TextValidator, StringConstants
Direct Known Subclasses:
TextNumberValidator

public class TextMinMaxValidator
extends TextBasicValidator

Class TextMinMaxValidator defines methods to validate min/max text.


Field Summary
 
Fields inherited from interface com.isti.util.StringConstants
ALPHA_CAP_CHARS, ALPHA_CHARS, ALPHA_LOW_CHARS, ALPHANUM_CHARS_STRING, ALPHANUMERIC_CHARS, BOOLEAN_FALSE_TEXT, BOOLEAN_TRUE_TEXT, DATE_FORMAT_AMPM_STR, DATE_FORMAT_RFC_822_STR, DATE_FORMAT24_STR, DEFAULT_JAVA_VERSION_STRING, DEFAULT_NULL_STR, DEFAULT_SEP_STR, EFLOAT_CHARS, EMPTY_STRING, FLOAT_CHARS, HEX_ALPHA_CAP_CHARS, HEX_ALPHA_LOW_CHARS, HEX_CHARS, INTEGER_CHARS, INVALID_FILENAME_CHARS, QUOTE_STRING, SIGNED_EFLOAT_CHARS, SIGNED_FLOAT_CHARS, SIGNED_INT_CHARS, SPACE_STRING, TOD_CHARS, WHITE_SPACE_CHARS, WILDCARD_ALL_CHAR, WILDCARD_CHARS, WILDCARD_SINGLE_CHAR
 
Constructor Summary
TextMinMaxValidator(java.lang.String allowedChars, int numColumns, boolean numericFlag, int maxNumChars, java.lang.Comparable min, java.lang.Comparable max)
          Creates a basic text validator.
 
Method Summary
static java.lang.String getToolTipText(java.lang.Comparable min, java.lang.Comparable max)
          Gets the tool tip text based on the min/max values.
 boolean isValid(java.lang.String s)
          Determines if the text is valid.
 boolean isValidEntry(java.lang.String s)
          Determines if the text entry is valid.
 
Methods inherited from class com.isti.util.gui.textvalidator.TextBasicValidator
getAllowedFlag, getColumns, getMaxNumChars, getSpecialChars, getToolTipText, isNumeric, setAllowedFlag, setColumns, setMaxNumChars, setMaxTextLength, setNumericFlag, setSpecialChars, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMinMaxValidator

public TextMinMaxValidator(java.lang.String allowedChars,
                           int numColumns,
                           boolean numericFlag,
                           int maxNumChars,
                           java.lang.Comparable min,
                           java.lang.Comparable max)
Creates a basic text validator.

Parameters:
allowedChars - the allowed characters or null for all.
numColumns - the number of columns or -1 for the default.
numericFlag - true if the characters represent a numeric value, false otherwise.
maxNumChars - the maximum number of characters or 0 if none.
min - the minimum value or null if none.
max - the maximum value or null if none.
See Also:
getToolTipText
Method Detail

getToolTipText

public static final java.lang.String getToolTipText(java.lang.Comparable min,
                                                    java.lang.Comparable max)
Gets the tool tip text based on the min/max values.

Parameters:
min - the minimum value or null if none.
max - the maximum value or null if none.
Returns:
the tool tip text or null if none.

isValid

public boolean isValid(java.lang.String s)
Determines if the text is valid. The text may be only part of the entire text entry.

Specified by:
isValid in interface TextValidator
Overrides:
isValid in class TextBasicValidator
Parameters:
s - the text.
Returns:
true if the text is valid, false otherwise.

isValidEntry

public boolean isValidEntry(java.lang.String s)
Determines if the text entry is valid. The text should be the entire text entry.

Specified by:
isValidEntry in interface TextValidator
Overrides:
isValidEntry in class TextBasicValidator
Parameters:
s - the text.
Returns:
true if the text is valid, false otherwise.