public final class TextFieldSearchOption extends ExtendedSearchOption
| Constructor and Description |
|---|
TextFieldSearchOption(String code,
String label,
String defaultValue,
Class inputType)
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
convertStringToInputType(String string)
Converts a String, e.g.
|
String |
getDefaultValue()
Initial value on opening the search panel.
|
Class |
getInputType()
Returns the type of input expected for this options (text or number etc).
|
getCode, getDescription, getLabel, setDescription, toStringpublic TextFieldSearchOption(String code, String label, String defaultValue, Class inputType)
code - Unique identifier for this option.label - To display next to the text fielddefaultValue - The initial value in the text field (may be empty regardless of input type).inputType - type of values which this text field accepts. can be one of [String.class,
Integer.class or Double.class]. String.class will result in a normal text field. Integer and
Double.class will gaurantee the user inputs a valid Integer or Double respectively. The value
held by the query for this option will be a String in all cases though (and must be parsed). The
value may be an empty string if the user didnt enter anything and the default is empty, so this
case must be checked for before attempting to parse to a number.public String getDefaultValue()
public Class getInputType()
public Object convertStringToInputType(String string)
getInputType() if it is one of the special types that this
class handles, else returns the String.string - the String to convertgetInputType() if the type is one of the special types that this
class handles, else string.IllegalArgumentException - if string was not in the correct format