Module is.codion.common.model
Interface FilterTableModel.Builder<R,C,B extends FilterTableModel.Builder<R,C,B>>
- Type Parameters:
R- the row typeC- the column identifier typeB- the builder type
- All Known Subinterfaces:
SwingFilterTableModel.Builder<R,C>
- All Known Implementing Classes:
AbstractFilterTableModelBuilder
- Enclosing interface:
FilterTableModel<R,C>
public static interface FilterTableModel.Builder<R,C,B extends FilterTableModel.Builder<R,C,B>>
A builder for a
FilterTableModel.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides aFilterTableModel.Builderinstance -
Method Summary
Modifier and TypeMethodDescriptionbuild()filters(Consumer<TableConditions.Builder<C>> filters) Configures the column filters, the builder received providing a filter for each filterable column, initialized with its defaults.items(Supplier<Collection<R>> items) onRefreshException(Consumer<Exception> onRefreshException) By default, exceptions during refresh are rethrown, use this method to handle async exceptions differentlyonSelectedIndex(Consumer<Integer> index) onSelectedIndexes(Consumer<List<Integer>> indexes) onSelectedItem(Consumer<R> item) onSelectedItems(Consumer<List<R>> items) onSelectionChanged(Runnable listener) refresh(boolean refresh) Items failing validation can not be added to the model.
-
Method Details
-
filters
Configures the column filters, the builder received providing a filter for each filterable column, initialized with its defaults. Replaces any previous configuration.- Parameters:
filters- configures the filters- Returns:
- this builder instance
- See Also:
-
items
- Parameters:
items- supplies the items- Returns:
- this builder instance
-
validator
Items failing validation can not be added to the model.- Parameters:
validator- the item validator- 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
-
refresh
- Parameters:
refresh- true if the model items should be refreshed on initialization, false by default- Returns:
- this builder instance
-
onSelectionChanged
- Parameters:
listener- the selection listener- Returns:
- this builder instance
-
onSelectedItem
- Parameters:
item- receives the selected item- Returns:
- this builder instance
-
onSelectedItems
- Parameters:
items- receives the selected items- Returns:
- this builder instance
-
onSelectedIndex
- Parameters:
index- receives the selected index- Returns:
- this builder instance
-
onSelectedIndexes
- Parameters:
indexes- receives the selected indexes- Returns:
- this builder instance
-
build
FilterTableModel<R,C> build()- Returns:
- a new
FilterTableModelinstance. - Throws:
IllegalArgumentException- in case an excluded or configured filter is not a filterable column, or is both excluded and configured, or in case a filter type is neither String nor the column type- See Also:
-