com.holonplatform.vaadin.flow.components

## Interface PropertyViewGroup

- All Superinterfaces:
    BoundComponentGroup<com.holonplatform.core.property.Property<?>,ViewComponent<?>>, ComponentGroup<ViewComponent<?>>, HasPropertySet<com.holonplatform.core.property.Property<?>>, Serializable, ValueHolder<com.holonplatform.core.property.PropertyBox,GroupValueChangeEvent<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.property.Property<?>,ViewComponent<?>,PropertyViewGroup>>
  All Known Subinterfaces:
    PropertyViewForm

      public interface PropertyViewGroup
      extends BoundComponentGroup<com.holonplatform.core.property.Property<?>,ViewComponent<?>>, ValueHolder<com.holonplatform.core.property.PropertyBox,GroupValueChangeEvent<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.property.Property<?>,ViewComponent<?>,PropertyViewGroup>>

  A `BoundComponentGroup` which handles `ViewComponent` elements type and uses a `Property` set to bind and identify the elements within the group.

  As a `ValueHolder`, allows to manage the overall group elements value, represented by a `PropertyBox` instance.

  By default, the `ViewComponent` components to bind to each property are obtained using the `PropertyRenderer`s registered in the context `PropertyRendererRegistry`, if available. The `bind(...)` methods of the `PropertyViewGroupBuilder` can be used to provided a specific renderer or `ViewComponent` of one or more group property.

  Since:
    5.2.0

- - ### Nested Class Summary

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

      `BoundComponentGroup.Binding<P,C extends HasComponent>`

    - ### 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 Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <P extends com.holonplatform.core.property.Property> PropertyViewGroupBuilder` | `builder(Iterable<P> properties)` Get a `PropertyViewGroupBuilder` to create and setup a `PropertyViewGroup`.
    `static PropertyViewGroupBuilder` | `builder(com.holonplatform.core.property.Property<?>... properties)` Get a `PropertyViewGroupBuilder` to create and setup a `PropertyViewGroup`.
    `void` | `clear()` Clear the value of all the available `ViewComponent`s.
    `com.holonplatform.core.property.PropertyBox` | `getValue()` Get the current property values.
    `<T> Optional<ViewComponent<T>>` | `getViewComponent(com.holonplatform.core.property.Property<T> property)` Get the `ViewComponent` bound to the given `property`, if available.
    `default <T> ViewComponent<T>` | `requireViewComponent(com.holonplatform.core.property.Property<T> property)` Get the `ViewComponent` bound to the given `property`, throwing a `Property.PropertyNotFoundException` if not available.
    `void` | `setValue(com.holonplatform.core.property.PropertyBox value)` Set the current `PropertyBox` value.

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

      `getBindings, getElement, requireElement`

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

      `getComponents, getElements`

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

      `getProperties, hasProperty`

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

      `addValueChangeListener, getEmptyValue, getValueIfPresent, isEmpty`

- - ### Method Detail

    - #### getViewComponent

          <T> Optional<ViewComponent<T>> getViewComponent(com.holonplatform.core.property.Property<T> property)

      Get the `ViewComponent` bound to the given `property`, if available.
      Type Parameters:
        `T` - Property type
      Parameters:
        `property` - The property which identifies the `ViewComponent` within the group (not null)
      Returns:
        Optional `ViewComponent` bound to the given `property`

    - #### requireViewComponent

          default <T> ViewComponent<T> requireViewComponent(com.holonplatform.core.property.Property<T> property)

      Get the `ViewComponent` bound to the given `property`, throwing a `Property.PropertyNotFoundException` if not available.
      Type Parameters:
        `T` - Property type
      Parameters:
        `property` - The property which identifies the `ViewComponent` within the group (not null)
      Returns:
        The `ViewComponent` bound to the given `property`
      Throws:
        `com.holonplatform.core.property.Property.PropertyNotFoundException` - If no `ViewComponent` is bound to given property

    - #### clear

          void clear()

      Clear the value of all the available `ViewComponent`s.
      Specified by:
        `clear` in interface `ValueHolder<com.holonplatform.core.property.PropertyBox,GroupValueChangeEvent<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.property.Property<?>,ViewComponent<?>,PropertyViewGroup>>`

    - #### getValue

          com.holonplatform.core.property.PropertyBox getValue()

      Get the current property values.
      Specified by:
        `getValue` in interface `ValueHolder<com.holonplatform.core.property.PropertyBox,GroupValueChangeEvent<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.property.Property<?>,ViewComponent<?>,PropertyViewGroup>>`
      Returns:
        A `PropertyBox` containing the property values (may be null)

    - #### setValue

          void setValue(com.holonplatform.core.property.PropertyBox value)

      Set the current `PropertyBox` value. For each property, if a `ViewComponent` is available, the property value will be set as the `ViewComponent` value.

      Only the properties which belong to the group's property set are taken into account.

      Specified by:
        `setValue` in interface `ValueHolder<com.holonplatform.core.property.PropertyBox,GroupValueChangeEvent<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.property.Property<?>,ViewComponent<?>,PropertyViewGroup>>`
      Parameters:
        `value` - The value to set. If `null`, all the `ViewComponent` components are cleared.

    - #### builder

          static <P extends com.holonplatform.core.property.Property> PropertyViewGroupBuilder builder(Iterable<P> properties)

      Get a `PropertyViewGroupBuilder` to create and setup a `PropertyViewGroup`.
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - The property set (not null)
      Returns:
        A new `PropertyViewGroupBuilder`

    - #### builder

          static PropertyViewGroupBuilder builder(com.holonplatform.core.property.Property<?>... properties)

      Get a `PropertyViewGroupBuilder` to create and setup a `PropertyViewGroup`.
      Parameters:
        `properties` - The property set (not null)
      Returns:
        A new `PropertyViewGroupBuilder`

Copyright © 2020 The Holon Platform. All rights reserved.