Module is.codion.swing.common.model
Interface FilterComboBoxModel<T>
- Type Parameters:
T
- the type of values in this combo box model
- All Superinterfaces:
ComboBoxModel<T>
,FilterModel<T>
,ListModel<T>
- All Known Subinterfaces:
EntityComboBoxModel
A combo box model based on
FilterModel
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builds aFilterComboBoxModel
static interface
static interface
static interface
Responsible for finding an item of typeFilterComboBoxModel.ItemFinder
by a single value of typeFilterComboBoxModel.ItemFinder
.Nested classes/interfaces inherited from interface is.codion.common.model.FilterModel
FilterModel.AbstractRefresher<T>, FilterModel.FilteredItems<T>, FilterModel.Items<T>, FilterModel.Refresher<T>, FilterModel.VisibleItems<T>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<String>
Specifies the caption used by default to represent the null item in combo box models.Fields inherited from interface is.codion.common.model.FilterModel
ASYNC_REFRESH
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FilterComboBoxModel.Builder<T>
builder()
static <T> FilterComboBoxModel.Builder<T>
builder
(Collection<T> items) static <T> FilterComboBoxModel.Builder<T>
builder
(Supplier<Collection<T>> supplier) <V> Value<V>
createSelectorValue
(FilterComboBoxModel.ItemFinder<T, V> itemFinder) items()
Methods inherited from interface javax.swing.ComboBoxModel
setSelectedItem
Methods inherited from interface is.codion.common.model.FilterModel
refresh, refresh, refresher
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
-
Field Details
-
NULL_CAPTION
Specifies the caption used by default to represent the null item in combo box models.- Value type: String
- Default value: -
-
-
Method Details
-
items
FilterComboBoxModel.ComboBoxItems<T> items()- Specified by:
items
in interfaceFilterModel<T>
- Returns:
- the model items
-
selection
FilterComboBoxModel.ComboBoxSelection<T> selection()- Specified by:
selection
in interfaceFilterModel<T>
- Returns:
- the
SingleItemSelection
instance used by this filter model
-
getSelectedItem
T getSelectedItem()- Specified by:
getSelectedItem
in interfaceComboBoxModel<T>
- Returns:
- the selected item, N.B. this can include the
nullItem
in case it has been set viaFilterComboBoxModel.Builder.nullItem(Object)
,FilterComboBoxModel.ComboBoxSelection.value()
is usually what you want
-
createSelectorValue
- Type Parameters:
V
- the value type- Parameters:
itemFinder
- responsible for finding the item to select- Returns:
- a
Value
linked to the selected item using the givenFilterComboBoxModel.ItemFinder
instance
-
builder
- Type Parameters:
T
- the item type- Returns:
- a new
FilterComboBoxModel.Builder
instance
-
builder
- Type Parameters:
T
- the item type- Parameters:
items
- the items to add to the model- Returns:
- a new
FilterComboBoxModel.Builder
instance
-
builder
- Type Parameters:
T
- the item type- Parameters:
supplier
- the item supplier- Returns:
- a new
FilterComboBoxModel.Builder
instance
-