public class Text extends AbstractField
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
private static java.lang.String |
TEXT
The pattern used to create the html for a text form field.
|
PARAM
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
Text(java.lang.String name)
Constructs a new instance of
Text using the supplied
parameters. |
Text(java.lang.String name,
int size)
Constructs a new instance of
Text using the supplied
parameters. |
Text(java.lang.String name,
int size,
int maxlen)
Constructs a new instance of
Text using the supplied
parameters. |
Text(java.lang.String name,
int size,
int maxlen,
java.lang.String value)
Constructs a new instance of
Text using the supplied
parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares the given object to this object and determines if the two are
equal.
|
protected java.lang.String |
formatAttr(java.lang.String attr)
Returns a formatted html string for the requested attribute value.
|
int |
getMaxLength()
Returns the text's max length attribute.
|
java.lang.String |
getOnChange()
Returns the text's onchange event handler attribute.
|
boolean |
getReadOnly()
Returns the text's readonly state attribute.
|
int |
getSize()
Returns the text's size attribute.
|
java.lang.String |
getValue()
Returns the text's value attribute.
|
void |
setMaxLength(int maxlen)
Sets the text's max length attribute.
|
void |
setOnChange(java.lang.String onchange)
Sets the text's onchange event handler attribute.
|
void |
setReadOnly(boolean readonly)
Sets the text's readonly state attribute.
|
void |
setSize(int size)
Sets the text's size attribute.
|
void |
setValue(java.lang.String value)
Sets the text's value attribute.
|
void |
setValueHS(java.lang.String value)
Sets the text's value attribute.
|
java.lang.String |
toHTML()
Returns a formatted html string for the text's current attribute
values.
|
getDisabled, getId, getName, getOnBlur, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseOut, getOnMouseOver, getStyleCls, getStyleStr, setDisabled, setId, setName, setOnBlur, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseOut, setOnMouseOver, setStyleCls, setStyleStr
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
private static final java.lang.String TEXT
public Text(java.lang.String name)
Text
using the supplied
parameters. Defaults the text size to "1", the maximum length to "1" and
the text value to an empty string.name
- (String) The form field name for the text.public Text(java.lang.String name, int size)
Text
using the supplied
parameters. Defaults the maximum length to the given size and the text
value to an empty string.name
- (String) The form field name for the text.size
- (int) The number of visible characters for the text.public Text(java.lang.String name, int size, int maxlen)
Text
using the supplied
parameters. Defaults the text value to an empty string.name
- (String) The form field name for the text.size
- (int) The number of visible characters for the text.maxlen
- (int) The maximum number of characters that can be
entered into the field.public Text(java.lang.String name, int size, int maxlen, java.lang.String value)
Text
using the supplied
parameters.name
- (String) The form field name for the text.size
- (int) The number of visible characters for the text.maxlen
- (int) The maximum number of characters that can be
entered into the field.value
- (String) The text value to display. The supplied value
is auto-encoded for html safe characters. To construct a field
with text that is already html safe, set this value to an empty
string and then use the setValueHS() method to set the html safe
text value.public boolean equals(java.lang.Object obj)
equals
in class MappedAttributesObject
obj
- (Object) The object to compare with this object.true
if the specified object is equal to
this object, otherwise false
.protected java.lang.String formatAttr(java.lang.String attr)
formatAttr
in AbstractField
.formatAttr
in class AbstractField
AbstractField.formatAttr(java.lang.String)
public java.lang.String toHTML()
toHTML
in AbstractField
.toHTML
in class AbstractField
AbstractField.toHTML()
public int getMaxLength()
public void setMaxLength(int maxlen)
maxlen
- (int) The text's max length.public java.lang.String getOnChange()
public void setOnChange(java.lang.String onchange)
onchange
- (String) The text's onchange event handler.public boolean getReadOnly()
public void setReadOnly(boolean readonly)
readonly
- (boolean) The text's readonly state.public int getSize()
public void setSize(int size)
size
- (int) The text's size.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- (String) The text's value. The supplied value is encoded
for html safe characters.public void setValueHS(java.lang.String value)
value
- (String) The text's value. The supplied value is assumed
to contain html safe characters. No additional encoding is done.