public class CheckBox extends Field<Boolean>
ValueChangeEvent
s are fired when the checkbox
state is changed by the user, instead of waiting for a BlurEvent
.Field.FieldStyles
forceInvalidText, hasFocus, name, originalValue, parseError, preventMark, validationTask
valueUpdater
adjustSize, 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.
|
String |
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(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, 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, validateValue
createContext, getElement, getFocusEl, getKey, getKeyProvider, getValue, onAfterFirstAttach, redraw, redraw, setKeyProvider, setValue
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disable, disableContextMenu, disableEvents, enable, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getFocusSupport, 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, onHide, onHideContextMenu, onLoad, onPosition, onRightClick, onShow, onShowContextMenu, 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, unmask
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBlurHandler
public 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 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 class CellComponent<Boolean>
protected void alignElements()
protected void markInvalid(List<EditorError> msg)
Field
markInvalid
in class Field<Boolean>
msg
- the validation messagepublic void reset()
IsField
protected void onResize(int width, int height)
Component
onResize
in class CellComponent<Boolean>
width
- the widthheight
- the heightCopyright © 2018. All rights reserved.