Package com.vaadin.featurepack.ui
Class FCheckBox
java.lang.Object
com.vaadin.flow.component.Component
- 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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.checkbox.Checkbox
com.vaadin.flow.component.checkbox.Checkbox.CheckboxI18nNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> 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.featurepack.data.Buffered
Buffered.SourceExceptionNested classes/interfaces inherited from interface com.vaadin.flow.component.ClickNotifier
com.vaadin.flow.component.ClickNotifier.ClickFiltersJsNested classes/interfaces inherited from interface com.vaadin.featurepack.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
FAbstractClientConnector.LegacyMethodEventNested classes/interfaces inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
FAbstractComponent.DataKeyNested classes/interfaces inherited from interface com.vaadin.featurepack.data.ui.Field
Field.ValueChangeEventNested classes/interfaces inherited from interface com.vaadin.flow.component.Focusable
com.vaadin.flow.component.Focusable.FocusJsNested 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>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new checkbox.Creates a new checkbox with a set caption.Creates a new checkbox with a caption and a set initial state.Creates a new checkbox that is connected to a boolean property. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent) getType()Returns the type of the Property.getValue()Returns the logical value of the field.booleanisEmpty()Is the field empty?protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) voidSets the value of the field.voidvalidate()Checks the validity of the validatable.Methods inherited from class com.vaadin.flow.component.checkbox.Checkbox
bindIndeterminate, getAriaDescribedBy, getAriaLabel, getAriaLabelledBy, getDefaultValidator, getI18n, getLabel, isAutofocus, isIndeterminate, isRequiredIndicatorVisible, setAriaDescribedBy, setAriaLabel, setAriaLabelledBy, setAutofocus, setI18n, setIndeterminate, setLabel, setLabelComponent, setManualValidation, setRequiredIndicatorVisibleMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, getEmptyValue, setModelValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, attach, detach, doConnectorOnAttach, doConnectorOnDetach, fireEvent, fireEvent, getAllChildrenIterable, getFListeners, getFlowComponent, getResource, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeListener, removeListener, setResourceMethods inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, getCaption, getComponentError, getData, getDescription, getFErrorIndicator, getFErrorMessage, getFId, getFParent, getIcon, getIconResource, getPrimaryStyleName, getStyleName, isCaptionAsHtml, isImmediate, isResponsive, notifyParentAboutStyleChanges, removeContextClickListener, removeShortcutListener, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setIcon, setIcon, setIconResource, setImmediate, setLabelComponent, setLocale, setPrimaryStyleName, setResponsive, setStyleName, setStyleNameMethods inherited from interface com.vaadin.featurepack.data.ui.Field
addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, commit, discard, getConvertedValue, getConverter, getFAbstractField, getPropertyDataSource, getRequiredError, getValidators, isBuffered, isInvalidAllowed, isInvalidCommitted, isModified, isPropertyReadOnly, isRequired, isValid, readOnlyStatusChange, removeAllValidators, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConverter, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setPropertyReadOnly, setRequired, setRequiredError, valueChangeMethods inherited from interface com.vaadin.featurepack.event.FieldEvents.BlurNotifier
addBlurListener, removeBlurListenerMethods inherited from interface com.vaadin.featurepack.event.FieldEvents.FocusNotifier
addFocusListener, removeFocusListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasAriaDescription
setAriaDescribedByMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.featurepack.server.HasSizeable
getFHeight, getFWidth, getHeightUnits, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefinedMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipTextMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.data.binder.HasValidator
addValidationStatusChangeListenerMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, bindValue, clear, getEmptyValue, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, setReadOnly
-
Constructor Details
-
FCheckBox
public FCheckBox()Creates a new checkbox. -
FCheckBox
Creates a new checkbox with a set caption.- Parameters:
caption- the Checkbox caption.
-
FCheckBox
Creates a new checkbox with a caption and a set initial state.- Parameters:
caption- the caption of the checkboxinitialState- the initial state of the checkbox
-
FCheckBox
Creates a new checkbox that is connected to a boolean property.- Parameters:
caption- the caption of the checkboxdataSource- the Property to be edited with this checkbox
-
-
Method Details
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
getType
Description copied from interface:PropertyReturns the type of the Property. The methodsgetValueandsetValuemust be compatible with this type: one must be able to safely cast the value returned fromgetValueto the given type and pass any variable assignable to this type as an argument tosetValue. -
validate
public void validate()Description copied from interface:ValidatableChecks 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:
validatein interfaceValidatable- Overrides:
validatein classcom.vaadin.flow.component.checkbox.Checkbox
-
isEmpty
public boolean isEmpty()Description copied from interface:FieldIs the field empty? In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".- Specified by:
isEmptyin interfaceField<Boolean>- Specified by:
isEmptyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>, Boolean> - Overrides:
isEmptyin classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean> - Returns:
- true if the field is empty, false otherwise
-
setValue
Sets the value of the field. If the value matches the null representation, the logical value will benullbut the null representation will be displayed.- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>, Boolean> - Specified by:
setValuein interfaceProperty<Boolean>- Overrides:
setValuein classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.checkbox.Checkbox,Boolean> - Parameters:
value- the value to set
-
getValue
Returns the logical value of the field. If the stored logical value isnull, this method returnsnull, otherwise it returns the displayed text.- Specified by:
getValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.checkbox.Checkbox,Boolean>, Boolean> - Specified by:
getValuein interfaceProperty<Boolean>- Overrides:
getValuein classcom.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:
fireEventin classcom.vaadin.flow.component.Component
-