Interface FilterTableModel.Builder<R,C,B extends FilterTableModel.Builder<R,C,B>>

Type Parameters:
R - the row type
C - the column identifier type
B - 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:
  • Method Details

    • filters

      B filters(Consumer<TableConditions.Builder<C>> 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

      B items(Supplier<Collection<R>> items)
      Parameters:
      items - supplies the items
      Returns:
      this builder instance
    • validator

      B validator(Predicate<R> validator)
      Items failing validation can not be added to the model.
      Parameters:
      validator - the item validator
      Returns:
      this builder instance
    • onRefreshException

      B onRefreshException(Consumer<Exception> 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

      B included(Predicate<R> included)
      Parameters:
      included - the Predicate controlling which items should be included
      Returns:
      this builder instance
    • refresh

      B refresh(boolean refresh)
      Parameters:
      refresh - true if the model items should be refreshed on initialization, false by default
      Returns:
      this builder instance
    • onSelectionChanged

      B onSelectionChanged(Runnable listener)
      Parameters:
      listener - the selection listener
      Returns:
      this builder instance
    • onSelectedItem

      B onSelectedItem(Consumer<R> item)
      Parameters:
      item - receives the selected item
      Returns:
      this builder instance
    • onSelectedItems

      B onSelectedItems(Consumer<List<R>> items)
      Parameters:
      items - receives the selected items
      Returns:
      this builder instance
    • onSelectedIndex

      B onSelectedIndex(Consumer<Integer> index)
      Parameters:
      index - receives the selected index
      Returns:
      this builder instance
    • onSelectedIndexes

      B onSelectedIndexes(Consumer<List<Integer>> indexes)
      Parameters:
      indexes - receives the selected indexes
      Returns:
      this builder instance
    • build

      FilterTableModel<R,C> build()
      Returns:
      a new FilterTableModel instance.
      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: