
public class CheckBox extends Field<Boolean>
ValueChangeEvents are fired when the checkbox
state is changed by the user, instead of waiting for a BlurEvent.Field.FieldStylesforceInvalidText, hasFocus, name, originalValue, parseError, preventMark, validationTaskvalueUpdateradjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask| 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) |
protected void |
alignElements() |
void |
clear()
Clears the value from the field.
|
void |
clearInvalid()
Clear any invalid styles / messages for this field.
|
SafeHtml |
getBoxLabel()
Returns the box label.
|
CheckBoxCell |
getCell()
Get the
Cell wrapped by this widget. |
protected void |
markInvalid(List<EditorError> msg)
Actual implementation of markInvalid, which bypasses recording an error in the editor peer.
|
protected void |
onAttach() |
protected void |
onRedraw() |
protected void |
onResize(int width,
int height)
Called after the widget is resized, this method is empty by default but can be implemented by any subclass that
needs to perform custom logic after a resize occurs.
|
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages.
|
void |
setBoxLabel(SafeHtml html)
The html that appears beside the checkbox (defaults to empty string).
|
void |
setBoxLabel(String text)
The text that appears beside the checkbox (defaults to empty string).
|
void |
setTabIndex(int tabIndex)
Sets the component's tab index.
|
void |
setValue(Boolean value) |
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, doAutoValidate, finishEditing, flush, forceInvalid, getErrors, getErrorSupport, getName, getOriginalValue, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isValid, isValid, markInvalid, onBlur, onBrowserEvent, onDetach, onDisable, onEnable, onFocus, onKeyDown, onKeyPress, onKeyUp, onLogicalBlur, onLogicalFocus, onNavigationKey, onPropertyChange, removeValidator, setAutoValidate, setDelegate, setErrors, setErrorSupport, setName, setOriginalValue, setReadOnly, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validate, validateValuecreateContext, getElement, getFocusEl, getKey, getKeyProvider, getValue, redraw, redraw, setKeyProvider, setValueaddBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disable, disableContextMenu, disableEvents, enable, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onHide, onHideContextMenu, onLoad, onPosition, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmaskclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBlurHandlerpublic CheckBox()
public CheckBox(CheckBoxCell cell)
cell - the check box cellpublic HandlerRegistration addChangeHandler(ChangeHandler handler)
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 messagespublic void clearInvalid()
FieldclearInvalid in interface IsField<Boolean>clearInvalid in class Field<Boolean>public SafeHtml getBoxLabel()
public CheckBoxCell getCell()
CellComponentCell wrapped by this widget.public void setBoxLabel(String text)
text - the box label textpublic void setBoxLabel(SafeHtml html)
html - the box label htmlpublic void setTabIndex(int tabIndex)
ComponentsetTabIndex in class ComponenttabIndex - the tab indexpublic void setValue(Boolean value)
CellComponentThis method will redraw the widget if the new value does not equal the existing value.
setValue in class CellComponent<Boolean>protected void alignElements()
protected void markInvalid(List<EditorError> msg)
FieldmarkInvalid in class Field<Boolean>msg - the validation messagepublic void reset()
IsFieldprotected void onResize(int width,
int height)
ComponentonResize in class CellComponent<Boolean>width - the widthheight - the heightCopyright © 2018. All rights reserved.