Class 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.
    • Constructor Detail

      • TableFilter

        @Deprecated
        public TableFilter​(TableView<T> tableView)
        Deprecated.
        Use TableFilter.forTableView() factory and leverage Builder
    • Method Detail

      • 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 ObservableList<T> getBackingList()
        Returns the backing ObservableList originally provided to the constructor.
        Returns:
        ObservableList
      • selectValue

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

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

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

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

        public void executeFilter()
      • resetFilter

        public void resetFilter()
      • isDirty

        public boolean isDirty()
      • forTableView

        public static <T> TableFilter.Builder<T> forTableView​(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 -