T
- the type to create Option
s frompublic class SelectionBuilder<T> extends OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
Selection
s, providing a fluent API.Selection persons = new SelectionBuilder("persons") .title("persons") .options(Arrays.asList(a, b, c)) .select(b) .disable(c) .type(SelectionType.SELECT_MULTIPLE) .build();
Constructor and Description |
---|
SelectionBuilder(String id) |
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> |
type(SelectionType type)
Sets the
SelectionType for the selection |
setOwner
public SelectionBuilder(String id)
public SelectionBuilder<T> title(String title)
title
- the titlepublic SelectionBuilder<T> type(SelectionType type)
SelectionType
for the selectiontype
- the typepublic SelectionBuilder<T> addGroup(OptionGroup group)
OptionGroup
to the selectiongroup
- the grouppublic SelectionBuilder<T> options(Iterable<T> values)
OptionsBuilder
options
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
values
- the elementspublic SelectionBuilder<T> name(NameProvider<T> nameProvider)
OptionsBuilder
NameProvider
to use when setting an option's namename
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
nameProvider
- the providerpublic SelectionBuilder<T> selector(OptionOwner.Selector selector)
OptionsBuilder
OptionOwner.Selector
to use when selecting options.selector
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
selector
- the selectorOptionsBuilder.select(Object)
,
OptionsBuilder.select(Collection)
public SelectionBuilder<T> select(Collection<T> selected)
OptionsBuilder
select
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
selected
- the selected elementsOptionsBuilder.selector
,
OptionsBuilder.select(Object)
public SelectionBuilder<T> select(T selected)
OptionsBuilder
select
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
selected
- the selected elementOptionsBuilder.selector
,
OptionsBuilder.select(Collection)
public SelectionBuilder<T> disable(Collection<T> disabled)
OptionsBuilder
disable
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
disabled
- the disabled elementOptionsBuilder.disable(Object)
public SelectionBuilder<T> disable(T disabled)
OptionsBuilder
disable
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
disabled
- the disabled elementsOptionsBuilder.disable(Collection)
public SelectionBuilder<T> defaultOption(String name, String value)
OptionsBuilder
defaultOption
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
name
- the name for the option to be addedvalue
- the value for the option to be addedpublic SelectionBuilder<T> hitCounter(OptionOwner.HitCounter<T> counter)
OptionsBuilder
OptionOwner.HitCounter
hitCounter
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
counter
- the counterpublic org.appng.api.support.SelectionBuilder.Selection build()
OptionsBuilder
build
in class OptionsBuilder<T,org.appng.api.support.SelectionBuilder.Selection>
Copyright © 2011–2020 aiticon GmbH. All rights reserved.