Class HeaderFooterFieldWrapper<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<T>
org.vaadin.miki.superfields.layouts.HeaderFooterFieldWrapper<T,H,F>
Type Parameters:
T - Type of data the field has.
H - Type of header Component.
F - Type of footer Component.
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<T>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<T>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<T>>, 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.customfield.CustomField<T>,T>,T>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, Serializable, HasHelperPositionable, HasId, HasIndex, WithHelperMixin<HeaderFooterFieldWrapper<T,H,F>>, WithHelperPositionableMixin<HeaderFooterFieldWrapper<T,H,F>>, WithIdMixin<HeaderFooterFieldWrapper<T,H,F>>, WithIndexMixin<HeaderFooterFieldWrapper<T,H,F>>, WithLabelMixin<HeaderFooterFieldWrapper<T,H,F>>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T,HeaderFooterFieldWrapper<T,H,F>>, HasFooter<F>, HasHeader<H>, WithFooterComponentsMixin<F,HeaderFooterFieldWrapper<T,H,F>>, WithHeaderComponentsMixin<H,HeaderFooterFieldWrapper<T,H,F>>

public class HeaderFooterFieldWrapper<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents> extends com.vaadin.flow.component.customfield.CustomField<T> implements WithLabelMixin<HeaderFooterFieldWrapper<T,H,F>>, WithIdMixin<HeaderFooterFieldWrapper<T,H,F>>, WithHelperMixin<HeaderFooterFieldWrapper<T,H,F>>, WithHelperPositionableMixin<HeaderFooterFieldWrapper<T,H,F>>, WithHeaderComponentsMixin<H,HeaderFooterFieldWrapper<T,H,F>>, WithFooterComponentsMixin<F,HeaderFooterFieldWrapper<T,H,F>>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T,HeaderFooterFieldWrapper<T,H,F>>, WithIndexMixin<HeaderFooterFieldWrapper<T,H,F>>
A three-part layout (header, field, footer) for any field that itself is a field. For easier use in collection field it implements WithIndexMixin and delegates setting index to header and footer components (and to the field, if it also implements it).
Since:
2021-09-03
Author:
miki
See Also:
  • Nested Class Summary

    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<?>>
  • Field Summary

    Fields inherited from interface org.vaadin.miki.markers.HasHelperPositionable

    HELPER_ABOVE_THEME_VARIANT
  • Constructor Summary

    Constructors
    Constructor
    Description
    HeaderFooterFieldWrapper(Supplier<R> rootSupplier, H header, V field, F footer)
    Creates the wrapper with given root layout, header, footer and field.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T
     
    Gets the current footer.
    Gets the current header.
    int
    Returns the current index of the object.
     
    boolean
     
    boolean
     
    void
    setDisablingFooterOnReadOnly(boolean disablingFooterOnReadOnly)
     
    void
    setDisablingHeaderOnReadOnly(boolean disablingHeaderOnReadOnly)
     
    void
    setHelperComponent(com.vaadin.flow.component.Component component)
     
    void
    setHelperText(String helperText)
     
    void
    setIndex(int index)
    Changes the index of the object.
    void
     
    protected void
     
    void
    setReadOnly(boolean readOnly)
     
     
     

    Methods inherited from class com.vaadin.flow.component.customfield.CustomField

    add, addThemeVariants, onAttach, remove, removeThemeVariants, updateValue

    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, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, 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.AttachNotifier

    addAttachListener

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

    addBlurListener

    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.HasHelper

    getHelperComponent, getHelperText

    Methods inherited from interface org.vaadin.miki.markers.HasHelperPositionable

    isHelperAbove, setHelperAbove, setHelperAbove, setHelperBelow

    Methods inherited from interface org.vaadin.miki.markers.HasId

    getId, setId

    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.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipText

    Methods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties

    getErrorMessage, isInvalid, setErrorMessage, setInvalid

    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

    Methods inherited from interface org.vaadin.miki.superfields.layouts.WithFooterComponentsMixin

    withFooterComponents

    Methods inherited from interface org.vaadin.miki.superfields.layouts.WithHeaderComponentsMixin

    withHeaderComponents

    Methods inherited from interface org.vaadin.miki.markers.WithHelperMixin

    withHelperComponent, withHelperText

    Methods inherited from interface org.vaadin.miki.markers.WithHelperPositionableMixin

    withHelperAbove, withHelperAbove, withHelperBelow

    Methods inherited from interface org.vaadin.miki.markers.WithIdMixin

    withId

    Methods inherited from interface org.vaadin.miki.markers.WithIndexMixin

    withIndex

    Methods inherited from interface org.vaadin.miki.markers.WithLabelMixin

    withLabel

    Methods inherited from interface org.vaadin.miki.markers.WithValueMixin

    withValue
  • Constructor Details

    • HeaderFooterFieldWrapper

      public HeaderFooterFieldWrapper(Supplier<R> rootSupplier, H header, V field, F footer)
      Creates the wrapper with given root layout, header, footer and field.
      Type Parameters:
      R - Generic type to enforce root layout is a Component that HasComponents.
      V - Generic type to enforce field is a Component that HasValue of type T.
      Parameters:
      rootSupplier - A provider for the root layout.
      header - Header to use. If not null, it will be added to whatever rootSupplier produces as first component.
      field - Field to wrap. Must not be null. It will be added to whatever rootSupplier.
      footer - Footer to use. If not null, it will be added to whatever rootSupplier produces after the field.
  • Method Details

    • setLabel

      public void setLabel(String label)
      Specified by:
      setLabel in interface com.vaadin.flow.component.HasLabel
      Overrides:
      setLabel in class com.vaadin.flow.component.customfield.CustomField<T>
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface com.vaadin.flow.component.HasLabel
      Overrides:
      getLabel in class com.vaadin.flow.component.customfield.CustomField<T>
    • setHelperComponent

      public void setHelperComponent(com.vaadin.flow.component.Component component)
      Specified by:
      setHelperComponent in interface com.vaadin.flow.component.HasHelper
    • setHelperText

      public void setHelperText(String helperText)
      Specified by:
      setHelperText in interface com.vaadin.flow.component.HasHelper
    • generateModelValue

      protected T generateModelValue()
      Specified by:
      generateModelValue in class com.vaadin.flow.component.customfield.CustomField<T>
    • setPresentationValue

      protected void setPresentationValue(T t)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<T>
    • getFooter

      public Optional<F> getFooter()
      Description copied from interface: HasFooter
      Gets the current footer.
      Specified by:
      getFooter in interface HasFooter<T>
      Returns:
      Perhaps the current footer.
    • getHeader

      public Optional<H> getHeader()
      Description copied from interface: HasHeader
      Gets the current header.
      Specified by:
      getHeader in interface HasHeader<T>
      Returns:
      Perhaps the current header.
    • getIndex

      public int getIndex()
      Description copied from interface: HasIndex
      Returns the current index of the object.
      Specified by:
      getIndex in interface HasIndex
      Returns:
      Current index.
    • setIndex

      public void setIndex(int index)
      Description copied from interface: HasIndex
      Changes the index of the object.
      Specified by:
      setIndex in interface HasIndex
      Parameters:
      index - New index.
    • setDisablingFooterOnReadOnly

      public void setDisablingFooterOnReadOnly(boolean disablingFooterOnReadOnly)
    • isDisablingFooterOnReadOnly

      public boolean isDisablingFooterOnReadOnly()
    • withDisablingFooterOnReadOnly

      public final HeaderFooterFieldWrapper<T,H,F> withDisablingFooterOnReadOnly(boolean state)
    • setDisablingHeaderOnReadOnly

      public void setDisablingHeaderOnReadOnly(boolean disablingHeaderOnReadOnly)
    • isDisablingHeaderOnReadOnly

      public boolean isDisablingHeaderOnReadOnly()
    • withDisablingHeaderOnReadOnly

      public final HeaderFooterFieldWrapper<T,H,F> withDisablingHeaderOnReadOnly(boolean state)
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>