com.holonplatform.vaadin.components

## Interface SingleSelect<T>

- Type Parameters:
    `T` - Selection item type
  All Superinterfaces:
    Input<T>, ItemSet, Selectable<T>, Serializable, ValueComponent<T>, ValueHolder<T>

      public interface SingleSelect<T>
      extends Selectable<T>, Input<T>, ItemSet

  A `Selectable` component in which at most one item can be selected at a time.
  Since:
    5.0.0

- - ### Nested Class Summary

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

      `Selectable.SelectionEvent<T>, Selectable.SelectionListener<T>, Selectable.SelectionMode`

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

      `Input.InputFieldPropertyRenderer<T>, Input.InputPropertyRenderer<T>`

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

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

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

      `ItemSet.ItemCaptionGenerator<ITEM>, ItemSet.ItemIconGenerator<ITEM>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> SingleSelectInputBuilder<T>` | `builder(Class<? extends T> type)` Gets a builder to create a `SingleSelect` using default `BaseSelectInputBuilder.RenderingMode.SELECT`.
    `static <T> SingleSelectInputBuilder<T>` | `builder(Class<? extends T> type, BaseSelectInputBuilder.RenderingMode renderingMode)` Gets a builder to create a `SingleSelect`.
    `default void` | `deselectAll()` Deselects all currently selected items, if any.
    `default Optional<T>` | `getFirstSelectedItem()` Get the first selected item.
    `Optional<T>` | `getSelectedItem()` Get the currently selected item.
    `default Set<T>` | `getSelectedItems()` Get an immutable set of the currently selected items.
    `default Selectable.SelectionMode` | `getSelectionMode()` Get the selection mode
    `static <T> SinglePropertySelectInputBuilder<T>` | `property(com.holonplatform.core.property.Property<T> selectProperty)` Gets a builder to create a `SingleSelect` with a `PropertyBox` items data source with `Property` as item properties.
    `static <T> SinglePropertySelectInputBuilder<T>` | `property(com.holonplatform.core.property.Property<T> selectProperty, BaseSelectInputBuilder.RenderingMode renderingMode)` Gets a builder to create a `SingleSelect` with a `PropertyBox` items data source with `Property` as item properties.

    - ### Methods inherited from interface com.holonplatform.vaadin.components.Selectable

      `addSelectionListener, deselect, isSelected, select`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.Input

      `focus, from, isReadOnly, isRequired, setReadOnly, setRequired`

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

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

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

      `getComponent, getValue`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.ItemSet

      `refresh`

- - ### Method Detail

    - #### getSelectedItem

          Optional<T> getSelectedItem()

      Get the currently selected item.
      Returns:
        The currently selected item, empty if no item is selected

    - #### getSelectionMode

          default Selectable.SelectionMode getSelectionMode()

      Description copied from interface: `Selectable`
      Get the selection mode
      Specified by:
        `getSelectionMode` in interface `Selectable<T>`
      Returns:
        the selection mode

    - #### getSelectedItems

          default Set<T> getSelectedItems()

      Description copied from interface: `Selectable`
      Get an immutable set of the currently selected items.

      The iteration order of the items in the returned set is implementation dependent.

      Specified by:
        `getSelectedItems` in interface `Selectable<T>`
      Returns:
        Selected items set, empty if none

    - #### getFirstSelectedItem

          default Optional<T> getFirstSelectedItem()

      Description copied from interface: `Selectable`
      Get the first selected item.
      Specified by:
        `getFirstSelectedItem` in interface `Selectable<T>`
      Returns:
        the first selected item, empty if none

    - #### deselectAll

          default void deselectAll()

      Description copied from interface: `Selectable`
      Deselects all currently selected items, if any.
      Specified by:
        `deselectAll` in interface `Selectable<T>`

    - #### builder

          static <T> SingleSelectInputBuilder<T> builder(Class<? extends T> type,
                                                         BaseSelectInputBuilder.RenderingMode renderingMode)

      Gets a builder to create a `SingleSelect`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `type` - Selection value type
        `renderingMode` - Rendering mode
      Returns:
        `SingleSelect` builder

    - #### builder

          static <T> SingleSelectInputBuilder<T> builder(Class<? extends T> type)

      Gets a builder to create a `SingleSelect` using default `BaseSelectInputBuilder.RenderingMode.SELECT`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `type` - Selection value type
      Returns:
        `SingleSelect` builder

    - #### property

          static <T> SinglePropertySelectInputBuilder<T> property(com.holonplatform.core.property.Property<T> selectProperty,
                                                                  BaseSelectInputBuilder.RenderingMode renderingMode)

      Gets a builder to create a `SingleSelect` with a `PropertyBox` items data source with `Property` as item properties.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `selectProperty` - Property to select (not null)
        `renderingMode` - Rendering mode
      Returns:
        `SingleSelect` builder

    - #### property

          static <T> SinglePropertySelectInputBuilder<T> property(com.holonplatform.core.property.Property<T> selectProperty)

      Gets a builder to create a `SingleSelect` with a `PropertyBox` items data source with `Property` as item properties. Default `BaseSelectInputBuilder.RenderingMode.SELECT` is assumed.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `selectProperty` - Property to select (not null)
      Returns:
        `SingleSelect` builder

Copyright © 2017 The Holon Platform. All rights reserved.