Module is.codion.swing.common.model
Interface SwingFilterListModel.Builder<T>
- Type Parameters:
T- the item type
- Enclosing interface:
SwingFilterListModel<T>
public static interface SwingFilterListModel.Builder<T>
Builds a
SwingFilterListModel — the same options as the common
FilterListModel.Builder (the selection is a
javax.swing.ListSelectionModel based one and the refresher a ProgressWorker based one),
but the chain stays Swing-typed so build() yields a ListModel.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionasync(boolean async) build()comparator(@Nullable Comparator<T> comparator) onIndexesSelected(Consumer<List<Integer>> indexes) onIndexSelected(Consumer<Integer> index) onItemSelected(Consumer<T> item) onItemsSelected(Consumer<List<T>> items) onRefreshException(Consumer<Exception> onRefreshException) By default, exceptions during refresh are rethrown, use this method to handle async exceptions differentlyonSelectionChanged(Runnable listener)
-
Method Details
-
comparator
- Parameters:
comparator- the comparator to use when sorting- Returns:
- this builder instance
-
async
- Parameters:
async- true if async refresh should be enabled- Returns:
- this builder instance
-
onRefreshException
By default, exceptions during refresh are rethrown, use this method to handle async exceptions differently- Parameters:
onRefreshException- the exception handler to use during refresh- Returns:
- this builder instance
-
included
- Parameters:
included- thePredicatecontrolling which items should be included- Returns:
- this builder instance
-
onSelectionChanged
- Parameters:
listener- the selection listener- Returns:
- this builder instance
-
onItemSelected
- Parameters:
item- receives the selected item- Returns:
- this builder instance
-
onItemsSelected
- Parameters:
items- receives the selected items- Returns:
- this builder instance
-
onIndexSelected
- Parameters:
index- receives the selected index- Returns:
- this builder instance
-
onIndexesSelected
- Parameters:
indexes- receives the selected indexes- Returns:
- this builder instance
-
build
SwingFilterListModel<T> build()- Returns:
- a new
SwingFilterListModelinstance
-