com.holonplatform.vaadin7.components

## Interface MultiSelect<T>

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

      public interface MultiSelect<T>
      extends Selectable<T>, Input<Set<T>>, ItemSet

  A `Selectable` component in which multiple items can be selected at the same time. Selecting an item adds it to the selection.
  Since:
    5.0.0

- - ### Nested Class Summary

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

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

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

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

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

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

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin7.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> MultiSelectInputBuilder<T>` | `builder(Class<? extends T> type)` Gets a builder to create a `MultiSelect`.
    `static <T> MultiSelectInputBuilder<T>` | `builder(Class<? extends T> type, BaseSelectInputBuilder.RenderingMode renderingMode)` Gets a builder to create a `MultiSelect`.
    `void` | `deselect(Iterable<T> items)` Removes the given items from the set of currently selected items.
    `default void` | `deselect(T... items)` Removes the given items from the set of currently selected items.
    `default void` | `deselect(T item)` Deselects the given item.
    `default Optional<T>` | `getFirstSelectedItem()` Get the first selected item.
    `default Selectable.SelectionMode` | `getSelectionMode()` Get the selection mode
    `static <T> MultiPropertySelectInputBuilder<T>` | `property(com.holonplatform.core.property.Property<T> selectProperty)` Gets a builder to create a `MultiSelect` with a `PropertyBox` items data source with `Property` as item properties.
    `static <T> MultiPropertySelectInputBuilder<T>` | `property(com.holonplatform.core.property.Property<T> selectProperty, BaseSelectInputBuilder.RenderingMode renderingMode)` Gets a builder to create a `MultiSelect` with a `PropertyBox` items data source with `Property` as item properties.
    `void` | `select(Iterable<T> items)` Adds the given item to the set of currently selected items.
    `default void` | `select(T... items)` Adds the given item to the set of currently selected items.
    `default void` | `select(T item)` Selects the given item.
    `void` | `selectAll()` Selects all available the items.

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

      `addSelectionListener, deselectAll, getSelectedItems, isSelected`

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

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

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

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

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

      `getComponent, getValue`

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

      `refresh`

- - ### Method Detail

    - #### select

          void select(Iterable<T> items)

      Adds the given item to the set of currently selected items.

      By default this does not clear any previous selection. To do that, use `Selectable.deselectAll()`.

      Parameters:
        `items` - Items to select (not null)

    - #### select

          default void select(T... items)

      Adds the given item to the set of currently selected items.

      By default this does not clear any previous selection. To do that, use `Selectable.deselectAll()`.

      Parameters:
        `items` - Items to select (not null)

    - #### deselect

          void deselect(Iterable<T> items)

      Removes the given items from the set of currently selected items.
      Parameters:
        `items` - Items to deselect (not null)

    - #### deselect

          default void deselect(T... items)

      Removes the given items from the set of currently selected items.
      Parameters:
        `items` - Items to deselect (not null)

    - #### selectAll

          void selectAll()

      Selects all available the items.

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

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

    - #### select

          default void select(T item)

      Description copied from interface: `Selectable`
      Selects the given item. If the item is already selected, does nothing.

      When in `Selectable.SelectionMode.SINGLE`, any previously selected item is deselected.

      Specified by:
        `select` in interface `Selectable<T>`
      Parameters:
        `item` - the item to select (not null)

    - #### deselect

          default void deselect(T item)

      Description copied from interface: `Selectable`
      Deselects the given item. If the item is not currently selected, does nothing.
      Specified by:
        `deselect` in interface `Selectable<T>`
      Parameters:
        `item` - the item to deselect (not null)

    - #### builder

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

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

    - #### builder

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

      Gets a builder to create a `MultiSelect`.
      Type Parameters:
        `T` - Selection value type
      Parameters:
        `type` - Selection value type
      Returns:
        `MultiSelect` builder

    - #### property

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

      Gets a builder to create a `MultiSelect` 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:
        `MultiSelect` builder

    - #### property

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

      Gets a builder to create a `MultiSelect` 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:
        `MultiSelect` builder

Copyright © 2019 The Holon Platform. All rights reserved.