com.holonplatform.vaadin.flow.components

## Interface Components

-     public interface Components

  Main provider of UI components builders and configurators.

  Provides static methods to obtain builder for common UI components type, allowing fluent and implementation-agnostic components creation and configuration.

  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Components.dialog` Dialog builders provider.
    `static interface` | `Components.input` `Input`, `PropertyInputGroup` and `PropertyInputForm` builders provider.
    `static interface` | `Components.listing` `ItemListing` builders provider.
    `static interface` | `Components.view` `ViewComponent` and `PropertyViewGroup` builders provider.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static com.holonplatform.core.config.ConfigProperty<Duration>` | `TIME_INPUT_STEP` Configuration property which can be used for a `LocalTime` type `Property` to configure the steps to show for the `Input` component bound to the property, i.e. the intervals for the displayed items in the time input dropdown.

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ButtonBuilder` | `button()` Gets a builder to create `Button`s.
    `static com.vaadin.flow.component.button.Button` | `button(com.holonplatform.core.i18n.Localizable text, ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)` Create a `Button` with given localizable text and given `click` event listener.
    `static com.vaadin.flow.component.button.Button` | `button(String text, ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)` Create a `Button` with given text and given `click` event listener.
    `static com.vaadin.flow.component.button.Button` | `button(String defaultText, String messageCode, ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)` Create a `Button` with given localizable text and given `click` event listener.
    `static ButtonConfigurator.BaseButtonConfigurator` | `configure(com.vaadin.flow.component.button.Button button)` Get a `ButtonConfigurator` to configure given `Button` instance.
    `static FormLayoutConfigurator.BaseFormLayoutConfigurator` | `configure(com.vaadin.flow.component.formlayout.FormLayout layout)` Get a `FormLayoutConfigurator.BaseFormLayoutConfigurator` to configure given `FormLayout`.
    `static ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator` | `configure(com.vaadin.flow.component.orderedlayout.HorizontalLayout layout)` Get a `ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator` to configure given `HorizontalLayout`.
    `static <L extends com.vaadin.flow.component.HtmlContainer & com.vaadin.flow.component.ClickNotifier> LabelConfigurator.BaseLabelConfigurator<L>` | `configure(L label)` Get a `LabelConfigurator` to configure given label type component.
    `static ThemableFlexComponentConfigurator.VerticalLayoutConfigurator` | `configure(com.vaadin.flow.component.orderedlayout.VerticalLayout layout)` Get a `ThemableFlexComponentConfigurator.VerticalLayoutConfigurator` to configure given `VerticalLayout`.
    `static ContextMenuBuilder` | `contextMenu()` Gets a builder to create `ContextMenu`s.
    `static LabelBuilder<com.vaadin.flow.component.html.Div>` | `div()` Obtain a `LabelBuilder` to create a label component using a `Div` tag.
    `static FormLayoutBuilder` | `formLayout()` Gets a builder to create `FormLayout`s.
    `static Optional<Locale>` | `getCurrentLocale()` Get the current `Locale`, if available.
    `static Optional<String>` | `getLocalization(Locale locale, com.holonplatform.core.i18n.Localizable localizable)` Get the message localization for given `locale`, using the provided `Localizable` to obtain the message localization key (`Localizable.getMessageCode()`) and the optional localization arguments.
    `static Optional<String>` | `getLocalization(Locale locale, String messageCode, Object... arguments)` Get the message localization for given `locale`, using the provided `messageCode` as message localization key and the optional localization arguments.
    `static String` | `getLocalization(Locale locale, String defaultMessage, String messageCode, Object... arguments)` Get the message localization for given `locale`, using the provided `messageCode` as message localization key and the optional localization arguments.
    `static LabelBuilder<com.vaadin.flow.component.html.H1>` | `h1()` Obtain a `LabelBuilder` to create a label component using a `H1` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.H2>` | `h2()` Obtain a `LabelBuilder` to create a label component using a `H2` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.H3>` | `h3()` Obtain a `LabelBuilder` to create a label component using a `H3` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.H4>` | `h4()` Obtain a `LabelBuilder` to create a label component using a `H4` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.H5>` | `h5()` Obtain a `LabelBuilder` to create a label component using a `H5` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.H6>` | `h6()` Obtain a `LabelBuilder` to create a label component using a `H6` tag.
    `static HorizontalLayoutBuilder` | `hl()` Gets a builder to create `HorizontalLayout`s.
    `static LabelBuilder<com.vaadin.flow.component.html.Div>` | `label()` Obtain a `LabelBuilder` to create a label component using a `Div` tag.
    `static Optional<String>` | `localize(com.holonplatform.core.i18n.Localizable localizable)` Get the message localization for the current `Locale`, using the provided `Localizable` to obtain the message localization key (`Localizable.getMessageCode()`) and the optional localization arguments.
    `static Optional<String>` | `localize(String messageCode, Object... arguments)` Get the message localization for the current `Locale`, using the provided `messageCode` as message localization key and the optional localization arguments.
    `static String` | `localize(String defaultMessage, String messageCode, Object... arguments)` Get the message localization for the current `Locale`, using the provided `messageCode` as message localization key and the optional localization arguments.
    `static NativeButtonBuilder` | `nativeButton()` Gets a builder to create `NativeButton`s.
    `static LabelBuilder<com.vaadin.flow.component.html.Paragraph>` | `paragraph()` Obtain a `LabelBuilder` to create a label component using a `Paragraph` tag.
    `static LabelBuilder<com.vaadin.flow.component.html.Span>` | `span()` Obtain a `LabelBuilder` to create a label component using a `Span` tag.
    `static VerticalLayoutBuilder` | `vl()` Gets a builder to create `VerticalLayout`s.

