com.holonplatform.vaadin.flow.components

## Interface MultiSelect<T>

- Type Parameters:
    `T` - Selection item type
  All Superinterfaces:
    HasComponent, com.vaadin.flow.component.HasElement, Input<Set<T>>, ItemSet, Selectable<T>, Serializable, ValueComponent<Set<T>>, ValueHolder<Set<T>,ValueHolder.ValueChangeEvent<Set<T>>>
  All Known Subinterfaces:
    ValidatableMultiSelect<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.2.0

- - ### Nested Class Summary

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

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

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

      `Input.InputPropertyRenderer<T>, Input.InputValueConversionException, Input.PropertyHandler<P,T,V extends com.vaadin.flow.component.HasValue<?,T>,C extends com.vaadin.flow.component.Component>`

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

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `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> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,T>` | `options(Class<T> type)` Gets a builder to create a options `MultiSelect`, which uses a `CheckboxGroup` as input component.
    `static <T,ITEM> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,ITEM>` | `options(Class<T> type, Class<ITEM> itemType, ItemConverter<T,ITEM> itemConverter)` Gets a builder to create a options `MultiSelect`, which uses a `CheckboxGroup` as input component.
    `static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T>` | `options(com.holonplatform.core.property.Property<T> selectionProperty)` Gets a builder to create a `Property` model based options `MultiSelect`, which uses a `CheckboxGroup` as input component.
    `static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T>` | `options(com.holonplatform.core.property.Property<T> selectionProperty, Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)` Gets a builder to create a `Property` model based options `MultiSelect`, which uses a `CheckboxGroup` as input component.
    `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.vaadin.flow.components.Selectable

      `addSelectionListener, deselectAll, getSelectedItems, isSelected`

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

      `addReadonlyChangeListener, as, asHasValue, boolean_, builder, builder, builder, create, create, date, dateTime, enumMultiSelect, enumOptionSelect, enumSelect, focus, from, from, from, from, from, hasInvalidChangeEventNotifier, hasPlaceholder, hasTitle, isReadOnly, isRequired, localDate, localDateTime, localTime, multiOptionSelect, multiOptionSelect, multiOptionSelect, multiOptionSelect, number, password, setReadOnly, setRequired, singleOptionSelect, singleOptionSelect, singleOptionSelect, singleOptionSelect, singleSelect, singleSelect, singleSelect, singleSelect, singleSimpleSelect, singleSimpleSelect, singleSimpleSelect, singleSimpleSelect, string, stringArea`

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

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

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

      `getValue, hasValueChangeMode`

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

      `create, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisible`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.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)

    - #### options

          static <T> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,T> options(Class<T> type)

      Gets a builder to create a options `MultiSelect`, which uses a `CheckboxGroup` as input component.

      This builder can be used when the selection items type and the selection value type are consistent. Use `options(Class, Class, ItemConverter)` if not.

      Type Parameters:
        `T` - Value type
      Parameters:
        `type` - Selection value type (not null)
      Returns:
        A new `OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder`

    - #### options

          static <T,ITEM> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,ITEM> options(Class<T> type,
                                                                                                        Class<ITEM> itemType,
                                                                                                        ItemConverter<T,ITEM> itemConverter)

      Gets a builder to create a options `MultiSelect`, which uses a `CheckboxGroup` as input component.

      This builder can be used when the selection items type and the selection value type are not consistent (i.e. of different type). When the the selection item and the selection value types are consistent, the `options(Class)` method can be used.

      Type Parameters:
        `T` - Value type
        `ITEM` - Item type
      Parameters:
        `type` - Selection value type (not null)
        `itemType` - Selection items type (not null)
        `itemConverter` - The item converter to use to convert a selection item into a selection (Input) value and back (not null)
      Returns:
        A new `OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder`

    - #### options

          static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> options(com.holonplatform.core.property.Property<T> selectionProperty)

      Gets a builder to create a `Property` model based options `MultiSelect`, which uses a `CheckboxGroup` as input component.
      Type Parameters:
        `T` - Value type
      Parameters:
        `selectionProperty` - The property to use to represent the selection value (not null)
      Returns:
        A new `OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder`

    - #### options

          static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> options(com.holonplatform.core.property.Property<T> selectionProperty,
                                                                                                      Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)

      Gets a builder to create a `Property` model based options `MultiSelect`, which uses a `CheckboxGroup` as input component.
      Type Parameters:
        `T` - Value type
      Parameters:
        `selectionProperty` - The property to use to represent the selection value (not null)
        `itemConverter` - The function to use to convert a selection value into the corresponding `PropertyBox` item
      Returns:
        A new `OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder`

Copyright © 2019 The Holon Platform. All rights reserved.