public class Checkbox extends AbstractField
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CHECKBOX
The pattern used to create the html for a checkbox form field.
|
private static long |
serialVersionUID
The class' serialization version id.
|
PARAM
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
Checkbox(java.lang.String name)
Constructs a new instance of
Checkbox using the supplied
parameters. |
Checkbox(java.lang.String name,
java.lang.String value)
Constructs a new instance of
Checkbox using the supplied
parameters. |
Checkbox(java.lang.String name,
java.lang.String value,
boolean checked)
Constructs a new instance of
Checkbox using the supplied
parameters. |
Checkbox(java.lang.String name,
java.lang.String value,
boolean checked,
java.lang.String stylecls)
Constructs a new instance of
Checkbox 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.
|
boolean |
getChecked()
Returns the checkbox's checked state attribute.
|
java.lang.String |
getText()
Returns the text attribute.
|
java.lang.String |
getValue()
Returns the checkbox's value attribute.
|
void |
setChecked(boolean checked)
Sets the checkbox's checked state attribute.
|
void |
setText(java.lang.String text)
Sets the text attribute.
|
void |
setTextHS(java.lang.String text)
Sets the text attribute.
|
void |
setValue(java.lang.String value)
Sets the checkbox's value attribute.
|
java.lang.String |
toHTML()
Returns a formatted html string for the checkbox'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 CHECKBOX
public Checkbox(java.lang.String name)
Checkbox
using the supplied
parameters. Defaults the checkbox value to "ON", the checked state to
"unchecked" and the style class to "checkbox".name
- (String) The form field name for the checkbox.public Checkbox(java.lang.String name, java.lang.String value)
Checkbox
using the supplied
parameters. Defaults the checkbox checked state to "unchecked" and the
style class to "checkbox".name
- (String) The form field name for the checkbox.value
- (String) The value returned for a checked checkbox.public Checkbox(java.lang.String name, java.lang.String value, boolean checked)
Checkbox
using the supplied
parameters. Defaults the style class to "checkbox".name
- (String) The form field name for the checkbox.value
- (String) The value returned for a checked checkbox.checked
- (boolean) true
to set the initial state
of the checkbox to "checked", otherwise false
.public Checkbox(java.lang.String name, java.lang.String value, boolean checked, java.lang.String stylecls)
Checkbox
using the supplied
parameters.name
- (String) The form field name for the checkbox.value
- (String) The value returned for a checked checkbox.checked
- (boolean) true
to set the initial state
of the checkbox to "checked", otherwise false
.stylecls
- (String) The checkbox's style class.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 boolean getChecked()
public void setChecked(boolean checked)
checked
- (boolean) The checkbox's checked state.public java.lang.String getText()
public void setText(java.lang.String text)
text
- (String) The text. The supplied value is encoded
for html safe characters.public void setTextHS(java.lang.String text)
text
- (String) The text. The supplied value is assumed
to contain html safe characters. No additional encoding is done.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- (String) The checkbox's value.