com.holonplatform.vaadin.components

## Interface SingleSelect<T>

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

      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,F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component>, Input.InputPropertyRenderer<T>`

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

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

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

      `ItemSet.ItemCaptionGenerator<ITEM>, ItemSet.ItemDescriptionGenerator<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.GenericSingleSelectInputBuilder<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> BaseSelectModeSingleSelectInputBuilder.NativeModeSingleSelectInputBuilder<T>` | `nativeSelect(Class<? extends T> type)` Gets a builder to create a `SingleSelect` using `BaseSelectInputBuilder.RenderingMode.NATIVE_SELECT`.
    `static <T> BaseSelectModeSinglePropertySelectInputBuilder.NativeModeSinglePropertySelectInputBuilder<T>` | `nativeSelect(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 using `BaseSelectInputBuilder.RenderingMode.NATIVE_SELECT`.
    `static <T> BaseSelectModeSingleSelectInputBuilder.OptionsModeSingleSelectInputBuilder<T>` | `options(Class<? extends T> type)` Gets a builder to create a `SingleSelect` using `BaseSelectInputBuilder.RenderingMode.OPTIONS`.
    `static <T> BaseSelectModeSinglePropertySelectInputBuilder.OptionsModeSinglePropertySelectInputBuilder<T>` | `options(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 using `BaseSelectInputBuilder.RenderingMode.OPTIONS`.
    `static <T> SinglePropertySelectInputBuilder.GenericSinglePropertySelectInputBuilder<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.
    `static <T> BaseSelectModeSingleSelectInputBuilder.SelectModeSingleSelectInputBuilder<T>` | `select(Class<? extends T> type)` Gets a builder to create a `SingleSelect` using `BaseSelectInputBuilder.RenderingMode.SELECT`.
    `static <T> BaseSelectModeSinglePropertySelectInputBuilder.SelectModeSinglePropertySelectInputBuilder<T>` | `select(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 using `BaseSelectInputBuilder.RenderingMode.SELECT`.

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

      `addSelectionListener, deselect, isSelected, select`

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

      `focus, from, from, from, from, from, getValueChangeMode, getValueChangeTimeout, isReadOnly, isRequired, isValueChangeModeSupported, setReadOnly, setRequired, setValueChangeMode, setValueChangeTimeout`

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

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

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

      `getValue`

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

      `getComponent`

    - ### 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.GenericSingleSelectInputBuilder<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

    - #### select

          static <T> BaseSelectModeSingleSelectInputBuilder.SelectModeSingleSelectInputBuilder<T> select(Class<? extends T> type)

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

    - #### nativeSelect

          static <T> BaseSelectModeSingleSelectInputBuilder.NativeModeSingleSelectInputBuilder<T> nativeSelect(Class<? extends T> type)

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

    - #### options

          static <T> BaseSelectModeSingleSelectInputBuilder.OptionsModeSingleSelectInputBuilder<T> options(Class<? extends T> type)

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

    - #### property

          static <T> SinglePropertySelectInputBuilder.GenericSinglePropertySelectInputBuilder<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

    - #### select

          static <T> BaseSelectModeSinglePropertySelectInputBuilder.SelectModeSinglePropertySelectInputBuilder<T> select(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 using `BaseSelectInputBuilder.RenderingMode.SELECT`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `selectProperty` - Property to select (not null)
      Returns:
        `SingleSelect` builder

    - #### nativeSelect

          static <T> BaseSelectModeSinglePropertySelectInputBuilder.NativeModeSinglePropertySelectInputBuilder<T> nativeSelect(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 using `BaseSelectInputBuilder.RenderingMode.NATIVE_SELECT`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `selectProperty` - Property to select (not null)
      Returns:
        `SingleSelect` builder

    - #### options

          static <T> BaseSelectModeSinglePropertySelectInputBuilder.OptionsModeSinglePropertySelectInputBuilder<T> options(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 using `BaseSelectInputBuilder.RenderingMode.OPTIONS`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `selectProperty` - Property to select (not null)
      Returns:
        `SingleSelect` builder

Copyright © 2019 The Holon Platform. All rights reserved.