com.holonplatform.vaadin.flow.components.builders

## Interface ViewComponentBuilder<T>

- Type Parameters:
    `T` - Value type
  All Superinterfaces:
    ClickNotifierConfigurator<ViewComponent<T>,ClickEvent<ViewComponent<T>>,ViewComponentBuilder<T>>, ComponentConfigurator<ViewComponentBuilder<T>>, DeferrableLocalizationConfigurator<ViewComponentBuilder<T>>, HasDeferrableLocalization, HasElementConfigurator<ViewComponentBuilder<T>>, HasEnabledConfigurator<ViewComponentBuilder<T>>, HasLabelConfigurator<ViewComponentBuilder<T>>, HasSizeConfigurator<ViewComponentBuilder<T>>, HasStyleConfigurator<ViewComponentBuilder<T>>, HasTitleConfigurator<ViewComponentBuilder<T>>, HtmlComponentConfigurator<ViewComponentBuilder<T>>

      public interface ViewComponentBuilder<T>
      extends HtmlComponentConfigurator<ViewComponentBuilder<T>>, HasEnabledConfigurator<ViewComponentBuilder<T>>, HasLabelConfigurator<ViewComponentBuilder<T>>, ClickNotifierConfigurator<ViewComponent<T>,ClickEvent<ViewComponent<T>>,ViewComponentBuilder<T>>, DeferrableLocalizationConfigurator<ViewComponentBuilder<T>>

  Builder to create `ViewComponent`s.
  Since:
    5.2.0

- - ### Nested Class Summary

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

      `ComponentConfigurator.BaseComponentConfigurator`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.vaadin.flow.components.builders.HasSizeConfigurator

      `FULL_SIZE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `ViewComponent<T>` | `build()` Build the `ViewComponent` instance.
    `static <T> ViewComponentBuilder<T>` | `create(Class<? extends T> valueType)` Get a `ViewComponentBuilder` to create a `ViewComponent` using given value type.
    `static <T> ViewComponentBuilder<T>` | `create(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>` | `create(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.
    `ViewComponentBuilder<T>` | `withValue(T value)` Sets an initial value for the component.
    `ViewComponentBuilder<T>` | `withValueChangeListener(ValueHolder.ValueChangeListener<T,ValueHolder.ValueChangeEvent<T>> listener)` Add a `ValueHolder.ValueChangeListener` to the component.

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

      `hidden, id, visible, withAttachListener, withDetachListener`

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

      `withEventListener, withEventListener, withThemeName`

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

      `fullHeight, fullSize, fullWidth, height, height, heightUndefined, sizeUndefined, width, width, widthUndefined`

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

      `styleName, styleNames`

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

      `description, description, description, title, title, title`

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

      `disabled, enabled`

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

      `label, label, label`

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

      `onClick, withClickListener`

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

      `deferLocalization, withDeferredLocalization`

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

      `isDeferredLocalizationEnabled`

- - ### Method Detail

    - #### withValue

          ViewComponentBuilder<T> withValue(T value)

      Sets an initial value for the component.
      Parameters:
        `value` - The initial value to set
      Returns:
        this

    - #### withValueChangeListener

          ViewComponentBuilder<T> withValueChangeListener(ValueHolder.ValueChangeListener<T,ValueHolder.ValueChangeEvent<T>> listener)

      Add a `ValueHolder.ValueChangeListener` to the component.
      Parameters:
        `listener` - The ValueChangeListener to add
      Returns:
        this

    - #### build

          ViewComponent<T> build()

      Build the `ViewComponent` instance.
      Returns:
        the `ViewComponent` instance

    - #### create

          static <T> ViewComponentBuilder<T> create(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`

    - #### create

          static <T> ViewComponentBuilder<T> create(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> ViewComponentBuilder<T> create(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`

Copyright © 2019 The Holon Platform. All rights reserved.