Class GeneratedVaadinCheckbox<R extends GeneratedVaadinCheckbox<R,​T>,​T>

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<R>, com.vaadin.flow.component.ClickNotifier<R>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<R>, com.vaadin.flow.component.FocusNotifier<R>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<R,​T>,​T>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<R,​T>,​T>, Serializable
    Direct Known Subclasses:
    Checkbox

    @Tag("vaadin-checkbox")
    @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.1.10") @NpmPackage(value="@vaadin/checkbox",version="23.1.10") @NpmPackage(value="@vaadin/vaadin-checkbox",version="23.1.10")
    @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/checkbox/src/vaadin-checkbox.js")
    public abstract class GeneratedVaadinCheckbox<R extends GeneratedVaadinCheckbox<R,​T>,​T>
    extends com.vaadin.flow.component.AbstractSinglePropertyField<R,​T>
    implements com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.Focusable<R>, com.vaadin.flow.component.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
    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

    See ThemableMixin – how to apply styles for shadow parts

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class 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,​?>>  
      • Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

        com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,​V extends Object>
      • Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

        com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>
      • Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

        com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
      • Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

        com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
    • Constructor Summary

      Constructors 
      Constructor 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, com.vaadin.flow.function.SerializableBiFunction<R,​P,​T> presentationToModel, com.vaadin.flow.function.SerializableBiFunction<R,​T,​P> modelToPresentation)
      Constructs a new GeneratedVaadinCheckbox component with the given arguments.
      GeneratedVaadinCheckbox​(T initialValue, T defaultValue, Class<P> elementPropertyType, com.vaadin.flow.function.SerializableFunction<P,​T> presentationToModel, com.vaadin.flow.function.SerializableFunction<T,​P> modelToPresentation)
      Constructs a new GeneratedVaadinCheckbox component with the given arguments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.vaadin.flow.shared.Registration addChangeListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)
      Adds a listener for change events fired by the webcomponent.
      protected com.vaadin.flow.shared.Registration addCheckedChangeListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)
      Adds a listener for checked-changed events fired by the webcomponent.
      protected com.vaadin.flow.shared.Registration addIndeterminateChangeListener​(com.vaadin.flow.component.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)  
      • 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, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

        addAttachListener
      • Methods inherited from interface com.vaadin.flow.component.BlurNotifier

        addBlurListener
      • Methods inherited from interface com.vaadin.flow.component.ClickNotifier

        addClickListener, addClickShortcut
      • Methods inherited from interface com.vaadin.flow.component.DetachNotifier

        addDetachListener
      • Methods inherited from interface com.vaadin.flow.component.Focusable

        addFocusShortcut, blur, focus, getTabIndex, setTabIndex
      • Methods inherited from interface com.vaadin.flow.component.FocusNotifier

        addFocusListener
      • Methods inherited from interface com.vaadin.flow.component.HasElement

        getElement
      • Methods inherited from interface com.vaadin.flow.component.HasEnabled

        isEnabled, setEnabled
      • 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.HasValue

        clear, getOptionalValue
      • Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

        isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
    • Constructor Detail

      • GeneratedVaadinCheckbox

        public GeneratedVaadinCheckbox​(T initialValue,
                                       T defaultValue,
                                       Class<P> elementPropertyType,
                                       com.vaadin.flow.function.SerializableFunction<P,​T> presentationToModel,
                                       com.vaadin.flow.function.SerializableFunction<T,​P> modelToPresentation)
        Constructs a new GeneratedVaadinCheckbox component with the given arguments.
        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that converts a string value to a model value
        modelToPresentation - 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 isInitialValueOptional is true then 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 value
        defaultValue - the default value to use if the value isn't defined
        acceptNullValues - whether null is accepted as a model value
        isInitialValueOptional - if isInitialValueOptional is true then 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 isInitialValueOptional is true then 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 value
        defaultValue - the default value to use if the value isn't defined
        acceptNullValues - whether null is accepted as a model value
      • GeneratedVaadinCheckbox

        public GeneratedVaadinCheckbox​(T initialValue,
                                       T defaultValue,
                                       Class<P> elementPropertyType,
                                       com.vaadin.flow.function.SerializableBiFunction<R,​P,​T> presentationToModel,
                                       com.vaadin.flow.function.SerializableBiFunction<R,​T,​P> modelToPresentation)
        Constructs a new GeneratedVaadinCheckbox component with the given arguments.
        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that accepts this component and a property value and returns a model value
        modelToPresentation - 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 autofocus property 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 disabled property 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 name property 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 indeterminate property 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 com.vaadin.flow.shared.Registration addChangeListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinCheckbox.ChangeEvent<R>> listener)
        Adds a listener for change events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener
      • addCheckedChangeListener

        protected com.vaadin.flow.shared.Registration addCheckedChangeListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinCheckbox.CheckedChangeEvent<R>> listener)
        Adds a listener for checked-changed events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener
      • addIndeterminateChangeListener

        protected com.vaadin.flow.shared.Registration addIndeterminateChangeListener​(com.vaadin.flow.component.ComponentEventListener<GeneratedVaadinCheckbox.IndeterminateChangeEvent<R>> listener)
        Adds a listener for indeterminate-changed events fired by the webcomponent.
        Parameters:
        listener - the listener
        Returns:
        a Registration for removing the event listener