|
||||||||||
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
com.github.gwtbootstrap.client.ui.CheckBox
public class CheckBox
CheckBox widgets.
Re-design for Bootstrap.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
static DirectionEstimator |
DEFAULT_DIRECTION_ESTIMATOR
|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
|
CheckBox()
Creates a check box with no label. |
protected |
CheckBox(Element elem)
|
|
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 | |
---|---|
void |
addStyle(Style style)
Adds the provided style to the widget. |
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<Boolean> handler)
|
LeafValueEditor<Boolean> |
asEditor()
|
protected LabelElement |
asLabel()
|
protected void |
ensureDomEventHandlers()
|
DirectionEstimator |
getDirectionEstimator()
|
String |
getFormValue()
Returns the value property of the input element that backs this widget. |
String |
getHTML()
|
String |
getId()
Get ID |
String |
getName()
|
int |
getTabIndex()
|
String |
getText()
|
HasDirection.Direction |
getTextDirection()
|
Boolean |
getValue()
Determines whether this check box is currently checked. |
boolean |
getWordWrap()
|
boolean |
isChecked()
Deprecated. Use getValue() instead |
boolean |
isEnabled()
|
boolean |
isSearchQuery()
is the element search-query style? |
protected void |
onEnsureDebugId(String baseID)
Affected Elements: -label = label next to 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 |
removeStyle(Style style)
Removes the provided style from the widget. |
protected void |
replaceInputElement(Element elem)
Replace the current input element with a new one. |
void |
setAccessKey(char key)
|
void |
setChecked(boolean checked)
Deprecated. Use setValue(Boolean) instead |
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 |
setHideOn(Device device)
Sets the kind of device, this widget is hidden on. |
void |
setHTML(SafeHtml html,
HasDirection.Direction dir)
|
void |
setHTML(String html)
|
void |
setId(String id)
Set ID |
void |
setInline(boolean inline)
|
void |
setName(String name)
|
void |
setSearchQuery(boolean searchQuery)
Set search-query style to the element. |
void |
setShowOn(Device device)
Sets the kind of device, this widget is shown on. |
void |
setStyle(Style style)
Replaces the widet's style with the provided one. |
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 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 |
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, unsinkEvents |
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 |
---|
public static final DirectionEstimator DEFAULT_DIRECTION_ESTIMATOR
Constructor Detail |
---|
public CheckBox()
public CheckBox(SafeHtml label)
label
- the check box's labelpublic 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 labelpublic 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 htmlprotected CheckBox(Element elem)
Method Detail |
---|
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Boolean> handler)
addValueChangeHandler
in interface HasValueChangeHandlers<Boolean>
public LeafValueEditor<Boolean> asEditor()
asEditor
in interface IsEditor<LeafValueEditor<Boolean>>
public DirectionEstimator getDirectionEstimator()
getDirectionEstimator
in interface HasDirectionEstimator
public 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.
public String getHTML()
getHTML
in interface HasHTML
getHTML
in class ButtonBase
public String getName()
getName
in interface HasName
public int getTabIndex()
getTabIndex
in interface Focusable
getTabIndex
in class FocusWidget
public String getText()
getText
in interface HasText
getText
in class ButtonBase
public HasDirection.Direction getTextDirection()
getTextDirection
in interface HasDirectionalText
public 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 HasWordWrap
@Deprecated public boolean isChecked()
getValue()
instead
true
if the check box is checkedpublic boolean isEnabled()
isEnabled
in interface HasEnabled
isEnabled
in class FocusWidget
public void setAccessKey(char key)
setAccessKey
in interface Focusable
setAccessKey
in class FocusWidget
@Deprecated public void setChecked(boolean checked)
setValue(Boolean)
instead
ValueChangeEvent
. (If you want the event to fire, use setValue(Boolean, boolean)
)
checked
- true
to check the check box.public void setDirectionEstimator(boolean enabled)
See note at setDirectionEstimator(DirectionEstimator)
.
setDirectionEstimator
in interface HasDirectionEstimator
public 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 HasDirectionEstimator
public void setEnabled(boolean enabled)
setEnabled
in interface HasEnabled
setEnabled
in class FocusWidget
public void setFocus(boolean focused)
setFocus
in interface Focusable
setFocus
in class FocusWidget
public 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.
value
- public void setHTML(SafeHtml html, HasDirection.Direction dir)
setHTML
in interface HasDirectionalSafeHtml
public void setHTML(String html)
setHTML
in interface HasHTML
setHTML
in class ButtonBase
public void setName(String name)
setName
in interface HasName
public void setTabIndex(int index)
setTabIndex
in interface Focusable
setTabIndex
in class FocusWidget
public void setText(String text)
setText
in interface HasText
setText
in class ButtonBase
public void setText(String text, HasDirection.Direction dir)
setText
in interface HasDirectionalText
public 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 falsepublic 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
ValueChangeEvent
public void setWordWrap(boolean wrap)
setWordWrap
in interface HasWordWrap
public void sinkEvents(int eventBitsToAdd)
sinkEvents
in class Widget
protected void ensureDomEventHandlers()
protected void onEnsureDebugId(String baseID)
onEnsureDebugId
in class UIObject
UIObject.onEnsureDebugId(String)
protected void onLoad()
Widget.onAttach()
to preserve the
onAttach
contract.
onLoad
in class Widget
protected void onUnload()
inputElem
.
onUnload
in class Widget
protected void replaceInputElement(Element elem)
RadioButton.setName(java.lang.String)
.)
elem
- the new input elementprotected LabelElement asLabel()
public void setInline(boolean inline)
public void setSearchQuery(boolean searchQuery)
setSearchQuery
in interface IsSearchQuery
searchQuery
- true:add search-query css-class/false:remove search-query css-classpublic boolean isSearchQuery()
isSearchQuery
in interface IsSearchQuery
public String getId()
getId
in interface HasId
public void setId(String id)
setId
in interface HasId
id
- set idpublic void setShowOn(Device device)
The widget is not shown on any other device.
Only works if responsive design is turned on!
setShowOn
in interface IsResponsive
Configurator.hasResponsiveDesign()
,
IsResponsive.setHideOn(Device)
public void setHideOn(Device device)
The widget is not hidden on any other device.
Only works if responsive design is turned on!
setHideOn
in interface IsResponsive
Configurator.hasResponsiveDesign()
,
IsResponsive.setShowOn(Device)
public void setStyle(Style style)
setStyle
in interface HasStyle
style
- the style to be applied to the Widget.public void addStyle(Style style)
addStyle
in interface HasStyle
style
- the style to be added to the Widget.public void removeStyle(Style style)
removeStyle
in interface HasStyle
style
- the style to be removed from the Widget.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |