V - Value typepublic interface ViewComponent<V> extends ValueHolder<V,ValueHolder.ValueChangeEvent<V>>, ValueComponent<V>
ValueHolder component to display a value in UI.| Modifier and Type | Interface and Description |
|---|---|
static interface |
ViewComponent.ViewComponentPropertyRenderer<T>
A
PropertyRenderer for the ViewComponent rendering type. |
ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V,E extends ValueHolder.ValueChangeEvent<V>>| Modifier and Type | Method and Description |
|---|---|
static <T,C extends com.vaadin.flow.component.Component> |
adapt(Class<T> type,
C content,
BiConsumer<C,T> valueConsumer)
Create a new
ViewComponentAdapterBuilder to configure and create a ViewComponent from a custom
Component. |
static <T,C extends com.vaadin.flow.component.Component> |
adapt(Class<T> type,
Function<T,C> componentProvider)
Create a new
ViewComponentAdapterBuilder to configure and create a ViewComponent from a custom
Component. |
static <T> ViewComponentBuilder<T> |
builder(Class<? extends T> valueType)
Get a
ViewComponentBuilder to create a ViewComponent using given value type. |
static <T> ViewComponentBuilder<T> |
builder(Function<T,String> stringValueConverter)
Get a
ViewComponentBuilder to create a ViewComponent using given function to convert the value to
a String type representation. |
static <T> ViewComponentBuilder<T> |
builder(com.holonplatform.core.property.Property<T> property)
Get a
ViewComponentBuilder to create a ViewComponent using given Property for label and
value presentation through the Property.present(Object) method. |
static <T> ViewComponent<T> |
create(Class<T> valueType)
Create a
ViewComponent using given value type. |
static <T> ViewComponent<T> |
create(com.holonplatform.core.property.Property<T> property)
Create a
ViewComponent using given Property for label and value presentation through the
Property.present(Object) method. |
default Optional<com.vaadin.flow.component.Component> |
getContentComponent()
Get the component which acts as
ViewComponent content, if available. |
default Optional<HasTitle> |
hasTitle()
Checks whether this component supports a title, which text can be handled using the
HasTitle interface. |
addValueChangeListener, clear, getEmptyValue, getValue, getValueIfPresent, isEmpty, setValuegetValue, hasValueChangeModecreate, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisibledefault Optional<com.vaadin.flow.component.Component> getContentComponent()
ViewComponent content, if available.default Optional<HasTitle> hasTitle()
HasTitle interface.HasTitle reference. An empty Optional is returned
otherwise.static <T> ViewComponentBuilder<T> builder(Class<? extends T> valueType)
ViewComponentBuilder to create a ViewComponent using given value type.T - Value typevalueType - Value type (not null)ViewComponentBuilderstatic <T> ViewComponentBuilder<T> builder(com.holonplatform.core.property.Property<T> property)
ViewComponentBuilder to create a ViewComponent using given Property for label and
value presentation through the Property.present(Object) method.T - Value typeproperty - The property to use (not null)ViewComponentBuilderstatic <T> ViewComponentBuilder<T> builder(Function<T,String> stringValueConverter)
ViewComponentBuilder to create a ViewComponent using given function to convert the value to
a String type representation.T - Value typestringValueConverter - Value converter function (not null)ViewComponentBuilderstatic <T> ViewComponent<T> create(Class<T> valueType)
ViewComponent using given value type.T - Value typevalueType - Value type (not null)ViewComponent instancestatic <T> ViewComponent<T> create(com.holonplatform.core.property.Property<T> property)
ViewComponent using given Property for label and value presentation through the
Property.present(Object) method.T - Value typeproperty - The property to use (not null)ViewComponent instancestatic <T,C extends com.vaadin.flow.component.Component> ViewComponentAdapterBuilder<T> adapt(Class<T> type, Function<T,C> componentProvider)
ViewComponentAdapterBuilder to configure and create a ViewComponent from a custom
Component.
The ViewComponent content will be replaced by the Component provided by the given function each
time the value changes.
T - Value typeC - View component content typetype - Value typecomponentProvider - The function to provide the ViewComponent content component each time the value
changes (not null)ViewComponentAdapterBuilderstatic <T,C extends com.vaadin.flow.component.Component> ViewComponentAdapterBuilder<T> adapt(Class<T> type, C content, BiConsumer<C,T> valueConsumer)
ViewComponentAdapterBuilder to configure and create a ViewComponent from a custom
Component.T - Value typeC - View component content typetype - Value typecontent - The ViewComponent content component to use (not null)valueConsumer - The consumer to use to configure the content component each time the value changes (not
null)ViewComponentAdapterBuilderCopyright © 2020 The Holon Platform. All rights reserved.