- Type Parameters:
T
- the type of items in the model.
- All Known Subinterfaces:
EntityComboBoxModel
,EntityTableModel<E>
,FilterComboBoxModel<T>
,FilterTableModel<R,
C>
- All Known Implementing Classes:
AbstractEntityTableModel
,SwingEntityTableModel
public interface FilterModel<T>
Specifies a data model that can be filtered to hide some or all of the items it contains.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
An abstract base implementation ofFilterModel.Refresher
.static interface
static interface
AMutable
controlling the items in aFilterModel
static interface
Handles refreshing data for aFilterModel
.static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<Boolean>
Specifies whether data models should refresh data asynchronously or on the UI thread Value type: Boolean Default value: true -
Method Summary
Modifier and TypeMethodDescriptionitems()
void
refresh()
Refreshes the items in this model using itsFilterModel.Refresher
.void
refresh
(Consumer<Collection<T>> onRefresh) Refreshes the data in this filter model using itsFilterModel.Refresher
.
-
Field Details
-
ASYNC_REFRESH
Specifies whether data models should refresh data asynchronously or on the UI thread- Value type: Boolean
- Default value: true
- See Also:
-
-
Method Details
-
items
FilterModel.Items<T> items()- Returns:
- the model items
-
refresher
FilterModel.Refresher<T> refresher()- Returns:
- this models Refresher instance
-
refresh
void refresh()Refreshes the items in this model using itsFilterModel.Refresher
.- Throws:
RuntimeException
- in case of an exception when running refresh synchronously- See Also:
-
refresh
Refreshes the data in this filter model using itsFilterModel.Refresher
. Note that this method only throws exceptions when run synchronously off the user interface thread. UseFilterModel.Refresher.failure()
to listen for exceptions that happen during asynchronous refresh.- Parameters:
onRefresh
- called after a successful refresh, may be null- See Also:
-
selection
SingleItemSelection<T> selection()- Returns:
- the
SingleItemSelection
instance used by this filter model
-