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 headerComponent.F- Type of footerComponent.
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField>,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,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 implementsWithIndexMixinand 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:
- Serialized Form
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TgenerateModelValue()Optional<F>getFooter()Gets the current footer.Optional<H>getHeader()Gets the current header.intgetIndex()Returns the current index of the object.StringgetLabel()booleanisDisablingFooterOnReadOnly()booleanisDisablingHeaderOnReadOnly()voidsetDisablingFooterOnReadOnly(boolean disablingFooterOnReadOnly)voidsetDisablingHeaderOnReadOnly(boolean disablingHeaderOnReadOnly)voidsetHelperComponent(com.vaadin.flow.component.Component component)voidsetHelperText(String helperText)voidsetIndex(int index)Changes the index of the object.voidsetLabel(String label)protected voidsetPresentationValue(T t)voidsetReadOnly(boolean readOnly)HeaderFooterFieldWrapper<T,H,F>withDisablingFooterOnReadOnly(boolean state)HeaderFooterFieldWrapper<T,H,F>withDisablingHeaderOnReadOnly(boolean state)-
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getErrorMessage, isInvalid, onAttach, remove, removeThemeVariants, setErrorMessage, setInvalid, 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, 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.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
-
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 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.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 Detail
-
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 aComponentthatHasComponents.V- Generic type to enforce field is aComponentthatHasValueof typeT.- Parameters:
rootSupplier- A provider for the root layout.header- Header to use. If notnull, it will be added to whateverrootSupplierproduces as first component.field- Field to wrap. Must not benull. It will be added to whateverrootSupplier.footer- Footer to use. If notnull, it will be added to whateverrootSupplierproduces after the field.
-
-
Method Detail
-
setLabel
public void setLabel(String label)
- Specified by:
setLabelin interfacecom.vaadin.flow.component.HasLabel- Overrides:
setLabelin classcom.vaadin.flow.component.customfield.CustomField<T>
-
getLabel
public String getLabel()
- Specified by:
getLabelin interfacecom.vaadin.flow.component.HasLabel- Overrides:
getLabelin classcom.vaadin.flow.component.customfield.CustomField<T>
-
setHelperComponent
public void setHelperComponent(com.vaadin.flow.component.Component component)
- Specified by:
setHelperComponentin interfacecom.vaadin.flow.component.HasHelper
-
setHelperText
public void setHelperText(String helperText)
- Specified by:
setHelperTextin interfacecom.vaadin.flow.component.HasHelper
-
generateModelValue
protected T generateModelValue()
- Specified by:
generateModelValuein classcom.vaadin.flow.component.customfield.CustomField<T>
-
setPresentationValue
protected void setPresentationValue(T t)
- Specified by:
setPresentationValuein classcom.vaadin.flow.component.customfield.CustomField<T>
-
getFooter
public Optional<F> getFooter()
Description copied from interface:HasFooterGets the current footer.
-
getHeader
public Optional<H> getHeader()
Description copied from interface:HasHeaderGets the current header.
-
getIndex
public int getIndex()
Description copied from interface:HasIndexReturns the current index of the object.
-
setIndex
public void setIndex(int index)
Description copied from interface:HasIndexChanges the index of the object.
-
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:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>- Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
-
-