- - ### Field Detail

    - #### TIME_INPUT_STEP

          static final com.holonplatform.core.config.ConfigProperty<Duration> TIME_INPUT_STEP

      Configuration property which can be used for a `LocalTime` type `Property` to configure the steps to show for the `Input` component bound to the property, i.e. the intervals for the displayed items in the time input dropdown.

      If the step is less than 60 seconds, the format will be changed to `hh:mm:ss` and it can be in `hh:mm:ss.fff` format, when the step is less than 1 second.

      If the step is less than 900 seconds, the dropdown is hidden.

  - ### Method Detail

    - #### configure

          static <L extends com.vaadin.flow.component.HtmlContainer & com.vaadin.flow.component.ClickNotifier> LabelConfigurator.BaseLabelConfigurator<L> configure(L label)

      Get a `LabelConfigurator` to configure given label type component.

      The component must be a `HtmlContainer` and a `ClickNotifier`, such as `Span` or `Div`.

      Type Parameters:
        `L` - Label element type
      Parameters:
        `label` - The component to configure (not null)
      Returns:
        A `LabelConfigurator`

    - #### configure

          static ButtonConfigurator.BaseButtonConfigurator configure(com.vaadin.flow.component.button.Button button)

      Get a `ButtonConfigurator` to configure given `Button` instance.
      Parameters:
        `button` - Button to configure (not null)
      Returns:
        A `ButtonConfigurator`

    - #### configure

          static ThemableFlexComponentConfigurator.VerticalLayoutConfigurator configure(com.vaadin.flow.component.orderedlayout.VerticalLayout layout)

      Get a `ThemableFlexComponentConfigurator.VerticalLayoutConfigurator` to configure given `VerticalLayout`.
      Parameters:
        `layout` - Layout to configure
      Returns:
        A new `ThemableFlexComponentConfigurator.VerticalLayoutConfigurator`

    - #### configure

          static ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator configure(com.vaadin.flow.component.orderedlayout.HorizontalLayout layout)

      Get a `ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator` to configure given `HorizontalLayout`.
      Parameters:
        `layout` - Layout to configure
      Returns:
        A new `ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator`

    - #### configure

          static FormLayoutConfigurator.BaseFormLayoutConfigurator configure(com.vaadin.flow.component.formlayout.FormLayout layout)

      Get a `FormLayoutConfigurator.BaseFormLayoutConfigurator` to configure given `FormLayout`.
      Parameters:
        `layout` - Layout to configure
      Returns:
        A new `FormLayoutConfigurator.BaseFormLayoutConfigurator`

    - #### label

          static LabelBuilder<com.vaadin.flow.component.html.Div> label()

      Obtain a `LabelBuilder` to create a label component using a `Div` tag.

      This is an alias for the `div()` method.

      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### span

          static LabelBuilder<com.vaadin.flow.component.html.Span> span()

      Obtain a `LabelBuilder` to create a label component using a `Span` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### div

          static LabelBuilder<com.vaadin.flow.component.html.Div> div()

      Obtain a `LabelBuilder` to create a label component using a `Div` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### paragraph

          static LabelBuilder<com.vaadin.flow.component.html.Paragraph> paragraph()

      Obtain a `LabelBuilder` to create a label component using a `Paragraph` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h1

          static LabelBuilder<com.vaadin.flow.component.html.H1> h1()

      Obtain a `LabelBuilder` to create a label component using a `H1` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h2

          static LabelBuilder<com.vaadin.flow.component.html.H2> h2()

      Obtain a `LabelBuilder` to create a label component using a `H2` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h3

          static LabelBuilder<com.vaadin.flow.component.html.H3> h3()

      Obtain a `LabelBuilder` to create a label component using a `H3` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h4

          static LabelBuilder<com.vaadin.flow.component.html.H4> h4()

      Obtain a `LabelBuilder` to create a label component using a `H4` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h5

          static LabelBuilder<com.vaadin.flow.component.html.H5> h5()

      Obtain a `LabelBuilder` to create a label component using a `H5` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### h6

          static LabelBuilder<com.vaadin.flow.component.html.H6> h6()

      Obtain a `LabelBuilder` to create a label component using a `H6` tag.
      Returns:
        The `LabelBuilder` to configure and obtain the component instance

    - #### button

          static ButtonBuilder button()

      Gets a builder to create `Button`s.
      Returns:
        A new `ButtonBuilder`

    - #### button

          static com.vaadin.flow.component.button.Button button(String text,
                                                                ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)

      Create a `Button` with given text and given `click` event listener.
      Parameters:
        `text` - The button text
        `clickListener` - The click listener (not null)
      Returns:
        A new `Button`
      See Also:
        `button()`

    - #### button

          static com.vaadin.flow.component.button.Button button(String defaultText,
                                                                String messageCode,
                                                                ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)

      Create a `Button` with given localizable text and given `click` event listener.
      Parameters:
        `defaultText` - The default button text
        `messageCode` - The button text message localization code
        `clickListener` - The click listener (not null)
      Returns:
        A new `Button`
      See Also:
        `button()`

    - #### button

          static com.vaadin.flow.component.button.Button button(com.holonplatform.core.i18n.Localizable text,
                                                                ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)

      Create a `Button` with given localizable text and given `click` event listener.
      Parameters:
        `text` - The `Localizable` button text
        `clickListener` - The click listener (not null)
      Returns:
        A new `Button`
      See Also:
        `button()`

    - #### nativeButton

          static NativeButtonBuilder nativeButton()

      Gets a builder to create `NativeButton`s.
      Returns:
        A new `NativeButtonBuilder`

    - #### vl

          static VerticalLayoutBuilder vl()

      Gets a builder to create `VerticalLayout`s.
      Returns:
        A new `VerticalLayoutBuilder`

    - #### hl

          static HorizontalLayoutBuilder hl()

      Gets a builder to create `HorizontalLayout`s.
      Returns:
        A new `HorizontalLayoutBuilder`

    - #### formLayout

          static FormLayoutBuilder formLayout()

      Gets a builder to create `FormLayout`s.
      Returns:
        A new `FormLayoutBuilder`

    - #### contextMenu

          static ContextMenuBuilder contextMenu()

      Gets a builder to create `ContextMenu`s.
      Returns:
        A new `ContextMenuBuilder`

    - #### getCurrentLocale

          static Optional<Locale> getCurrentLocale()

      Get the current `Locale`, if available.

      The current `Locale` retrieving strategy is:

      - If a current `UI` is available and a UI `Locale` is configured, the UI locale is returned.
      - If a `LocalizationContext` is available as a `Context` resource and it is localized, the `LocalizationContext` `Locale` is returned.
      - If a `I18NProvider` is available from the `VaadinService`, the first `Locale` from `I18NProvider.getProvidedLocales()` is returned, if available.
      Returns:
        Optional current `Locale`
      See Also:
        `LocalizationContext.getCurrent()`

    - #### getLocalization

          static Optional<String> getLocalization(Locale locale,
                                                  com.holonplatform.core.i18n.Localizable localizable)

      Get the message localization for given `locale`, using the provided `Localizable` to obtain the message localization key (`Localizable.getMessageCode()`) and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      Parameters:
        `locale` - The `Locale` for which to obtain the message localization (not null)
        `localizable` - The `Localizable` which represents the message to localize (not null)
      Returns:
        The localized message, if available. If the given `localizable` provides a default message (`Localizable.getMessage()`) and a message localization is not available, the default message is returned
      See Also:
        `LocalizationContext.getCurrent()`

    - #### getLocalization

          static Optional<String> getLocalization(Locale locale,
                                                  String messageCode,
                                                  Object... arguments)

      Get the message localization for given `locale`, using the provided `messageCode` as message localization key and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      Parameters:
        `locale` - The `Locale` for which to obtain the message localization (not null)
        `messageCode` - The message localization key (not null)
        `arguments` - Optional message localization arguments
      Returns:
        The localized message, if available
      See Also:
        `LocalizationContext.getCurrent()`

    - #### getLocalization

          static String getLocalization(Locale locale,
                                        String defaultMessage,
                                        String messageCode,
                                        Object... arguments)

      Get the message localization for given `locale`, using the provided `messageCode` as message localization key and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      Parameters:
        `locale` - The `Locale` for which to obtain the message localization (not null)
        `defaultMessage` - The default message to use when a message localization is not available for the provided `Locale` and message code
        `messageCode` - The message localization key (not null)
        `arguments` - Optional message localization arguments
      Returns:
        The localized message, or the `defaultMessage` if not available
      See Also:
        `LocalizationContext.getCurrent()`

    - #### localize

          static Optional<String> localize(com.holonplatform.core.i18n.Localizable localizable)

      Get the message localization for the current `Locale`, using the provided `Localizable` to obtain the message localization key (`Localizable.getMessageCode()`) and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      The message localization will be performed only if a current `Locale` is available.

      Parameters:
        `localizable` - The `Localizable` which represents the message to localize (not null)
      Returns:
        The localized message, if available. If the given `localizable` provides a default message (`Localizable.getMessage()`) and a message localization is not available, the default message is returned
      See Also:
        `getCurrentLocale()`

    - #### localize

          static Optional<String> localize(String messageCode,
                                           Object... arguments)

      Get the message localization for the current `Locale`, using the provided `messageCode` as message localization key and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      The message localization will be performed only if a current `Locale` is available.

      Parameters:
        `messageCode` - The message localization key (not null)
        `arguments` - Optional message localization arguments
      Returns:
        The localized message, if available
      See Also:
        `getCurrentLocale()`

    - #### localize

          static String localize(String defaultMessage,
                                 String messageCode,
                                 Object... arguments)

      Get the message localization for the current `Locale`, using the provided `messageCode` as message localization key and the optional localization arguments.

      If a `I18NProvider` is available from the current `VaadinService`, it is used for message localization. Otherwise, the current `LocalizationContext` is used, if it is available as a `Context` resource and it is localized.

      The message localization will be performed only if a current `Locale` is available.

      Parameters:
        `defaultMessage` - The default message to use when a message localization is not available for the provided `Locale` and message code
        `messageCode` - The message localization key (not null)
        `arguments` - Optional message localization arguments
      Returns:
        The localized message, or the `defaultMessage` if not available
      See Also:
        `getCurrentLocale()`

Copyright © 2019 The Holon Platform. All rights reserved.