java.lang.Object
org.controlsfx.control.table.TableFilter<T>
- Type Parameters:
T
-
Applies a filtering control to a provided
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.
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 ClassesModifier and TypeClassDescriptionstatic final class
A Builder for a TableFilter against a specified TableView -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 backingObservableList
originally provided to the constructor.Optional
<ColumnFilter<T, ?>> getColumnFilter
(javafx.scene.control.TableColumn<T, ?> tableColumn) javafx.collections.ObservableList
<ColumnFilter<T, ?>> javafx.collections.transformation.FilteredList
<T> Returns theFilteredList
used by this TableFilter and is backing theTableView
.boolean
isDirty()
void
void
void
selectAllValues
(javafx.scene.control.TableColumn<?, ?> column) Programmatically selects all values for the specified TableColumnvoid
selectValue
(javafx.scene.control.TableColumn<?, ?> column, Object value) Programmatically selects value for the specified TableColumnvoid
setSearchStrategy
(BiPredicate<String, String> searchStrategy) 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 TableColumnvoid
unselectValue
(javafx.scene.control.TableColumn<?, ?> column, Object value) Programmatically unselects value for the specified TableColumn
-
Constructor Details
-
TableFilter
Deprecated.Use TableFilter.forTableView() factory and leverage Builder
-
-
Method Details
-
setSearchStrategy
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
Returns the backingObservableList
originally provided to the constructor.- Returns:
- ObservableList
-
getFilteredList
Returns theFilteredList
used by this TableFilter and is backing theTableView
.- Returns:
- FilteredList
-
selectValue
Programmatically selects value for the specified TableColumn -
unselectValue
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
-
getColumnFilter
public Optional<ColumnFilter<T,?>> getColumnFilter(javafx.scene.control.TableColumn<T, ?> tableColumn) -
isDirty
public boolean isDirty() -
forTableView
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
-
-