public class CheckBox extends AbstractValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean> implements Checkable<CheckBox>
ValueBox.AutoValidate, ValueBox.AutoValidatorBasicFormElement.FieldHandler<T>BaseDominoElement.ElementHandler<T>, BaseDominoElement.ResizeHandler<T>, BaseDominoElement.StyleEditor<E extends elemental2.dom.HTMLElement,T extends org.jboss.elemento.IsElement<E>>, BaseDominoElement.WavesStylerHasChangeHandlers.ChangeHandler<V>HasValidation.ValidatorchangeHandlers, changeListener, DISABLED, fieldContainer, fieldGroup, FLOATING, FOCUSED, inputContainer, inputListenerelement| Constructor and Description |
|---|
CheckBox()
Creates a checkbox without a label
|
CheckBox(String label)
Creates a checkbox with a label
|
| Modifier and Type | Method and Description |
|---|---|
CheckBox |
addChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler) |
protected boolean |
allowEmptyLabel() |
CheckBox |
check()
Change the component to its checked state
|
CheckBox |
check(boolean silent)
Change the component to its checked state without triggering change handlers
|
protected void |
clearValue(boolean silent)
clear the field value
|
static CheckBox |
create()
Creates a CheckBox without a label
|
static CheckBox |
create(DominoElement<elemental2.dom.HTMLAnchorElement> link)
Creates a CheckBox with a clickable link as a label
|
static CheckBox |
create(elemental2.dom.HTMLAnchorElement link)
Creates a CheckBox with a clickable link as a label
|
static CheckBox |
create(org.jboss.elemento.IsElement<elemental2.dom.HTMLAnchorElement> link)
Creates a CheckBox with a clickable link as a label
|
static CheckBox |
create(String label)
Creates a checkbox with a label
|
protected ValueBox.AutoValidator |
createAutoValidator(ValueBox.AutoValidate autoValidate)
Create an AutoValidator that will automatically validate the component when it loses focus
|
protected elemental2.dom.HTMLInputElement |
createInputElement(String type)
Creates an input element with the specified type
|
protected void |
doSetValue(Boolean value) |
CheckBox |
filledIn()
The CheckBox will be filled with its color instead of a white background
|
CheckBox |
filledOut()
The CheckBox will be filled with a white background, this is the default
|
String |
getStringValue() |
Boolean |
getValue() |
boolean |
hasChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
Checks if a component has the specified ChangeHandler
|
protected boolean |
isAddFocusColor() |
boolean |
isChecked() |
boolean |
isEmpty() |
boolean |
isEmptyIgnoreSpaces() |
CheckBox |
removeChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler) |
CheckBox |
setCheckedReadonlyLabel(String checkedReadonlyLabel) |
CheckBox |
setColor(Color color)
This color will be used for the check mark in the CheckBox or the background for a
filledIn() CheckBox |
CheckBox |
setLabel(String label) |
CheckBox |
setReadOnly(boolean readOnly)
This should render the checkbox as a label based on
setCheckedReadonlyLabel(String)
and setUnCheckedReadonlyLabel(String) |
CheckBox |
setUnCheckedReadonlyLabel(String unCheckedReadonlyLabel) |
CheckBox |
toggle()
Toggle the current state of the CheckBox, if it is checked it will be unchecked, and if it is
unchecked it will be checked
|
CheckBox |
uncheck()
Change the component to its unchecked state
|
CheckBox |
uncheck(boolean silent)
Change the component to its unchecked state without triggering change handlers
|
CheckBox |
value(Boolean value)
set the filed value
|
getMaxLength, getMinLength, getMinLengthErrorMessage, setMaxLength, setMinLength, setMinLengthErrorMessage, updateCharacterCountaddLeftAddOn, addLeftAddOn, addLeftAddOn, addOnClearHandler, addRightAddOn, addRightAddOn, addRightAddOn, asTableField, autoValidate, callChangeHandlers, changeLabelFloating, clear, clear, clearInvalid, clearValue, condense, createLabelElement, createMandatoryAddOn, disable, doFocus, doUnfocus, element, enable, floating, floatLabel, focus, getAdditionalInfoContainer, getCountItem, getErrorItem, getErrorsContainer, getFieldContainer, getFieldGroup, getFieldInputContainer, getFieldStyle, getFocusColor, getHelperContainer, getHelpItem, getInputContainer, getInputElement, getLabelElement, getLabelTextElement, getLeftAddonContainer, getLeftAddOnsContainer, getMandatoryAddOn, getNotesContainer, getOnClearHandlers, getPlaceholder, getPostfix, getPostFixItem, getPrefix, getPrefixItem, getRightAddonContainer, getRightAddOnsContainer, hideLabelText, hidePlaceholder, invalidate, invalidate, isAutoValidation, isFloating, isFocused, isReadOnly, linkLabelToField, nonfloating, onEnterKey, pauseChangeHandlers, pauseFocusValidation, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOn, removeLeftAddOns, removeOnClearHandler, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOn, removeRightAddOns, resumeChangeHandlers, resumeFocusValidation, setAutoValidation, setFieldStyle, setFixErrorsPosition, setFloating, setFocusColor, setLabel, setLabel, setLabel, setLabelTextVisible, setPauseChangeHandlers, setPlaceholder, setPostFix, setPrefix, setSpellCheck, setTableField, shouldShowPlaceholder, showLabelText, showPlaceholder, spread, unfloatLabel, unfocus, updateLabel, valueaddValidator, getErrorLabels, getErrors, getHelperText, getLabel, getName, getRequiredErrorMessage, groupBy, hasValidator, isDisabled, isEnabled, isFixErrorsPosition, isRequired, isShowRequiredIndicator, isValidationDisabled, makeErrorLabel, removeValidator, setHelperText, setName, setRequired, setRequired, setRequiredErrorMessage, setShowRequiredIndicator, setValidationDisabled, setValue, showErrors, ungroup, validate, withValidationDisabledadd, add, addClickListener, addCss, addCss, addEventListener, addEventListener, addEventsListener, addHideListener, addShowListener, alignCenter, alignRight, appendChild, appendChild, apply, attr, blur, childNodes, clearElement, contains, contains, contains, containsCss, css, css, cssClassByIndex, cssClassesCount, cssText, elevate, elevate, firstChild, getAttachObserver, getAttribute, getBoundingClientRect, getChildElementCount, getClickableElement, getCollapsible, getCollapsibleElement, getDetachObserver, getDominoId, getElementsCount, getElevation, getFirstChild, getId, getTextContent, getTooltip, getWavesElement, hasAttribute, hasChildNodes, hasDirectChild, hide, hideOn, id, init, insertAfter, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertBefore, insertFirst, insertFirst, insertFirst, isAttached, isCollapsed, isEmptyElement, isEqualNode, isForceHidden, isHidden, item, lastChild, length, onAttached, onDetached, onResize, pullLeft, pullRight, querySelector, querySelectorAll, remove, removeAttachObserver, removeAttribute, removeChild, removeChild, removeCss, removeCss, removeCssProperty, removeDetachObserver, removeEventListener, removeEventListener, removeHideListener, removeHideOn, removeShowListener, removeShowOn, removeTooltip, removeWaves, replaceCss, setAlignItems, setAttribute, setAttribute, setAttribute, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBottom, setBottom, setBoxShadow, setCollapseStrategy, setColor, setColor, setContent, setContent, setCssProperty, setCssProperty, setCursor, setCursor, setDisabled, setDisplay, setDisplay, setDropMenu, setFlex, setFloat, setFloat, setFontSize, setFontSize, setForceHidden, setHeight, setHeight, setId, setInnerHtml, setLeft, setLeft, setLineHeight, setLineHeight, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setOpacity, setOpacity, setOverFlow, setOverFlow, setOverFlowY, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPointerEvents, setPosition, setPosition, setRight, setRight, setTabIndex, setTextAlign, setTextAlign, setTextContent, setTooltip, setTooltip, setTooltip, setTooltip, setTop, setTop, setTransitionDuration, setWidth, setWidth, setZIndex, show, showOn, style, style, styler, textContent, toggleDisplay, toggleDisplay, withWaves, withWavesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateAllisExpandedadd, add, remove, remove, removeProperty, replace, setProperty, setPropertypublic CheckBox()
public CheckBox(String label)
label - Stringpublic static CheckBox create(String label)
label - Stringpublic static CheckBox create()
public static CheckBox create(org.jboss.elemento.IsElement<elemental2.dom.HTMLAnchorElement> link)
link - HTMLAnchorElement wrapped as IsElementpublic static CheckBox create(elemental2.dom.HTMLAnchorElement link)
link - HTMLAnchorElementpublic static CheckBox create(DominoElement<elemental2.dom.HTMLAnchorElement> link)
link - HTMLAnchorElement wrapped as DominoElementpublic CheckBox toggle()
public CheckBox check()
public CheckBox uncheck()
public CheckBox check(boolean silent)
public CheckBox uncheck(boolean silent)
public boolean isChecked()
public CheckBox addChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
addChangeHandler in interface HasChangeHandlers<CheckBox,Boolean>addChangeHandler in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic CheckBox removeChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
removeChangeHandler in interface HasChangeHandlers<CheckBox,Boolean>removeChangeHandler in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic boolean hasChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
hasChangeHandler in interface HasChangeHandlers<CheckBox,Boolean>hasChangeHandler in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic CheckBox filledIn()
public CheckBox filledOut()
public CheckBox setColor(Color color)
filledIn() CheckBoxcolor - Colorpublic CheckBox value(Boolean value)
public Boolean getValue()
getValue in interface org.gwtproject.editor.client.LeafValueEditor<Boolean>getValue in interface org.gwtproject.editor.client.TakesValue<Boolean>getValue in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>public boolean isEmpty()
isEmpty in interface HasGrouping<CheckBox>isEmpty in class AbstractValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>public boolean isEmptyIgnoreSpaces()
AbstractValueBoxisEmptyIgnoreSpaces in interface HasGrouping<CheckBox>isEmptyIgnoreSpaces in class AbstractValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>public CheckBox setReadOnly(boolean readOnly)
setCheckedReadonlyLabel(String)
and setUnCheckedReadonlyLabel(String)setReadOnly in interface IsReadOnly<CheckBox>setReadOnly in class AbstractValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>readOnly - booleanpublic CheckBox setCheckedReadonlyLabel(String checkedReadonlyLabel)
checkedReadonlyLabel - String label to be used in checked readonly modepublic CheckBox setUnCheckedReadonlyLabel(String unCheckedReadonlyLabel)
unCheckedReadonlyLabel - String label to be used in unchecked readonly modepublic String getStringValue()
getStringValue in interface HasInputElementgetStringValue in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>protected elemental2.dom.HTMLInputElement createInputElement(String type)
createInputElement in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>type - String the input element typeprotected void clearValue(boolean silent)
clearValue in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>protected void doSetValue(Boolean value)
doSetValue in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>value - V the value to set for this fieldprotected boolean isAddFocusColor()
isAddFocusColor in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>protected ValueBox.AutoValidator createAutoValidator(ValueBox.AutoValidate autoValidate)
createAutoValidator in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>autoValidate - ValueBox.AutoValidateprotected boolean allowEmptyLabel()
allowEmptyLabel in class ValueBox<CheckBox,elemental2.dom.HTMLInputElement,Boolean>Copyright © 2019–2022 Dominokit. All rights reserved.