public class CheckBox extends Field<Boolean> implements HasChangeHandlers
ValueChangeEvent
s are fired when the checkbox
state is changed by the user, instead of waiting for a BlurEvent
.Field.FieldStyles
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Constructor and Description |
---|
CheckBox()
Creates a new check box.
|
CheckBox(CheckBoxCell cell)
Creates a new check box.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addChangeHandler(ChangeHandler handler) |
void |
clear()
Clears the value from the field.
|
void |
clearInvalid()
Clear any invalid styles / messages for this field.
|
String |
getBoxLabel()
Returns the box label.
|
CheckBoxCell |
getCell()
Get the
Cell wrapped by this widget. |
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages.
|
void |
setBoxLabel(String boxLabel)
The text that appears beside the checkbox (defaults to null).
|
void |
setTabIndex(int tabIndex)
Sets the component's tab index.
|
void |
setValue(Boolean value) |
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, finishEditing, flush, forceInvalid, getErrors, getErrorSupport, getName, getOriginalValue, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isValid, isValid, markInvalid, onBrowserEvent, onPropertyChange, removeValidator, setAutoValidate, setDelegate, setErrorSupport, setName, setOriginalValue, setReadOnly, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validate
getElement, getKeyProvider, getValue, redraw, setValue
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
getValue
addBlurHandler
public CheckBox()
public CheckBox(CheckBoxCell cell)
cell
- the check box cellpublic HandlerRegistration addChangeHandler(ChangeHandler handler)
addChangeHandler
in interface HasChangeHandlers
public void clear()
clear
in interface IsField<Boolean>
clear
in class Field<Boolean>
to remove validation messages
,
to restore to original value and remove validation messages
public void clearInvalid()
Field
clearInvalid
in interface IsField<Boolean>
clearInvalid
in class Field<Boolean>
public String getBoxLabel()
public CheckBoxCell getCell()
CellComponent
Cell
wrapped by this widget.public void setBoxLabel(String boxLabel)
boxLabel
- the box labelpublic void setTabIndex(int tabIndex)
Component
setTabIndex
in class Component
tabIndex
- the tab indexpublic void setValue(Boolean value)
CellComponent
This method will redraw the widget if the new value does not equal the existing value.
setValue
in interface ValueAwareEditor<Boolean>
setValue
in interface TakesValue<Boolean>
setValue
in interface HasValue<Boolean>
setValue
in class CellComponent<Boolean>
Copyright © 2015. All rights reserved.