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

public Class FilteredTableColumn<S, T>

extends TableColumn2<S, T>
Class Inheritance
Type Parameters
<S>
The type of the objects contained within the TableView items list.
<T>
The type of the content in all cells in this TableColumn
Imports
impl.org.controlsfx.tableview2.RowHeader, javafx.application.Platform, javafx.beans.InvalidationListener, .Observable, .WeakInvalidationListener, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.beans.value.ChangeListener, .ObservableValue, .WeakChangeListener, javafx.collections.ListChangeListener, .ObservableList, .WeakListChangeListener, javafx.css.PseudoClass, javafx.event.ActionEvent, .EventHandler, javafx.scene.control.Button, .TableView, java.util.HashMap, .Objects, .Optional, java.util.function.Consumer, .Predicate

An extension of TableColumn2 that allows filtering options. A filter button is displayed in the column header. If no predicate is applied to the column, it is grayed, else it is blue. The developer can select the action that will be performed when this button is clicked.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ListChangeListener<S>
private final ChangeListener<T>
private static final PseudoClass
private final BooleanProperty
filterable

When the filterable property is set to true, the column can be filtered.

private final Button
private final ChangeListener<Predicate<?>>
private InvalidationListener
private final ObjectProperty<EventHandler<ActionEvent>>
onFilterAction

The filter button's action, which is invoked whenever the filter button is fired.

private InvalidationListener
private final ObjectProperty<Predicate<? super T>>
predicate

This property allows defining a predicate for the column.

private final InvalidationListener
private final HashMap<FilteredTableColumn.CellIdentity<S>, ChangeListener<T>>
trackedCells

Private Fields

private final WeakChangeListener<Predicate<?>>
private WeakInvalidationListener
private final WeakListChangeListener<S>
private WeakInvalidationListener
private final WeakInvalidationListener

Constructor Summary

AccessConstructor and Description
public
FilteredTableColumn()

Creates a FilteredTableColumn control.

public

Method Summary

Modifier and TypeMethod and Description
private void
addBackingItem(S item, ObservableValue<T> cellValue)

public final BooleanProperty
private Optional<FilteredTableView<S>>
public final EventHandler<ActionEvent>
public final Predicate<? super T>
private void
init()

Private Implementation

public final boolean
public final ObjectProperty<EventHandler<ActionEvent>>
public final ObservableValue<Predicate<? super T>>
private void
removeBackingItem(S item, ObservableValue<T> cellValue)

private void
public final void
setFilterable(boolean value)

public final void
public final void
setPredicate(Predicate<? super T> value)

private void
updateButton(boolean value)

private void
Inherited from org.controlsfx.control.tableview2.TableColumn2:
getSouthNodesetSouthNodesouthNodeProperty

Field Detail

backingListListenerback to summary
private final ListChangeListener<S> backingListListener
changeListenerback to summary
private final ChangeListener<T> changeListener
FILTER_ONback to summary
private static final PseudoClass FILTER_ON
filterableback to summary
private final BooleanProperty filterable

When the filterable property is set to true, the column can be filtered.

filterButtonback to summary
private final Button filterButton
filterListenerback to summary
private final ChangeListener<Predicate<?>> filterListener
itemsPropertyListenerback to summary
private InvalidationListener itemsPropertyListener
onFilterActionback to summary
private final ObjectProperty<EventHandler<ActionEvent>> onFilterAction

The filter button's action, which is invoked whenever the filter button is fired.

parentListenerback to summary
private InvalidationListener parentListener
predicateback to summary
private final ObjectProperty<Predicate<? super T>> predicate

This property allows defining a predicate for the column. This predicate can be nullified when the table's predicate is reset, so it is convenient that this property can be set again dynamically via the UI option southNode.

tableListenerback to summary
private final InvalidationListener tableListener
trackedCellsback to summary
private final HashMap<FilteredTableColumn.CellIdentity<S>, ChangeListener<T>> trackedCells

Private Fields

weakFilterListenerback to summary
private final WeakChangeListener<Predicate<?>> weakFilterListener
weakItemsPropertyListenerback to summary
private WeakInvalidationListener weakItemsPropertyListener
weakListChangeListenerback to summary
private final WeakListChangeListener<S> weakListChangeListener
weakParentListenerback to summary
private WeakInvalidationListener weakParentListener
weakTableListenerback to summary
private final WeakInvalidationListener weakTableListener

Constructor Detail

FilteredTableColumnback to summary
public FilteredTableColumn()

Creates a FilteredTableColumn control.

FilteredTableColumnback to summary
public FilteredTableColumn(String text)

Method Detail

addBackingItemback to summary
private void addBackingItem(S item, ObservableValue<T> cellValue)
filterablePropertyback to summary
public final BooleanProperty filterableProperty()
getFilteredTableViewback to summary
private Optional<FilteredTableView<S>> getFilteredTableView()
getOnFilterActionback to summary
public final EventHandler<ActionEvent> getOnFilterAction()
getPredicateback to summary
public final Predicate<? super T> getPredicate()
initback to summary
private void init()

Private Implementation

isFilterableback to summary
public final boolean isFilterable()
onFilterActionPropertyback to summary
public final ObjectProperty<EventHandler<ActionEvent>> onFilterActionProperty()
predicatePropertyback to summary
public final ObservableValue<Predicate<? super T>> predicateProperty()
removeBackingItemback to summary
private void removeBackingItem(S item, ObservableValue<T> cellValue)
runOnFilteredTableViewback to summary
private void runOnFilteredTableView(Consumer<FilteredTableView<S>> consumer)
setFilterableback to summary
public final void setFilterable(boolean value)
setOnFilterActionback to summary
public final void setOnFilterAction(EventHandler<ActionEvent> value)
setPredicateback to summary
public final void setPredicate(Predicate<? super T> value)
updateButtonback to summary
private void updateButton(boolean value)
updateFilterButtonback to summary
private void updateFilterButton(TableView<S> tableView)
org.controlsfx.control.tableview2 back to summary

private final Class FilteredTableColumn.CellIdentity<S>

extends Object
Class Inheritance
  • java.lang.Object
  • org.controlsfx.control.tableview2.FilteredTableColumn.CellIdentity

Field Summary

Modifier and TypeField and Description
private final S

Constructor Summary

AccessConstructor and Description
pack-priv
CellIdentity(S item)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

itemback to summary
private final S item

Constructor Detail

CellIdentityback to summary
pack-priv CellIdentity(S item)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override