public class SwitchButton extends AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean> implements Checkable<SwitchButton>
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 |
|---|
SwitchButton()
Creates a switch without a label
|
SwitchButton(String label) |
SwitchButton(String label,
String onOffTitle) |
SwitchButton(String label,
String offTitle,
String onTitle) |
| Modifier and Type | Method and Description |
|---|---|
SwitchButton |
addChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler) |
SwitchButton |
check()
Change the component to its checked state
|
SwitchButton |
check(boolean silent)
Change the component to its checked state without triggering change handlers
|
SwitchButton |
clear()
Clears the field value and trigger the change handlers
|
protected void |
clearValue(boolean silent)
clear the field value
|
static SwitchButton |
create() |
static SwitchButton |
create(String label,
String onOffTitle) |
static SwitchButton |
create(String label,
String offTitle,
String onTitle) |
protected ValueBox.AutoValidator |
createAutoValidator(ValueBox.AutoValidate autoValidate)
Create an AutoValidator that will automatically validate the component when it loses focus
|
protected elemental2.dom.HTMLElement |
createInputElement(String type)
Creates an input element with the specified type
|
protected void |
doSetValue(Boolean value) |
DominoElement<elemental2.dom.HTMLElement> |
getLever() |
DominoElement<elemental2.dom.HTMLLabelElement> |
getOnOffLabelElement() |
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() |
SwitchButton |
removeChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler) |
SwitchButton |
setCheckedReadonlyLabel(String checkedReadonlyLabel)
Set the label when the state is ON but the switch is readonly
|
SwitchButton |
setColor(Color color)
Sets the color of the Switch when it is ON
|
SwitchButton |
setOffTitle(String offTitle) |
SwitchButton |
setOnTitle(String onTitle) |
SwitchButton |
setReadOnly(boolean readOnly)
set the readonly attribute value
|
SwitchButton |
setUnCheckedReadonlyLabel(String unCheckedReadonlyLabel)
Set the label when the state is OFF but the switch is readonly
|
SwitchButton |
uncheck()
Change the component to its unchecked state
|
SwitchButton |
uncheck(boolean silent)
Change the component to its unchecked state without triggering change handlers
|
protected void |
updateCharacterCount()
Updates the character count based on field string value
|
SwitchButton |
value(Boolean value)
set the filed value
|
getMaxLength, getMinLength, getMinLengthErrorMessage, setMaxLength, setMinLength, setMinLengthErrorMessageaddLeftAddOn, addLeftAddOn, addLeftAddOn, addOnClearHandler, addRightAddOn, addRightAddOn, addRightAddOn, allowEmptyLabel, asTableField, autoValidate, callChangeHandlers, changeLabelFloating, 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, 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 SwitchButton(String label, String offTitle, String onTitle)
label - String label describing the switchoffTitle - String label for the OFF stateonTitle - String label for the ON statepublic SwitchButton(String label, String onOffTitle)
label - String label describing the switchonOffTitle - String label for the ON/OFF statepublic SwitchButton(String label)
label - String label describing the switchpublic SwitchButton()
public static SwitchButton create(String label, String offTitle, String onTitle)
label - String label describing the switchoffTitle - String label for the OFF stateonTitle - String label for the ON statepublic static SwitchButton create(String label, String onOffTitle)
label - String label describing the switchonOffTitle - String label for the OFF statepublic static SwitchButton create()
public DominoElement<elemental2.dom.HTMLElement> getLever()
HTMLElementpublic SwitchButton value(Boolean value)
value in interface HasValue<SwitchButton,Boolean>value in class AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>value - Vprotected void updateCharacterCount()
AbstractValueBoxupdateCharacterCount in class AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>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<SwitchButton,elemental2.dom.HTMLElement,Boolean>public boolean isEmpty()
isEmpty in interface HasGrouping<SwitchButton>isEmpty in class AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>public boolean isEmptyIgnoreSpaces()
isEmptyIgnoreSpaces in interface HasGrouping<SwitchButton>isEmptyIgnoreSpaces in class AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>public SwitchButton clear()
clear in interface HasGrouping<SwitchButton>clear in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>public SwitchButton check()
check in interface Checkable<SwitchButton>public SwitchButton uncheck()
uncheck in interface Checkable<SwitchButton>public SwitchButton check(boolean silent)
check in interface Checkable<SwitchButton>silent - boolean, if true dont trigger change handlerspublic SwitchButton uncheck(boolean silent)
uncheck in interface Checkable<SwitchButton>silent - boolean, if true dont trigger change handlerspublic boolean isChecked()
isChecked in interface Checkable<SwitchButton>public SwitchButton addChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
addChangeHandler in interface HasChangeHandlers<SwitchButton,Boolean>addChangeHandler in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic SwitchButton removeChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
removeChangeHandler in interface HasChangeHandlers<SwitchButton,Boolean>removeChangeHandler in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic boolean hasChangeHandler(HasChangeHandlers.ChangeHandler<? super Boolean> changeHandler)
hasChangeHandler in interface HasChangeHandlers<SwitchButton,Boolean>hasChangeHandler in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>changeHandler - HasChangeHandlers.ChangeHandlerpublic SwitchButton setColor(Color color)
color - Colorpublic SwitchButton setOnTitle(String onTitle)
onTitle - String title for the ON switch statepublic SwitchButton setOffTitle(String offTitle)
offTitle - String title for the OFF switch statepublic DominoElement<elemental2.dom.HTMLLabelElement> getOnOffLabelElement()
public SwitchButton setReadOnly(boolean readOnly)
setReadOnly in interface IsReadOnly<SwitchButton>setReadOnly in class AbstractValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>readOnly - boolean, if true switch the component to readonly mode, otherwise switch out
off readonly modepublic SwitchButton setCheckedReadonlyLabel(String checkedReadonlyLabel)
checkedReadonlyLabel - Stringpublic SwitchButton setUnCheckedReadonlyLabel(String unCheckedReadonlyLabel)
unCheckedReadonlyLabel - Stringprotected elemental2.dom.HTMLElement createInputElement(String type)
createInputElement in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>type - String the input element typeprotected ValueBox.AutoValidator createAutoValidator(ValueBox.AutoValidate autoValidate)
createAutoValidator in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>autoValidate - ValueBox.AutoValidateprotected void clearValue(boolean silent)
clearValue in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>protected void doSetValue(Boolean value)
doSetValue in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>value - V the value to set for this fieldpublic String getStringValue()
getStringValue in interface HasInputElementgetStringValue in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>protected boolean isAddFocusColor()
isAddFocusColor in class ValueBox<SwitchButton,elemental2.dom.HTMLElement,Boolean>Copyright © 2019–2022 Dominokit. All rights reserved.