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 Implementing Classes:
EntityComboBoxModel
,ItemComboBoxModel
A combo box model based on
FilterModel
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
Responsible for finding an item of typeFilterComboBoxModel.ItemFinder
by a single value of typeFilterComboBoxModel.ItemFinder
.static interface
Specifies the item that should represent null for providing a caption.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 TypeMethodDescription<V> Value<V>
createSelectorValue
(FilterComboBoxModel.ItemFinder<T, V> itemFinder) static <T> FilterComboBoxModel<T>
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.ComboBoxItems.nullItem()
,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
-
filterComboBoxModel
- Type Parameters:
T
- the item type- Returns:
- a new
FilterComboBoxModel
instance
-