Top Description Inners Fields Constructors Methods
org.controlsfx.control.table

public final Class TableFilter<T>

extends Object
Class Inheritance
Imports
javafx.collections.FXCollections, .ListChangeListener, .ObservableList, javafx.collections.transformation.FilteredList, .SortedList, javafx.scene.control.TableColumn, .TableView, java.util.Optional, java.util.function.BiPredicate, java.util.stream.Collectors, java.util.stream.*

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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
TableFilter.Builder<T>

A Builder for a TableFilter against a specified TableView

Field Summary

Modifier and TypeField and Description
private final ObservableList<T>
private final ObservableList<ColumnFilter<T, ?>>
private final FilteredList<T>
private final TableView<T>

Constructor Summary

AccessConstructor and Description
public
TableFilter(TableView<T> tableView)
Deprecated

Use TableFilter.forTableView() factory and leverage Builder

private
TableFilter(TableView<T> tableView, boolean isLazy)

Method Summary

Modifier and TypeMethod and Description
private void
public void
private <S> Stream<TableColumn<T, ?>>
extractNestedColumns(TableColumn<T, S> tableColumn)

public static <T> TableFilter.Builder<T>
forTableView(TableView<T> tableView)

Returns a TableFilter.Builder to configure a TableFilter on the specified TableView.

public ObservableList<T>

Returns:

ObservableList
getBackingList
()

Returns the backing ObservableList originally provided to the constructor.

public Optional<ColumnFilter<T, ?>>
getColumnFilter(TableColumn<T, ?> tableColumn)

public ObservableList<ColumnFilter<T, ?>>
public FilteredList<T>

Returns:

FilteredList
getFilteredList
()

Returns the FilteredList used by this TableFilter and is backing the TableView.

public TableView<T>
public boolean
public void
public void
public void
selectAllValues(TableColumn<?, ?> column)

Programmatically selects all values for the specified TableColumn

public void
selectValue(TableColumn<?, ?> column, Object value)

Programmatically selects value for the specified TableColumn

public void
setSearchStrategy(BiPredicate<String, String> searchStrategy)

Allows specifying a different behavior for the search box on the TableFilter.

public void
unSelectAllValues(TableColumn<?, ?> column)

Programmatically unselect all values for the specified TableColumn

public void
unselectValue(TableColumn<?, ?> column, Object value)

Programmatically unselects value for the specified TableColumn

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backingListback to summary
private final ObservableList<T> backingList
columnFiltersback to summary
private final ObservableList<ColumnFilter<T, ?>> columnFilters
filteredListback to summary
private final FilteredList<T> filteredList
tableViewback to summary
private final TableView<T> tableView

Constructor Detail

TableFilterback to summary
public TableFilter(TableView<T> tableView)

Deprecated

Use TableFilter.forTableView() factory and leverage Builder

Annotations
@Deprecated
TableFilterback to summary
private TableFilter(TableView<T> tableView, boolean isLazy)

Method Detail

applyForAllColumnsback to summary
private void applyForAllColumns()
executeFilterback to summary
public void executeFilter()
extractNestedColumnsback to summary
private <S> Stream<TableColumn<T, ?>> extractNestedColumns(TableColumn<T, S> tableColumn)
forTableViewback to summary
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

getBackingListback to summary
public ObservableList<T> getBackingList()

Returns the backing ObservableList originally provided to the constructor.

Returns:ObservableList<T>

ObservableList

getColumnFilterback to summary
public Optional<ColumnFilter<T, ?>> getColumnFilter(TableColumn<T, ?> tableColumn)
getColumnFiltersback to summary
public ObservableList<ColumnFilter<T, ?>> getColumnFilters()
getFilteredListback to summary
public FilteredList<T> getFilteredList()

Returns the FilteredList used by this TableFilter and is backing the TableView.

Returns:FilteredList<T>

FilteredList

getTableViewback to summary
public TableView<T> getTableView()
isDirtyback to summary
public boolean isDirty()
resetAllFiltersback to summary
public void resetAllFilters()
resetFilterback to summary
public void resetFilter()
selectAllValuesback to summary
public void selectAllValues(TableColumn<?, ?> column)

Programmatically selects all values for the specified TableColumn

selectValueback to summary
public void selectValue(TableColumn<?, ?> column, Object value)

Programmatically selects value for the specified TableColumn

setSearchStrategyback to summary
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.

unSelectAllValuesback to summary
public void unSelectAllValues(TableColumn<?, ?> column)

Programmatically unselect all values for the specified TableColumn

unselectValueback to summary
public void unselectValue(TableColumn<?, ?> column, Object value)

Programmatically unselects value for the specified TableColumn

org.controlsfx.control.table back to summary

public final Class TableFilter.Builder<T>

extends Object
Class Inheritance

A Builder for a TableFilter against a specified TableView

Field Summary

Modifier and TypeField and Description
private volatile boolean
private final TableView<T>

Constructor Summary

AccessConstructor and Description
private
Builder(TableView<T> tableView)

Method Summary

Modifier and TypeMethod and Description
public TableFilter<T>
public TableFilter.Builder<T>
lazy(boolean isLazy)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lazyIndback to summary
private volatile boolean lazyInd
tableViewback to summary
private final TableView<T> tableView

Constructor Detail

Builderback to summary
private Builder(TableView<T> tableView)

Method Detail

applyback to summary
public TableFilter<T> apply()
lazyback to summary
public TableFilter.Builder<T> lazy(boolean isLazy)