Class SuperCheckbox

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.checkbox.Checkbox>, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.checkbox.Checkbox>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.checkbox.Checkbox>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.checkbox.Checkbox>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean>, com.vaadin.flow.component.shared.HasTooltip, Serializable, HasId, HasLabelPositionable, WithIdMixin<SuperCheckbox>, WithLabelMixin<SuperCheckbox>, WithLabelPositionableMixin<SuperCheckbox>, WithTooltipMixin<SuperCheckbox>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean,​SuperCheckbox>

    @CssImport(value="./styles/label-positions-checkbox.css",
               themeFor="vaadin-checkbox")
    public class SuperCheckbox
    extends com.vaadin.flow.component.checkbox.Checkbox
    implements WithLabelMixin<SuperCheckbox>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean,​SuperCheckbox>, WithIdMixin<SuperCheckbox>, WithLabelPositionableMixin<SuperCheckbox>, WithTooltipMixin<SuperCheckbox>
    A regular Checkbox that can be made read-only (it becomes disabled when set to read-only). While this exists mostly as a workaround for a known issue of Vaadin, it also supports label position (though only LabelPosition#BEFORE_*, thus allowing the label to be positioned on the other side of the actual checkbox).
    Since:
    2022-09-14
    Author:
    miki
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox

        com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox.ChangeEvent<R extends com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox<R,​?>>, com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox.CheckedChangeEvent<R extends com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox<R,​?>>, com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox.IndeterminateChangeEvent<R extends com.vaadin.flow.component.checkbox.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
      SuperCheckbox()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean isReallyEnabled()  
      void setEnabled​(boolean enabled)  
      void setReadOnly​(boolean readOnly)  
      • Methods inherited from class com.vaadin.flow.component.checkbox.Checkbox

        getLabel, isAutofocus, isIndeterminate, setAriaLabel, setAutofocus, setIndeterminate, setLabel, setLabelAsHtml, setLabelComponent
      • Methods inherited from class com.vaadin.flow.component.checkbox.GeneratedVaadinCheckbox

        addChangeListener, addCheckedChangeListener, addIndeterminateChangeListener, getNameString, isAutofocusBoolean, isDisabledBoolean, isIndeterminateBoolean, setDisabled, setName
      • 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, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, 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
      • Methods inherited from interface com.vaadin.flow.component.HasLabel

        getLabel, setLabel
      • Methods inherited from interface com.vaadin.flow.component.HasSize

        getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
      • 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.shared.HasTooltip

        getTooltip, setTooltipText
      • Methods inherited from interface com.vaadin.flow.component.HasValue

        addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue
      • Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

        isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
    • Constructor Detail

      • SuperCheckbox

        public SuperCheckbox()
    • Method Detail

      • isReallyEnabled

        protected boolean isReallyEnabled()
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Specified by:
        setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean>
        Specified by:
        setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,​Boolean>,​Boolean>
      • setEnabled

        public void setEnabled​(boolean enabled)
        Specified by:
        setEnabled in interface com.vaadin.flow.component.HasEnabled