Class AbstractItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>>
java.lang.Object
is.codion.common.model.component.combobox.AbstractItemComboBoxModelBuilder<T,B>
- Type Parameters:
T- the item typeB- the builder type
- All Implemented Interfaces:
FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>
public abstract class AbstractItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>>
extends Object
implements FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>
A base class for
FilterComboBoxModel.ItemComboBoxModelBuilder implementations. A toolkit builder extends this class,
adding its own options and overriding build() to wrap the FilterComboBoxModel in its own model.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()final BonSelectedItem(Consumer<Item<T>> item) final BselectedItem(@Nullable Item<T> item) Sets the initially selected itemfinal BselectedValue(@Nullable T value) Sets the initially selected item, by its valueprotected final Bself()final Bsorted(boolean sorted) final Bsorted(Comparator<Item<T>> comparator)
-
Constructor Details
-
AbstractItemComboBoxModelBuilder
-
-
Method Details
-
sorted
- Specified by:
sortedin interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Parameters:
sorted- true if the items should be sorted, false by default- Returns:
- this builder instance
-
sorted
- Specified by:
sortedin interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Parameters:
comparator- the comparator to sort by- Returns:
- this builder instance
-
selectedValue
Description copied from interface:FilterComboBoxModel.ItemComboBoxModelBuilderSets the initially selected item, by its value- Specified by:
selectedValuein interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Parameters:
value- the value of the item to select initially, null for none, the null item representing it, if any- Returns:
- this builder
-
selectedItem
Description copied from interface:FilterComboBoxModel.ItemComboBoxModelBuilderSets the initially selected item- Specified by:
selectedItemin interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Parameters:
item- the item to select initially, null for none, the null item representing it, if any- Returns:
- this builder
-
onSelectedItem
- Specified by:
onSelectedItemin interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Parameters:
item- receives the selected item- Returns:
- this builder instance
-
build
- Specified by:
buildin interfaceFilterComboBoxModel.ItemComboBoxModelBuilder<T, B extends FilterComboBoxModel.ItemComboBoxModelBuilder<T,B>> - Returns:
- a new
FilterComboBoxModel
-
self
- Returns:
- this builder instance
-