public class TextInputControl extends InputControl
InputControl.ControlInfo, InputControl.FieldValueError, InputControl.ValueInfo
Modifier and Type | Field and Description |
---|---|
static String |
FORMAT_UNIT |
CURRENCY_CODE_ATTRIBUTE, FILE_DATA_COLUMN_ATTRIBUTE, log, MAXVALUE_ATTRIBUTE, MINVALUE_ATTRIBUTE, NO_VALUE, NULL_VALUE, NUMBER_FORMAT_ATTRIBUTE, NUMBER_FRACTION_DIGITS, NUMBER_GROUPSEP_ATTRIBUTE
Constructor and Description |
---|
TextInputControl() |
Modifier and Type | Method and Description |
---|---|
protected String |
formatValue(InputControl.ValueInfo vi,
boolean appendUnit) |
protected String |
formatValue(Object value,
InputControl.ValueInfo vi,
boolean hasError)
Returns the value formated as a string
this is a simple default implementation that does no type-secific formatting
Derived classes may override formatString an provide further formmatting
see TextInputControl for details
|
protected DateFormat |
getDateFormat(DataType dataType,
Locale locale,
Column column) |
protected int |
getMaxInputLength(Column col) |
protected NumberFormat |
getNumberFormat(DataType dataType,
Locale locale,
Column column) |
protected DataType |
getValueType(Object value,
DataType desiredType) |
protected void |
internalRenderText(HtmlWriter writer,
InputControl.ValueInfo vi)
this method renders a record value read only
it is internally called by renderText
|
protected Object |
parseDate(String s,
DateFormat df) |
protected Object |
parseDecimal(String s,
NumberFormat nf) |
protected Object |
parseInteger(String s) |
protected Object |
parseValue(String value,
Locale locale,
Column column)
this function may be overridden to parse and convert the input value
to the data type of the supplied column
|
void |
renderInput(HtmlWriter writer,
InputControl.ControlInfo ci)
this method renders a record value for input
|
protected Object |
validate(Object o,
Locale locale,
Column column,
String s)
this function may be overridden to validate a value that has
previously been parsed
|
error, error, formatValue, getFieldValue, getFormatOption, hasFormatOption, printText, renderText, useLabelId
public static final String FORMAT_UNIT
protected Object parseValue(String value, Locale locale, Column column)
InputControl
parseValue
in class InputControl
value
- the value string from the requestlocale
- the user localecolumn
- the column for which the value is suppliedprotected Object validate(Object o, Locale locale, Column column, String s)
InputControl
validate
in class InputControl
o
- the parsed object valuecolumn
- the column for which the value should be validateds
- the unparsed value string. In case of an error this should be forwarded to the error function.protected String formatValue(Object value, InputControl.ValueInfo vi, boolean hasError)
InputControl
formatValue
in class InputControl
value
- the value to be formattedvi
- Meta-information about the valueprotected String formatValue(InputControl.ValueInfo vi, boolean appendUnit)
protected void internalRenderText(HtmlWriter writer, InputControl.ValueInfo vi)
InputControl
internalRenderText
in class InputControl
writer
- the HtmlWriter for html write-outvi
- Object holding the value and meta-information about the valuepublic void renderInput(HtmlWriter writer, InputControl.ControlInfo ci)
InputControl
renderInput
in class InputControl
writer
- the HtmlWriter for html write-outci
- Object holding the value and meta-information about the value and the controlprotected int getMaxInputLength(Column col)
protected NumberFormat getNumberFormat(DataType dataType, Locale locale, Column column)
protected DateFormat getDateFormat(DataType dataType, Locale locale, Column column)
protected Object parseDecimal(String s, NumberFormat nf)
protected Object parseDate(String s, DateFormat df)
Copyright © 2008–2015 Apache Software Foundation. All rights reserved.