Module is.codion.swing.common.model
Interface FilterListModel.Builder<T>
- Type Parameters:
T- the item type
- Enclosing interface:
FilterListModel<T>
public static interface FilterListModel.Builder<T>
Builds a
FilterListModel-
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) selection(Consumer<FilterListSelection<T>> selection)
-
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
-
selection
- Parameters:
selection- receives the list model selection instance- Returns:
- this builder instance
-
build
FilterListModel<T> build()- Returns:
- a new
FilterListModelinstance
-