Package adams.gui.core
Class CheckedTextField.AbstractCheckModel
- java.lang.Object
-
- adams.gui.core.CheckedTextField.AbstractCheckModel
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BaseObjectTextField.BaseObjectCheckModel,CheckedTextField.StringCheckModel,DateTextField.DateCheckModel,IndexTextField.IndexCheckModel,NumberTextField.NumberCheckModel,RangeTextField.RangeCheckModel,RegExpConstrainedTextField.RegExpConstraintCheckModel
- Enclosing class:
- CheckedTextField
public abstract static class CheckedTextField.AbstractCheckModel extends Object implements Serializable
Abstract model for checking the text from a text field.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_DefaultValuethe default text.
-
Constructor Summary
Constructors Constructor Description AbstractCheckModel()Initializes the model.AbstractCheckModel(String defValue)Initializes the model with the specified default value.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetDefaultValue()Returns the default value in case the current string is not valid.abstract booleanisValid(String text)Checks whether the content is valid.voidsetDefaultValue(String value)Sets the default value to use.StringtoString()Returns a short string representation.
-
-
-
Field Detail
-
m_DefaultValue
protected String m_DefaultValue
the default text.
-
-
Constructor Detail
-
AbstractCheckModel
public AbstractCheckModel()
Initializes the model.
-
AbstractCheckModel
public AbstractCheckModel(String defValue)
Initializes the model with the specified default value.- Parameters:
defValue- the default value to use
-
-
Method Detail
-
isValid
public abstract boolean isValid(String text)
Checks whether the content is valid.- Parameters:
text- the string to check- Returns:
- true if valid
-
setDefaultValue
public void setDefaultValue(String value)
Sets the default value to use.- Parameters:
value- the default
-
getDefaultValue
public String getDefaultValue()
Returns the default value in case the current string is not valid.- Returns:
- the default string to use
-
-