@Tag(value="vaadin-checkbox") @NpmPackage(value="@vaadin/vaadin-checkbox", version="2.5.1") @JsModule(value="@vaadin/vaadin-checkbox/src/vaadin-checkbox.js") @HtmlImport(value="frontend://bower_components/vaadin-checkbox/src/vaadin-checkbox.html") public abstract class GeneratedVaadinCheckbox<R extends GeneratedVaadinCheckbox<R,T>,T> extends AbstractSinglePropertyField<R,T> implements HasStyle, Focusable<R>, ClickNotifier<R>
Description copied from corresponding location in WebComponent:
<vaadin-checkbox>
is a Web Component for customized checkboxes.
<vaadin-checkbox> Make my profile visible </vaadin-checkbox>
The following shadow DOM parts are available for styling:
Part name | Description |
---|---|
checkbox |
The checkbox element |
label |
The label content element |
The following state attributes are available for styling:
Attribute | Description | Part name |
---|---|---|
active |
Set when the checkbox is pressed down, either with mouse, touch or the keyboard. | :host |
disabled |
Set when the checkbox is disabled. | :host |
focus-ring |
Set when the checkbox is focused using the keyboard. | :host |
focused |
Set when the checkbox is focused. | :host |
indeterminate |
Set when the checkbox is in indeterminate mode. | :host |
checked |
Set when the checkbox is checked. | :host |
empty |
Set when there is no label provided. | label |
Modifier and Type | Class and Description |
---|---|
static class |
GeneratedVaadinCheckbox.ChangeEvent<R extends GeneratedVaadinCheckbox<R,?>> |
static class |
GeneratedVaadinCheckbox.CheckedChangeEvent<R extends GeneratedVaadinCheckbox<R,?>> |
static class |
GeneratedVaadinCheckbox.IndeterminateChangeEvent<R extends GeneratedVaadinCheckbox<R,?>> |
AbstractField.ComponentValueChangeEvent<C extends Component,V>
BlurNotifier.BlurEvent<C extends Component>
FocusNotifier.FocusEvent<C extends Component>
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
Constructor and Description |
---|
GeneratedVaadinCheckbox()
Default constructor.
|
GeneratedVaadinCheckbox(T initialValue,
T defaultValue,
boolean acceptNullValues)
Constructs a new GeneratedVaadinCheckbox component with the given
arguments.
|
GeneratedVaadinCheckbox(T initialValue,
T defaultValue,
Class<P> elementPropertyType,
SerializableBiFunction<R,P,T> presentationToModel,
SerializableBiFunction<R,T,P> modelToPresentation)
Constructs a new GeneratedVaadinCheckbox component with the given
arguments.
|
GeneratedVaadinCheckbox(T initialValue,
T defaultValue,
Class<P> elementPropertyType,
SerializableFunction<P,T> presentationToModel,
SerializableFunction<T,P> modelToPresentation)
Constructs a new GeneratedVaadinCheckbox component with the given
arguments.
|
Modifier and Type | Method and Description |
---|---|
protected Registration |
addChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)
Adds a listener for
change events fired by the webcomponent. |
protected Registration |
addCheckedChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)
Adds a listener for
checked-changed events fired by the
webcomponent. |
protected Registration |
addIndeterminateChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.IndeterminateChangeEvent<R>> listener)
Adds a listener for
indeterminate-changed events fired by the
webcomponent. |
protected String |
getNameString()
This property is not synchronized automatically from the client side, so
the returned value may not be the same as in client side.
|
protected boolean |
isAutofocusBoolean()
Description copied from corresponding location in WebComponent:
|
protected boolean |
isDisabledBoolean()
Description copied from corresponding location in WebComponent:
|
protected boolean |
isIndeterminateBoolean()
Description copied from corresponding location in WebComponent:
|
protected void |
setAutofocus(boolean autofocus)
Description copied from corresponding location in WebComponent:
|
protected void |
setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
|
protected void |
setIndeterminate(boolean indeterminate)
Description copied from corresponding location in WebComponent:
|
protected void |
setName(String name) |
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
addBlurListener
addFocusListener
isEnabled, setEnabled
getElement
addClickListener, addClickShortcut
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
clear, getOptionalValue
addAttachListener
addDetachListener
public GeneratedVaadinCheckbox(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation)
P
- the property typeinitialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedelementPropertyType
- the type of the element propertypresentationToModel
- a function that converts a string value to a model valuemodelToPresentation
- a function that converts a model value to a string valuepublic GeneratedVaadinCheckbox(T initialValue, T defaultValue, boolean acceptNullValues)
initialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedacceptNullValues
- whether null
is accepted as a model valuepublic GeneratedVaadinCheckbox(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableBiFunction<R,P,T> presentationToModel, SerializableBiFunction<R,T,P> modelToPresentation)
P
- the property typeinitialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedelementPropertyType
- the type of the element propertypresentationToModel
- a function that accepts this component and a property value
and returns a model valuemodelToPresentation
- a function that accepts this component and a model value and
returns a property valuepublic GeneratedVaadinCheckbox()
protected boolean isAutofocusBoolean()
Description copied from corresponding location in WebComponent:
Specify that this control should have input focus when the page loads.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
autofocus
property from the webcomponentprotected void setAutofocus(boolean autofocus)
Description copied from corresponding location in WebComponent:
Specify that this control should have input focus when the page loads.
autofocus
- the boolean value to setprotected boolean isDisabledBoolean()
Description copied from corresponding location in WebComponent:
If true, the user cannot interact with this element.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
disabled
property from the webcomponentprotected void setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
If true, the user cannot interact with this element.
disabled
- the boolean value to setprotected String getNameString()
name
property from the webcomponentprotected void setName(String name)
name
- the String value to set@Synchronize(property="indeterminate", value="indeterminate-changed") protected boolean isIndeterminateBoolean()
Description copied from corresponding location in WebComponent:
Indeterminate state of the checkbox when it's neither checked nor unchecked, but undetermined. https://developer.mozilla.org/en-US/docs/Web/ HTML/Element/input/checkbox#Indeterminate_state_checkboxes
This property is synchronized automatically from client side when a 'indeterminate-changed' event happens.
indeterminate
property from the webcomponentprotected void setIndeterminate(boolean indeterminate)
Description copied from corresponding location in WebComponent:
Indeterminate state of the checkbox when it's neither checked nor unchecked, but undetermined. https://developer.mozilla.org/en-US/docs/Web/ HTML/Element/input/checkbox#Indeterminate_state_checkboxes
indeterminate
- the boolean value to setprotected Registration addChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)
change
events fired by the webcomponent.listener
- the listenerRegistration
for removing the event listenerprotected Registration addCheckedChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)
checked-changed
events fired by the
webcomponent.listener
- the listenerRegistration
for removing the event listenerprotected Registration addIndeterminateChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.IndeterminateChangeEvent<R>> listener)
indeterminate-changed
events fired by the
webcomponent.listener
- the listenerRegistration
for removing the event listenerCopyright © 2023. All rights reserved.