|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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
org.gwtbootstrap3.client.ui.gwt.ButtonBase
org.gwtbootstrap3.client.ui.CheckBox
public class CheckBox
A standard check box widget.
This class also serves as a base class for Radio.
setDirectionEstimator(boolean) or
passing a DirectionEstimator parameter to the constructor, and is off by
default.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary | |
|---|---|
protected InputElement |
inputElem
|
protected SpanElement |
labelElem
|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
|
CheckBox()
|
protected |
CheckBox(Element element,
InputElement inputElement)
|
|
CheckBox(SafeHtml label)
Creates a check box with the specified text label. |
|
CheckBox(SafeHtml label,
DirectionEstimator directionEstimator)
Creates a check box with the specified text label. |
|
CheckBox(SafeHtml label,
HasDirection.Direction dir)
Creates a check box with the specified text label. |
|
CheckBox(String label)
Creates a check box with the specified text label. |
|
CheckBox(String label,
boolean asHTML)
Creates a check box with the specified text label. |
|
CheckBox(String label,
DirectionEstimator directionEstimator)
Creates a label with the specified text and a default direction estimator. |
|
CheckBox(String label,
HasDirection.Direction dir)
Creates a check box with the specified text label. |
| Method Summary | |
|---|---|
HandlerRegistration |
addChangeHandler(ChangeHandler handler)
|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<Boolean> handler)
|
LeafValueEditor<Boolean> |
asEditor()
|
protected void |
ensureDomEventHandlers()
|
DirectionEstimator |
getDirectionEstimator()
|
String |
getFormValue()
Returns the value property of the input element that backs this widget. |
String |
getHTML()
|
String |
getName()
|
int |
getTabIndex()
|
String |
getText()
|
HasDirection.Direction |
getTextDirection()
|
Boolean |
getValue()
Determines whether this check box is currently checked. |
boolean |
getWordWrap()
|
boolean |
isEnabled()
|
protected void |
onEnsureDebugId(String baseID)
Affected Elements: -input = checkbox. |
protected void |
onLoad()
This method is called when a widget is attached to the browser's document. |
protected void |
onUnload()
This method is called when a widget is detached from the browser's document. |
void |
setAccessKey(char key)
|
void |
setDirectionEstimator(boolean enabled)
|
void |
setDirectionEstimator(DirectionEstimator directionEstimator)
|
void |
setEnabled(boolean enabled)
|
void |
setFocus(boolean focused)
|
void |
setFormValue(String value)
Set the value property on the input element that backs this widget. |
void |
setHTML(SafeHtml html,
HasDirection.Direction dir)
|
void |
setHTML(String html)
|
void |
setName(String name)
|
void |
setTabIndex(int index)
|
void |
setText(String text)
|
void |
setText(String text,
HasDirection.Direction dir)
|
void |
setValue(Boolean value)
Checks or unchecks the check box. |
void |
setValue(Boolean value,
boolean fireEvents)
Checks or unchecks the check box, firing ValueChangeEvent if
appropriate. |
void |
setWordWrap(boolean wrap)
|
void |
sinkEvents(int eventBitsToAdd)
|
| Methods inherited from class org.gwtbootstrap3.client.ui.gwt.ButtonBase |
|---|
getId, getPull, setHiddenOn, setId, setPull, setVisibleOn |
| Methods inherited from class com.google.gwt.user.client.ui.ButtonBase |
|---|
setHTML |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, removeFromParent, setLayoutData, unsinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Methods inherited from interface com.google.gwt.safehtml.client.HasSafeHtml |
|---|
setHTML |
| Field Detail |
|---|
protected final SpanElement labelElem
protected final InputElement inputElem
| Constructor Detail |
|---|
public CheckBox(SafeHtml label)
label - the check box's label
public CheckBox(SafeHtml label,
HasDirection.Direction dir)
label - the check box's labeldir - the text's direction. Note that DEFAULT means
direction should be inherited from the widget's parent
element.
public CheckBox(SafeHtml label,
DirectionEstimator directionEstimator)
label - the check box's labeldirectionEstimator - A DirectionEstimator object used for automatic direction
adjustment. For convenience,
#DEFAULT_DIRECTION_ESTIMATOR can be used.public CheckBox(String label)
label - the check box's label
public CheckBox(String label,
HasDirection.Direction dir)
label - the check box's labeldir - the text's direction. Note that DEFAULT means
direction should be inherited from the widget's parent
element.
public CheckBox(String label,
DirectionEstimator directionEstimator)
label - the check box's labeldirectionEstimator - A DirectionEstimator object used for automatic direction
adjustment. For convenience,
#DEFAULT_DIRECTION_ESTIMATOR can be used.
public CheckBox(String label,
boolean asHTML)
label - the check box's labelasHTML - true to treat the specified label as htmlpublic CheckBox()
protected CheckBox(Element element,
InputElement inputElement)
| Method Detail |
|---|
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Boolean> handler)
addValueChangeHandler in interface HasValueChangeHandlers<Boolean>public HandlerRegistration addChangeHandler(ChangeHandler handler)
addChangeHandler in interface HasChangeHandlerspublic LeafValueEditor<Boolean> asEditor()
asEditor in interface IsEditor<LeafValueEditor<Boolean>>public DirectionEstimator getDirectionEstimator()
getDirectionEstimator in interface HasDirectionEstimatorpublic String getFormValue()
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.
getFormValue in interface HasFormValuepublic String getHTML()
getHTML in interface HasHTMLgetHTML in class ButtonBasepublic String getName()
getName in interface HasNamepublic int getTabIndex()
getTabIndex in interface FocusablegetTabIndex in class FocusWidgetpublic String getText()
getText in interface HasTextgetText in class ButtonBasepublic HasDirection.Direction getTextDirection()
getTextDirection in interface HasDirectionalTextpublic Boolean getValue()
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()
getValue in interface TakesValue<Boolean>getValue in interface HasValue<Boolean>true if the check box is checked, false otherwise.
Will not return nullpublic boolean getWordWrap()
getWordWrap in interface HasWordWrappublic boolean isEnabled()
isEnabled in interface HasEnabledisEnabled in class ButtonBasepublic void setEnabled(boolean enabled)
setEnabled in interface HasEnabledsetEnabled in class ButtonBasepublic void setAccessKey(char key)
setAccessKey in interface FocusablesetAccessKey in class FocusWidgetpublic void setDirectionEstimator(boolean enabled)
See note at setDirectionEstimator(DirectionEstimator).
setDirectionEstimator in interface HasDirectionEstimatorpublic void setDirectionEstimator(DirectionEstimator directionEstimator)
Note: DirectionEstimator should be set before the label has any content; it's highly recommended to set it using a constructor. Reason: if the label already has non-empty content, this will update its direction according to the new estimator's result. This may cause flicker, and thus should be avoided.
setDirectionEstimator in interface HasDirectionEstimatorpublic void setFocus(boolean focused)
setFocus in interface FocusablesetFocus in class FocusWidgetpublic void setFormValue(String value)
FormPanel that holds it is submitted
and the box is checked.
Don't confuse this with setValue(java.lang.Boolean), which actually checks and
unchecks the box.
setFormValue in interface HasFormValuevalue -
public void setHTML(SafeHtml html,
HasDirection.Direction dir)
setHTML in interface HasDirectionalSafeHtmlpublic void setHTML(String html)
setHTML in interface HasHTMLsetHTML in class ButtonBasepublic void setName(String name)
setName in interface HasNamepublic void setTabIndex(int index)
setTabIndex in interface FocusablesetTabIndex in class FocusWidgetpublic void setText(String text)
setText in interface HasTextsetText in class ButtonBase
public void setText(String text,
HasDirection.Direction dir)
setText in interface HasDirectionalTextpublic void setValue(Boolean value)
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)
setValue in interface TakesValue<Boolean>setValue in interface HasValue<Boolean>value - true to check, false to uncheck; null value implies false
public void setValue(Boolean value,
boolean fireEvents)
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)
setValue in interface HasValue<Boolean>value - true to check, false to uncheck; null value implies falsefireEvents - If true, and value has changed, fire a
ValueChangeEventpublic void setWordWrap(boolean wrap)
setWordWrap in interface HasWordWrappublic void sinkEvents(int eventBitsToAdd)
sinkEvents in class Widgetprotected void ensureDomEventHandlers()
protected void onEnsureDebugId(String baseID)
onEnsureDebugId in class UIObjectUIObject.onEnsureDebugId(String)protected void onLoad()
Widget.onAttach() to preserve the
onAttach contract.
onLoad in class Widgetprotected void onUnload()
inputElem.
onUnload in class Widget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||