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 fromComposite.getContent().H- Header layout. Obtainable fromgetHeader().B- Body layout.F- Footer layout. Obtainable fromgetFooter().
- 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,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 fromHasComponentsto the body. In other words, it allows using predefined layouts. This component isIterableover theComponents contained in the body. Similarly,getComponents()()} returnsComponents things put in the body.- Since:
- 2021-09-03
- Author:
- miki
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(com.vaadin.flow.component.Component... components)voidaddComponentAtIndex(int index, com.vaadin.flow.component.Component component)BgetBody()Returns the body of this component.Stream<com.vaadin.flow.component.Component>getComponents()Returns components contained in the body.Optional<F>getFooter()Gets the current footer.Optional<H>getHeader()Gets the current header.protected RinitContent()booleanisReadOnly()Checks whether this object is in read-only mode.Iterator<com.vaadin.flow.component.Component>iterator()voidremove(com.vaadin.flow.component.Component... components)voidremoveAll()voidsetReadOnly(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, 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.HasComponents
add, add, addComponentAsFirst, remove
-
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
-
-
-
-
Method Detail
-
initContent
protected R initContent()
- Overrides:
initContentin classcom.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:
addin interfacecom.vaadin.flow.component.HasComponents
-
addComponentAtIndex
public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component)- Specified by:
addComponentAtIndexin interfacecom.vaadin.flow.component.HasComponents
-
removeAll
public void removeAll()
- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponents
-
remove
public void remove(com.vaadin.flow.component.Component... components)
- Specified by:
removein interfacecom.vaadin.flow.component.HasComponents
-
getHeader
public Optional<H> getHeader()
Description copied from interface:HasHeaderGets the current header.
-
getFooter
public Optional<F> getFooter()
Description copied from interface:HasFooterGets the current footer.
-
iterator
public Iterator<com.vaadin.flow.component.Component> iterator()
-
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
Streamwith components contained in the body. - See Also:
iterator(),Composite.getChildren()
-
setReadOnly
public void setReadOnly(boolean readOnly)
Description copied from interface:HasReadOnlySets the new read-only state.- Specified by:
setReadOnlyin interfaceHasReadOnly- Parameters:
readOnly- Whether the object should be in read-only mode.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:HasReadOnlyChecks whether this object is in read-only mode.- Specified by:
isReadOnlyin interfaceHasReadOnly- Returns:
- Whether the object is in read-only mode.
-
-