com.holonplatform.vaadin.flow.components

## Interface ViewComponent<V>

- Type Parameters:
    `V` - Value type
  All Superinterfaces:
    HasComponent, com.vaadin.flow.component.HasElement, Serializable, ValueComponent<V>, ValueHolder<V,ValueHolder.ValueChangeEvent<V>>

      public interface ViewComponent<V>
      extends ValueHolder<V,ValueHolder.ValueChangeEvent<V>>, ValueComponent<V>

  A `ValueHolder` component to display a value in UI.
  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `ViewComponent.ViewComponentPropertyRenderer<T>` A `PropertyRenderer` for the `ViewComponent` rendering type.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.ValueHolder

      `ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V,E extends ValueHolder.ValueChangeEvent<V>>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `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<HasTitle>` | `hasTitle()` Checks whether this component supports a title, which text can be handled using the `HasTitle` interface.

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.ValueHolder

      `addValueChangeListener, clear, getEmptyValue, getValue, getValueIfPresent, isEmpty, setValue`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.ValueComponent

      `getValue, hasValueChangeMode`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.HasComponent

      `create, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisible`

- - ### Method Detail

    - #### hasTitle

          default Optional<HasTitle> hasTitle()

      Checks whether this component supports a title, which text can be handled using the `HasTitle` interface.
      Returns:
        If this component supports a title, return the `HasTitle` reference. An empty Optional is returned otherwise.

    - #### builder

          static <T> ViewComponentBuilder<T> builder(Class<? extends T> valueType)

      Get a `ViewComponentBuilder` to create a `ViewComponent` using given value type.
      Type Parameters:
        `T` - Value type
      Parameters:
        `valueType` - Value type (not null)
      Returns:
        A `ViewComponentBuilder`

    - #### builder

          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.
      Type Parameters:
        `T` - Value type
      Parameters:
        `property` - The property to use (not null)
      Returns:
        A `ViewComponentBuilder`

    - #### builder

          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.
      Type Parameters:
        `T` - Value type
      Parameters:
        `stringValueConverter` - Value converter function (not null)
      Returns:
        A `ViewComponentBuilder`

    - #### create

          static <T> ViewComponent<T> create(Class<T> valueType)

      Create a `ViewComponent` using given value type.
      Type Parameters:
        `T` - Value type
      Parameters:
        `valueType` - Value type (not null)
      Returns:
        A `ViewComponent` instance

    - #### create

          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.
      Type Parameters:
        `T` - Value type
      Parameters:
        `property` - The property to use (not null)
      Returns:
        A `ViewComponent` instance

Copyright © 2019 The Holon Platform. All rights reserved.