com.vaadin.flow.component.checkbox.
Class GeneratedVaadinCheckbox<R extends GeneratedVaadinCheckbox<R,T>,T>
- java.lang.Object
 - 
- com.vaadin.flow.component.Component
 - 
- com.vaadin.flow.component.AbstractField<C,T>
 - 
- com.vaadin.flow.component.AbstractSinglePropertyField<R,T>
 - 
- com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox<R,T>
 
 
 
 
 
- 
All Implemented Interfaces:
AttachNotifier, BlurNotifier<R>, ClickNotifier<R>, DetachNotifier, Focusable<R>, FocusNotifier<R>, HasElement, HasEnabled, HasStyle, HasValue<AbstractField.ComponentValueChangeEvent<R,T>,T>, HasValueAndElement<AbstractField.ComponentValueChangeEvent<R,T>,T>, Serializable
Direct Known Subclasses:
@Tag(value="vaadin-checkbox") @NpmPackage(value="@vaadin/vaadin-checkbox", version="20.0.5") @JsModule(value="@vaadin/vaadin-checkbox/src/vaadin-checkbox.js") 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>
Styling
The following shadow DOM parts are available for styling:
Part name Description checkboxThe checkbox element labelThe label content element The following state attributes are available for styling:
Attribute Description Part name activeSet when the checkbox is pressed down, either with mouse, touch or the keyboard. :hostdisabledSet when the checkbox is disabled. :hostfocus-ringSet when the checkbox is focused using the keyboard. :hostfocusedSet when the checkbox is focused. :hostindeterminateSet when the checkbox is in indeterminate mode. :hostcheckedSet when the checkbox is checked. :hostemptySet when there is no label provided. labelSee ThemableMixin ? how to apply styles for shadow parts
See Also:
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classGeneratedVaadinCheckbox.ChangeEvent<R extends GeneratedVaadinCheckbox<R,?>>static classGeneratedVaadinCheckbox.CheckedChangeEvent<R extends GeneratedVaadinCheckbox<R,?>>static classGeneratedVaadinCheckbox.IndeterminateChangeEvent<R extends GeneratedVaadinCheckbox<R,?>>- 
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V> 
- 
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component> 
- 
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component> 
- 
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>> 
 - 
 
- 
Constructor Summary
Constructors 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, boolean acceptNullValues, boolean isInitialValueOptional)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.
 
- 
Method Summary
All Methods Modifier and Type Method and Description protected RegistrationaddChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)Adds a listener for
changeevents fired by the webcomponent.protected RegistrationaddCheckedChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)Adds a listener for
checked-changedevents fired by the webcomponent.protected RegistrationaddIndeterminateChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.IndeterminateChangeEvent<R>> listener)Adds a listener for
indeterminate-changedevents fired by the webcomponent.protected StringgetNameString()This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
protected booleanisAutofocusBoolean()Description copied from corresponding location in WebComponent:
protected booleanisDisabledBoolean()Description copied from corresponding location in WebComponent:
protected booleanisIndeterminateBoolean()Description copied from corresponding location in WebComponent:
protected voidsetAutofocus(boolean autofocus)Description copied from corresponding location in WebComponent:
protected voidsetDisabled(boolean disabled)Description copied from corresponding location in WebComponent:
protected voidsetIndeterminate(boolean indeterminate)Description copied from corresponding location in WebComponent:
protected voidsetName(String name)- 
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent 
- 
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals 
- 
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName 
- 
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex 
- 
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener 
- 
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener 
- 
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled 
- 
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement 
- 
Methods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut 
- 
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible 
- 
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue 
- 
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener 
- 
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
GeneratedVaadinCheckbox
public 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.
Type Parameters:
P- the property typeParameters:
initialValue- 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 value 
- 
GeneratedVaadinCheckbox
public GeneratedVaadinCheckbox(T initialValue, T defaultValue, boolean acceptNullValues, boolean isInitialValueOptional)Constructs a new GeneratedVaadinCheckbox component with the given arguments.
If
isInitialValueOptionalistruethen the initial value is used only if element has no"checked"property value, otherwise element"checked"property is ignored and the initial value is set,Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedacceptNullValues- whethernullis accepted as a model valueisInitialValueOptional- ifisInitialValueOptionalistruethen the initial value is used only if element has no"checked"property value, otherwise element"checked"property is ignored and the initial value is set 
- 
GeneratedVaadinCheckbox
public GeneratedVaadinCheckbox(T initialValue, T defaultValue, boolean acceptNullValues)Constructs a new GeneratedVaadinCheckbox component with the given arguments.
If
isInitialValueOptionalistruethen the initial value is used only if element has no"checked"property value, otherwise element"checked"property is ignored and the initial value is set,Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedacceptNullValues- whethernullis accepted as a model value 
- 
GeneratedVaadinCheckbox
public 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.
Type Parameters:
P- the property typeParameters:
initialValue- 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 value 
- 
GeneratedVaadinCheckbox
public GeneratedVaadinCheckbox()Default constructor.
 
 - 
 
- 
Method Detail
- 
isAutofocusBoolean
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.
Returns:
the
autofocusproperty from the webcomponent 
- 
setAutofocus
protected void setAutofocus(boolean autofocus)Description copied from corresponding location in WebComponent:
Specify that this control should have input focus when the page loads.
Parameters:
autofocus- the boolean value to set 
- 
isDisabledBoolean
protected 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.
Returns:
the
disabledproperty from the webcomponent 
- 
setDisabled
protected void setDisabled(boolean disabled)Description copied from corresponding location in WebComponent:
If true, the user cannot interact with this element.
Parameters:
disabled- the boolean value to set 
- 
getNameString
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.
Returns:
the
nameproperty from the webcomponent 
- 
setName
protected void setName(String name)Parameters:
name- the String value to set 
- 
isIndeterminateBoolean
@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.
Returns:
the
indeterminateproperty from the webcomponent 
- 
setIndeterminate
protected 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
Parameters:
indeterminate- the boolean value to set 
- 
addChangeListener
protected Registration addChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)Adds a listener for
changeevents fired by the webcomponent.Parameters:
listener- the listenerReturns:
a
Registrationfor removing the event listener 
- 
addCheckedChangeListener
protected Registration addCheckedChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)Adds a listener for
checked-changedevents fired by the webcomponent.Parameters:
listener- the listenerReturns:
a
Registrationfor removing the event listener 
- 
addIndeterminateChangeListener
protected Registration addIndeterminateChangeListener(ComponentEventListener<GeneratedVaadinCheckbox.IndeterminateChangeEvent<R>> listener)Adds a listener for
indeterminate-changedevents fired by the webcomponent.Parameters:
listener- the listenerReturns:
a
Registrationfor removing the event listener 
 - 
 
 -