Class HeaderFooterLayoutWrapper<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,B 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.Composite<R>
org.vaadin.miki.superfields.layouts.HeaderFooterLayoutWrapper<R,H,B,F>
Type Parameters:
R - Root layout of the component. Obtainable from Composite.getContent().
H - Header layout. Obtainable from getHeader().
B - Body layout.
F - Footer layout. Obtainable from getFooter().
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, Serializable, Iterable<com.vaadin.flow.component.Component>, HasId, HasReadOnly, WithIdMixin<HeaderFooterLayoutWrapper<R,H,B,F>>, HasFooter<F>, HasHeader<H>, WithFooterComponentsMixin<F,HeaderFooterLayoutWrapper<R,H,B,F>>, WithHeaderComponentsMixin<H,HeaderFooterLayoutWrapper<R,H,B,F>>

public class HeaderFooterLayoutWrapper<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents,B 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.Composite<R> implements com.vaadin.flow.component.HasComponents, Iterable<com.vaadin.flow.component.Component>, WithHeaderComponentsMixin<H,HeaderFooterLayoutWrapper<R,H,B,F>>, WithIdMixin<HeaderFooterLayoutWrapper<R,H,B,F>>, WithFooterComponentsMixin<F,HeaderFooterLayoutWrapper<R,H,B,F>>, HasReadOnly
A wrapper for a typical header-body-footer layout that exposes header and footer, and delegates all methods from HasComponents to the body. In other words, it allows using predefined layouts. This component is Iterable over the Components contained in the body. Similarly, getComponents() ()} returns Components things put in the body.
Since:
2021-09-03
Author:
miki
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    HeaderFooterLayoutWrapper(Supplier<R> rootSupplier, H header, B body, F footer)
    Creates the layout.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(com.vaadin.flow.component.Component... components)
     
    void
    addComponentAtIndex(int index, com.vaadin.flow.component.Component component)
     
    Returns the body of this component.
    Stream<com.vaadin.flow.component.Component>
    Returns components contained in the body.
    Gets the current footer.
    Gets the current header.
    protected R
     
    boolean
    Checks whether this object is in read-only mode.
    Iterator<com.vaadin.flow.component.Component>
     
    void
    remove(com.vaadin.flow.component.Component... components)
     
    void
     
    void
    setReadOnly(boolean readOnly)
    Sets the new read-only state.

    Methods inherited from class com.vaadin.flow.component.Composite

    getChildren, getContent, getElement

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, 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.DetachNotifier

    addDetachListener

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

    add, add, addComponentAsFirst, remove

    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 org.vaadin.miki.markers.HasId

    getId, setId

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

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

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

    withId
  • Constructor Details

    • HeaderFooterLayoutWrapper

      public HeaderFooterLayoutWrapper(Supplier<R> rootSupplier, H header, B body, F footer)
      Creates the layout.
      Parameters:
      rootSupplier - Callback to create root layout. header, body, and footer will all be added to it.
      header - Header.
      body - Body.
      footer - Footer.
  • Method Details

    • initContent

      protected R initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
    • add

      public void add(com.vaadin.flow.component.Component... components)
      Specified by:
      add in interface com.vaadin.flow.component.HasComponents
    • addComponentAtIndex

      public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component)
      Specified by:
      addComponentAtIndex in interface com.vaadin.flow.component.HasComponents
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface com.vaadin.flow.component.HasComponents
    • remove

      public void remove(com.vaadin.flow.component.Component... components)
      Specified by:
      remove in interface com.vaadin.flow.component.HasComponents
    • getHeader

      public Optional<H> getHeader()
      Description copied from interface: HasHeader
      Gets the current header.
      Specified by:
      getHeader in interface HasHeader<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
      Returns:
      Perhaps the current header.
    • getFooter

      public Optional<F> getFooter()
      Description copied from interface: HasFooter
      Gets the current footer.
      Specified by:
      getFooter in interface HasFooter<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
      Returns:
      Perhaps the current footer.
    • iterator

      public Iterator<com.vaadin.flow.component.Component> iterator()
      Specified by:
      iterator in interface Iterable<R extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
    • getBody

      public B getBody()
      Returns the body of this component.
      Returns:
      Body.
    • getComponents

      public Stream<com.vaadin.flow.component.Component> getComponents()
      Returns components contained in the body.
      Returns:
      A Stream with components contained in the body.
      See Also:
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Description copied from interface: HasReadOnly
      Sets the new read-only state.
      Specified by:
      setReadOnly in interface HasReadOnly
      Parameters:
      readOnly - Whether the object should be in read-only mode.
    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: HasReadOnly
      Checks whether this object is in read-only mode.
      Specified by:
      isReadOnly in interface HasReadOnly
      Returns:
      Whether the object is in read-only mode.