Class FCheckBox

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean>
com.vaadin.flow.component.AbstractSinglePropertyField<com.vaadin.flow.component.checkbox.Checkbox,Boolean>
com.vaadin.flow.component.checkbox.Checkbox
com.vaadin.featurepack.ui.FCheckBox
All Implemented Interfaces:
Buffered, BufferedValidatable, Property<Boolean>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Field<Boolean>, Validatable, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, ClientConnector, FAbstractClientConnector, FSizeable, HasSizeable, FAbstractComponent, 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.HasAriaDescription, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValidation, 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.HasThemeVariant<com.vaadin.flow.component.checkbox.CheckboxVariant>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>,Boolean>, com.vaadin.flow.data.binder.HasValidator<Boolean>, Serializable

public class FCheckBox extends com.vaadin.flow.component.checkbox.Checkbox implements FAbstractComponent, Field<Boolean>, FieldEvents.FocusNotifier, FieldEvents.BlurNotifier, HasSizeable
See Also:
  • Constructor Details

    • FCheckBox

      public FCheckBox()
      Creates a new checkbox.
    • FCheckBox

      public FCheckBox(String caption)
      Creates a new checkbox with a set caption.
      Parameters:
      caption - the Checkbox caption.
    • FCheckBox

      public FCheckBox(String caption, boolean initialState)
      Creates a new checkbox with a caption and a set initial state.
      Parameters:
      caption - the caption of the checkbox
      initialState - the initial state of the checkbox
    • FCheckBox

      public FCheckBox(String caption, Property<?> dataSource)
      Creates a new checkbox that is connected to a boolean property.
      Parameters:
      caption - the caption of the checkbox
      dataSource - the Property to be edited with this checkbox
  • Method Details

    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • getType

      public Class<Boolean> getType()
      Description copied from interface: Property
      Returns the type of the Property. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.
      Specified by:
      getType in interface Field<Boolean>
      Specified by:
      getType in interface Property<Boolean>
      Returns:
      type of the Property
    • validate

      public void validate()
      Description copied from interface: Validatable

      Checks the validity of the validatable. If the validatable is valid this method should do nothing, and if it's not valid, it should throw Validator.InvalidValueException

      Specified by:
      validate in interface Validatable
      Overrides:
      validate in class com.vaadin.flow.component.checkbox.Checkbox
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Field
      Is the field empty? In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".
      Specified by:
      isEmpty in interface Field<Boolean>
      Specified by:
      isEmpty in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>,Boolean>
      Overrides:
      isEmpty in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean>
      Returns:
      true if the field is empty, false otherwise
    • setValue

      public void setValue(Boolean value)
      Sets the value of the field. If the value matches the null representation, the logical value will be null but the null representation will be displayed.
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>,Boolean>
      Specified by:
      setValue in interface Property<Boolean>
      Overrides:
      setValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean>
      Parameters:
      value - the value to set
    • getValue

      public Boolean getValue()
      Returns the logical value of the field. If the stored logical value is null, this method returns null, otherwise it returns the displayed text.
      Specified by:
      getValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>,Boolean>
      Specified by:
      getValue in interface Property<Boolean>
      Overrides:
      getValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean>
      Returns:
      the logical value of this field, potentially null
    • fireEvent

      protected void fireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent)
      Overrides:
      fireEvent in class com.vaadin.flow.component.Component