Module is.codion.swing.common.model
Interface FilterComboBoxModel.ItemComboBoxModelBuilder<T>
- Type Parameters:
T
- the item type
- Enclosing interface:
FilterComboBoxModel<T>
public static interface FilterComboBoxModel.ItemComboBoxModelBuilder<T>
Builds FilterComboBoxModel
implementations based on the Item
class.
Note that item combo box models are unsorted by default, the provided items are assumed to be ordered.
Use sorted(boolean)
or sorted(Comparator)
for a sorted combo box model.
-
Method Details
-
sorted
Default false.- Parameters:
sorted
- true if the items should be sorted- Returns:
- this builder instance
-
sorted
- Parameters:
comparator
- the comparator to sort by- Returns:
- this builder instance
-
selected
Sets the initally selected item- Parameters:
selected
- the item to select initially- Returns:
- this builder
- Throws:
IllegalArgumentException
- in case the model does not contain the given item
-
selected
Sets the initally selected item- Parameters:
selected
- the item to select initially- Returns:
- this builder
- Throws:
IllegalArgumentException
- in case the model does not contain the given item
-
build
FilterComboBoxModel<Item<T>> build()- Returns:
- a new
FilterComboBoxModel
-