java.lang.Object | |||||
↳ | com.google.gwt.user.client.ui.UIObject | ||||
↳ | com.google.gwt.user.client.ui.Widget | ||||
↳ | com.google.gwt.user.client.ui.FocusWidget | ||||
↳ | com.google.gwt.user.client.ui.ButtonBase | ||||
↳ | com.google.gwt.user.client.ui.CheckBox |
Known Direct Subclasses |
A standard check box widget.
This class also serves as a base class for
RadioButton
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a check box with no label.
| |||||||||||
Creates a check box with the specified text label.
| |||||||||||
Creates a check box with the specified text label.
| |||||||||||
Creates a check box with the specified text label.
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the Editor encapsulated by the view object.
| |||||||||||
Returns the value property of the input element that backs this widget.
| |||||||||||
Gets this object's contents as HTML.
| |||||||||||
Gets the widget's name.
| |||||||||||
Gets the tab index.
| |||||||||||
Gets this object's text.
| |||||||||||
Determines whether this check box is currently checked.
| |||||||||||
Gets whether word-wrapping is enabled.
| |||||||||||
This method is deprecated.
Use
getValue() instead
| |||||||||||
Gets whether this widget is enabled.
| |||||||||||
Sets the widget's 'access key'.
| |||||||||||
This method is deprecated.
Use
setValue(Boolean) instead
| |||||||||||
Sets whether this widget is enabled.
| |||||||||||
Explicitly focus/unfocus this widget.
| |||||||||||
Set the value property on the input element that backs this widget.
| |||||||||||
Sets this object's contents via HTML.
| |||||||||||
Sets the widget's name.
| |||||||||||
Sets the widget's position in the tab index.
| |||||||||||
Sets this object's text.
| |||||||||||
Checks or unchecks the check box, firing
ValueChangeEvent if
appropriate. | |||||||||||
Checks or unchecks the check box.
| |||||||||||
Sets whether word-wrapping is enabled.
| |||||||||||
Overridden to defer the call to super.sinkEvents until the first time this
widget is attached to the dom, as a performance enhancement.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Affected Elements:
| |||||||||||
This method is called when a widget is attached to the browser's document.
| |||||||||||
This method is called when a widget is detached from the browser's
document.
| |||||||||||
Replace the current input element with a new one.
|
Creates a check box with no label.
Creates a check box with the specified text label.
label | the check box's label |
---|
Creates a check box with the specified text label.
label | the check box's label |
---|
Creates a check box with the specified text label.
label | the check box's label |
---|---|
asHTML | true to treat the specified label as html
|
Returns the Editor encapsulated by the view object.
Editor
of type E
Returns the value property of the input element that backs this widget.
This is the value that will be associated with the CheckBox name and
submitted to the server if a FormPanel
that holds it is submitted
and the box is checked.
Don't confuse this with getValue()
, which returns true or false if
the widget is checked.
Gets the tab index.
Determines whether this check box is currently checked.
Note that this does not return the value property of the checkbox
input element wrapped by this widget. For access to that property, see
getFormValue()
true
if the check box is checked, false otherwise.
Will not return null
Gets whether word-wrapping is enabled.
true
if word-wrapping is enabled.
This method is deprecated.
Use getValue()
instead
Determines whether this check box is currently checked.
true
if the check box is checkedGets whether this widget is enabled.
true
if the widget is enabled
Sets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.
key | the widget's access key |
---|
This method is deprecated.
Use setValue(Boolean)
instead
Checks or unchecks this check box. Does not fire ValueChangeEvent
.
(If you want the event to fire, use setValue(Boolean, boolean)
)
checked | true to check the check box. |
---|
Sets whether this widget is enabled.
enabled | true to enable the widget, false
to disable it
|
---|
Explicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events.
focused | whether this widget should take focus or release it |
---|
Set the value property on the input element that backs this widget. This is
the value that will be associated with the CheckBox's name and submitted to
the server if a FormPanel
that holds it is submitted and the box is
checked.
Don't confuse this with setValue(T)
, which actually checks and
unchecks the box.
Sets this object's contents via HTML. Use care when setting an object's
HTML; it is an easy way to expose script-based security problems. Consider
using setText(String)
whenever possible.
html | the object's new HTML |
---|
Sets the widget's position in the tab index. If more than one widget has
the same tab index, each such widget will receive focus in an arbitrary
order. Setting the tab index to -1
will cause this widget to
be removed from the tab order.
index | the widget's tab index |
---|
Checks or unchecks the check box, firing ValueChangeEvent
if
appropriate.
Note that this does not set the value property of the checkbox
input element wrapped by this widget. For access to that property, see
setFormValue(String)
value | true to check, false to uncheck; null value implies false |
---|---|
fireEvents | If true, and value has changed, fire a
ValueChangeEvent
|
Checks or unchecks the check box.
Note that this does not set the value property of the checkbox
input element wrapped by this widget. For access to that property, see
setFormValue(String)
value | true to check, false to uncheck; null value implies false |
---|
Sets whether word-wrapping is enabled.
wrap | true to enable word-wrapping.
|
---|
Overridden to defer the call to super.sinkEvents until the first time this
widget is attached to the dom, as a performance enhancement. Subclasses
wishing to customize sinkEvents can preserve this deferred sink behavior by
putting their implementation behind a check of
isOrWasAttached()
:
@Override public void sinkEvents(int eventBitsToAdd) { if (isOrWasAttached()) { /* customized sink code goes here */ } else { super.sinkEvents(eventBitsToAdd); } }
eventBitsToAdd | a bitfield representing the set of events to be added to this element's event set |
---|
Affected Elements:
baseID | the base ID used by the main element |
---|
This method is called when a widget is attached to the browser's document.
onAttach needs special handling for the CheckBox case. Must still call
onAttach()
to preserve the onAttach
contract.
This method is called when a widget is detached from the browser's
document. Overridden because of IE bug that throws away checked state and
in order to clear the event listener off of the inputElem
.
Replace the current input element with a new one. Preserves all state
except for the name property, for nasty reasons related to radio button
grouping. (See implementation of setName(String)
.)
elem | the new input element |
---|