org.appng.api.support

## Class SelectionBuilder<T>

- java.lang.Object
- - org.appng.api.support.OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
  - - org.appng.api.support.SelectionBuilder<T>

- Type Parameters:
    `T` - the type to create `Option`s from

      public class SelectionBuilder<T>
      extends OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>

  A builder for `Selection`s, providing a fluent API.
  Example:

       Selection persons = new SelectionBuilder("persons").title("persons").options(Arrays.asList(a, b, c))
                      .select(b).disable(c).type(SelectionType.SELECT_MULTIPLE).build();

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SelectionBuilder(String id)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SelectionBuilder<T>` | `addGroup(OptionGroup group)` Adds a `OptionGroup` to the selection
    `org.appng.api.support.SelectionBuilder.Selection` | `build()` Creates the options and adds the to the owner
    `SelectionBuilder<T>` | `defaultOption(String name, String value)` Adds an option at the very first position
    `SelectionBuilder<T>` | `disable(Collection<T> disabled)` Disables a single element, i.e.
    `SelectionBuilder<T>` | `disable(T disabled)` Disables some elements, i.e.
    `SelectionBuilder<T>` | `hitCounter(OptionOwner.HitCounter<T> counter)` Sets a `OptionOwner.HitCounter`
    `SelectionBuilder<T>` | `name(NameProvider<T> nameProvider)` Sets the `NameProvider` to use when setting an option's name
    `SelectionBuilder<T>` | `options(Iterable<T> values)` Sets the elements to build options from
    `SelectionBuilder<T>` | `select(Collection<T> selected)` Selects some elements, i.e.
    `SelectionBuilder<T>` | `select(T selected)` Selects a single elements, i.e.
    `SelectionBuilder<T>` | `selector(OptionOwner.Selector selector)` Sets the `OptionOwner.Selector` to use when selecting options.
    `SelectionBuilder<T>` | `title(String title)` Sets the title for the selection
    `SelectionBuilder<T>` | `titleId(String titleId)` Sets the title for the selection
    `SelectionBuilder<T>` | `tooltip(String tooltip)` Sets the tooltip for the selection
    `SelectionBuilder<T>` | `tooltipId(String tooltipId)` Sets the tooltip for the selection
    `SelectionBuilder<T>` | `type(SelectionType type)` Sets the `SelectionType` for the selection

    - ### Methods inherited from class org.appng.api.support.OptionsBuilder

      `setOwner`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SelectionBuilder

          public SelectionBuilder(String id)

  - ### Method Detail

    - #### title

          public SelectionBuilder<T> title(String title)

      Sets the title for the selection
      Parameters:
        `title` - the title
      Returns:
        this builder

    - #### tooltip

          public SelectionBuilder<T> tooltip(String tooltip)

      Sets the tooltip for the selection
      Parameters:
        `tooltip` - the tooltip
      Returns:
        this builder

    - #### titleId

          public SelectionBuilder<T> titleId(String titleId)

      Sets the title for the selection
      Parameters:
        `titleId` - the id of the title (value will be retrieved from the `Application`s `MessageSource`)
      Returns:
        this builder

    - #### tooltipId

          public SelectionBuilder<T> tooltipId(String tooltipId)

      Sets the tooltip for the selection
      Parameters:
        `tooltipId` - the id of the tooltip (value will be retrieved from the `Application`s `MessageSource`)
      Returns:
        this builder

    - #### type

          public SelectionBuilder<T> type(SelectionType type)

      Sets the `SelectionType` for the selection
      Parameters:
        `type` - the type
      Returns:
        this builder

    - #### addGroup

          public SelectionBuilder<T> addGroup(OptionGroup group)

      Adds a `OptionGroup` to the selection
      Parameters:
        `group` - the group
      Returns:
        this builder

    - #### options

          public SelectionBuilder<T> options(Iterable<T> values)

      Description copied from class: `OptionsBuilder`
      Sets the elements to build options from
      Overrides:
        `options` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `values` - the elements
      Returns:
        this builder

    - #### name

          public SelectionBuilder<T> name(NameProvider<T> nameProvider)

      Description copied from class: `OptionsBuilder`
      Sets the `NameProvider` to use when setting an option's name
      Overrides:
        `name` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `nameProvider` - the provider
      Returns:
        this builder

    - #### selector

          public SelectionBuilder<T> selector(OptionOwner.Selector selector)

      Description copied from class: `OptionsBuilder`
      Sets the `OptionOwner.Selector` to use when selecting options.
      Overrides:
        `selector` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `selector` - the selector
      Returns:
        this builder
      See Also:
        `OptionsBuilder.select(Object)`, `OptionsBuilder.select(Collection)`

    - #### select

          public SelectionBuilder<T> select(Collection<T> selected)

      Description copied from class: `OptionsBuilder`
      Selects some elements, i.e. the created options will be selected.
      Overrides:
        `select` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `selected` - the selected elements
      Returns:
        this builder
      See Also:
        `OptionsBuilder.selector`, `OptionsBuilder.select(Object)`

    - #### select

          public SelectionBuilder<T> select(T selected)

      Description copied from class: `OptionsBuilder`
      Selects a single elements, i.e. the created option will be selected.
      Overrides:
        `select` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `selected` - the selected element
      Returns:
        this builder
      See Also:
        `OptionsBuilder.selector`, `OptionsBuilder.select(Collection)`

    - #### disable

          public SelectionBuilder<T> disable(Collection<T> disabled)

      Description copied from class: `OptionsBuilder`
      Disables a single element, i.e. the created option will be disabled
      Overrides:
        `disable` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `disabled` - the disabled element
      Returns:
        this builder
      See Also:
        `OptionsBuilder.disable(Object)`

    - #### disable

          public SelectionBuilder<T> disable(T disabled)

      Description copied from class: `OptionsBuilder`
      Disables some elements, i.e. the created options will be disabled
      Overrides:
        `disable` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `disabled` - the disabled elements
      Returns:
        this builder
      See Also:
        `OptionsBuilder.disable(Collection)`

    - #### defaultOption

          public SelectionBuilder<T> defaultOption(String name,
                                                   String value)

      Description copied from class: `OptionsBuilder`
      Adds an option at the very first position
      Overrides:
        `defaultOption` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `name` - the name for the option to be added
        `value` - the value for the option to be added
      Returns:
        this builder

    - #### hitCounter

          public SelectionBuilder<T> hitCounter(OptionOwner.HitCounter<T> counter)

      Description copied from class: `OptionsBuilder`
      Sets a `OptionOwner.HitCounter`
      Overrides:
        `hitCounter` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Parameters:
        `counter` - the counter
      Returns:
        this builder

    - #### build

          public org.appng.api.support.SelectionBuilder.Selection build()

      Description copied from class: `OptionsBuilder`
      Creates the options and adds the to the owner
      Overrides:
        `build` in class `OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>`
      Returns:
        the owner the options

Copyright © 2011–2023 aiticon GmbH. All rights reserved.