Class TableFilter<T>

java.lang.Object
org.controlsfx.control.table.TableFilter<T>
Type Parameters:
T -

public final class TableFilter<T> extends Object
Applies a filtering control to a provided TableView instance. The filter will be applied immediately on construction, and can be made visible by right-clicking the desired column to filter on.

Features
-Convenient filter control holds a checklist of distinct items to include/exclude, much like an Excel filter.
-New/removed records will be captured by the filter control and reflect new or removed values from checklist. -Filters on more than one column are combined to only display mutually inclusive records on the client's TableView.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A Builder for a TableFilter against a specified TableView
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableFilter(javafx.scene.control.TableView<T> tableView)
    Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    static <T> TableFilter.Builder<T>
    forTableView(javafx.scene.control.TableView<T> tableView)
    Returns a TableFilter.Builder to configure a TableFilter on the specified TableView.
    javafx.collections.ObservableList<T>
    Returns the backing ObservableList originally provided to the constructor.
    getColumnFilter(javafx.scene.control.TableColumn<T,?> tableColumn)
     
    javafx.collections.ObservableList<ColumnFilter<T,?>>
     
    javafx.collections.transformation.FilteredList<T>
    Returns the FilteredList used by this TableFilter and is backing the TableView.
    boolean
     
    void
     
    void
     
    void
    selectAllValues(javafx.scene.control.TableColumn<?,?> column)
    Programmatically selects all values for the specified TableColumn
    void
    selectValue(javafx.scene.control.TableColumn<?,?> column, Object value)
    Programmatically selects value for the specified TableColumn
    void
    Allows specifying a different behavior for the search box on the TableFilter.
    void
    unSelectAllValues(javafx.scene.control.TableColumn<?,?> column)
    Programmatically unselect all values for the specified TableColumn
    void
    unselectValue(javafx.scene.control.TableColumn<?,?> column, Object value)
    Programmatically unselects value for the specified TableColumn

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TableFilter

      @Deprecated public TableFilter(javafx.scene.control.TableView<T> tableView)
      Deprecated.
      Use TableFilter.forTableView() factory and leverage Builder
  • Method Details

    • setSearchStrategy

      public void setSearchStrategy(BiPredicate<String,String> searchStrategy)
      Allows specifying a different behavior for the search box on the TableFilter. By default, the contains() method on a String is used to evaluate the search box input to qualify the distinct filter values. But you can specify a different behavior by providing a simple BiPredicate argument to this method. The BiPredicate argument allows you take the input value and target value and use a lambda to evaluate a boolean. For instance, you can implement a comparison by assuming the input value is a regular expression, and call matches() on the target value to see if it aligns to the pattern.
      Parameters:
      searchStrategy -
    • getBackingList

      public javafx.collections.ObservableList<T> getBackingList()
      Returns the backing ObservableList originally provided to the constructor.
      Returns:
      ObservableList
    • getFilteredList

      public javafx.collections.transformation.FilteredList<T> getFilteredList()
      Returns the FilteredList used by this TableFilter and is backing the TableView.
      Returns:
      FilteredList
    • selectValue

      public void selectValue(javafx.scene.control.TableColumn<?,?> column, Object value)
      Programmatically selects value for the specified TableColumn
    • unselectValue

      public void unselectValue(javafx.scene.control.TableColumn<?,?> column, Object value)
      Programmatically unselects value for the specified TableColumn
    • selectAllValues

      public void selectAllValues(javafx.scene.control.TableColumn<?,?> column)
      Programmatically selects all values for the specified TableColumn
    • unSelectAllValues

      public void unSelectAllValues(javafx.scene.control.TableColumn<?,?> column)
      Programmatically unselect all values for the specified TableColumn
    • executeFilter

      public void executeFilter()
    • resetFilter

      public void resetFilter()
    • resetAllFilters

      public void resetAllFilters()
    • getColumnFilters

      public javafx.collections.ObservableList<ColumnFilter<T,?>> getColumnFilters()
    • getColumnFilter

      public Optional<ColumnFilter<T,?>> getColumnFilter(javafx.scene.control.TableColumn<T,?> tableColumn)
    • isDirty

      public boolean isDirty()
    • forTableView

      public static <T> TableFilter.Builder<T> forTableView(javafx.scene.control.TableView<T> tableView)
      Returns a TableFilter.Builder to configure a TableFilter on the specified TableView. Call apply() to initialize and return the TableFilter
      Type Parameters:
      T -
      Parameters:
      tableView -