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.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilds aFilterComboBoxModelstatic interfacestatic interfaceBuildsFilterComboBoxModelimplementations based on theItemclass.static interfaceResponsible for finding an item of typeFilterComboBoxModel.ItemFinderby a single value of typeFilterComboBoxModel.ItemFinder.Nested classes/interfaces inherited from interface is.codion.common.model.filter.FilterModel
FilterModel.AbstractRefresher<T>, FilterModel.FilteredItems<T>, FilterModel.IncludedItems<T>, FilterModel.IncludedPredicate<T>, FilterModel.Items<T>, FilterModel.Refresher<T>, FilterModel.Sort<T> -
Field Summary
FieldsModifier 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.filter.FilterModel
ASYNC -
Method Summary
Modifier and TypeMethodDescriptionbooleanItems(String nullCaption) booleanItems(String nullCaption, String trueCaption, String falseCaption) builder()<V> Value<V> createSelector(FilterComboBoxModel.ItemFinder<T, V> itemFinder) items()Methods inherited from interface javax.swing.ComboBoxModel
setSelectedItemMethods inherited from interface is.codion.common.model.filter.FilterModel
selection, sortMethods 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: -
- See Also:
-
-
Method Details
-
items
FilterComboBoxModel.ComboBoxItems<T> items()- Specified by:
itemsin interfaceFilterModel<T>- Returns:
- the model items
-
getSelectedItem
- Specified by:
getSelectedItemin interfaceComboBoxModel<T>- Returns:
- the selected item, N.B. this can include the
nullItemin case it has been set viaFilterComboBoxModel.Builder.nullItem(Object),SingleSelection.item()is usually what you want
-
createSelector
- Type Parameters:
V- the value type- Parameters:
itemFinder- responsible for finding the item to select- Returns:
- a
Valuelinked to the selected item using the givenFilterComboBoxModel.ItemFinderinstance
-
builder
- Returns:
- a new
FilterComboBoxModel.Builder.ItemsStepinstance
-
booleanItems
- Returns:
- items for null, true and false, using the default captions
- See Also:
-
booleanItems
- Parameters:
nullCaption- the caption for the null value- Returns:
- items for null, true and false, using the given null caption and the default true/false captions
- See Also:
-
booleanItems
static List<Item<Boolean>> booleanItems(String nullCaption, String trueCaption, String falseCaption) - Parameters:
nullCaption- the caption for nulltrueCaption- the caption for truefalseCaption- the caption for false- Returns:
- items for null, true and false
-