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

public final Class ColumnFilter<T, R>

extends Object
Class Inheritance
Imports
javafx.beans.Observable, javafx.beans.value.ChangeListener, .ObservableValue, .WeakChangeListener, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, .WeakListChangeListener, javafx.scene.control.ContextMenu, .CustomMenuItem, .TableColumn, javafx.scene.image.Image, .ImageView, java.util.HashMap, .HashSet, .Objects, .Optional, java.util.function.BiPredicate, .Supplier

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ListChangeListener<T>
private boolean
private final ChangeListener<R>
private static final Image
private volatile FilterPanel<T, R>
private final ListChangeListener<FilterValue<T, R>>
private final ObservableList<FilterValue<T, R>>
private final DupeCounter<R>
private ImageView
private boolean
private boolean
private final ListChangeListener<T>
private boolean
private BiPredicate<String, String>
private final TableColumn<T, R>
private final TableFilter<T>
private final HashMap<ColumnFilter.CellIdentity<T>, ChangeListener<R>>
private final HashSet<R>
private final DupeCounter<R>

Constructor Summary

AccessConstructor and Description
public
ColumnFilter(TableFilter<T> tableFilter, TableColumn<T, R> tableColumn)

Method Summary

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

private void
public void
applyFilter()

Re-executes filter based on selections for this given ColumnFilter

pack-priv void
applyFilterIcon()

Display or hides the Filter Icon in the tableColumn header.

private void
attachContextMenu()

Leverages tableColumn's context menu to attach filter panel

pack-priv boolean
evaluate(T item)

pack-priv FilterPanel<T, R>
public ObservableList<FilterValue<T, R>>
getFilterValues()

Gets the FilterValues for this given ColumnFilter

public BiPredicate<String, String>
getSearchStrategy()

Returns the search implementation for this given ColumnFilter.

public TableColumn<T, R>
getTableColumn()

Returns the TableColumn attached to this given ColumnFilter

public TableFilter<T>
getTableFilter()

Returns the entire TableFilter this ColumnFilter belongs to

pack-priv boolean
public void
initialize()

Initializes this ColumnFilter, particularly if it was set up in a lazy context

private void
private void
public boolean
isFiltered()

Indicates whether a filter is active on this ColumnFilter

public boolean
isInitialized()

Returns boolean indicating whether this ColumnFilter was initialized

private void
removeBackingItem(T item, ObservableValue<R> cellValue)

private void
removeValue(R value)

private void
pack-priv void
public void
selectAllValues()

Selects all values for this given ColumnFilter

public void
selectValue(Object value)

Allows selecting a given value programmatically for this ColumnFilter

pack-priv void
setFilterPanel(FilterPanel<T, R> filterPanel)

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

Sets a search implementation for this BiPredicate for this given ColumnFilter.

public void
unSelectAllValues()

Unselects all values for this given ColumnFilter

public void
unselectValue(Object value)

Allows unselecting a given value programmatically for this ColumnFilter

public boolean
valueIsVisible(R value)

Indicates whether a given value is currently visible for this ColumnFilter

pack-priv boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backingListListenerback to summary
private final ListChangeListener<T> backingListListener
bumpedWidthback to summary
private boolean bumpedWidth
changeListenerback to summary
private final ChangeListener<R> changeListener
filterIconback to summary
private static final Image filterIcon
filterPanelback to summary
private volatile FilterPanel<T, R> filterPanel
filterValueListChangeListenerback to summary
private final ListChangeListener<FilterValue<T, R>> filterValueListChangeListener
filterValuesback to summary
private final ObservableList<FilterValue<T, R>> filterValues
filterValuesDupeCounterback to summary
private final DupeCounter<R> filterValuesDupeCounter
imageViewback to summary
private ImageView imageView
initializedback to summary
private boolean initialized
isDirtyback to summary
private boolean isDirty
itemsListenerback to summary
private final ListChangeListener<T> itemsListener
lastFilterback to summary
private boolean lastFilter
searchStrategyback to summary
private BiPredicate<String, String> searchStrategy
tableColumnback to summary
private final TableColumn<T, R> tableColumn
tableFilterback to summary
private final TableFilter<T> tableFilter
trackedCellsback to summary
private final HashMap<ColumnFilter.CellIdentity<T>, ChangeListener<R>> trackedCells
unselectedValuesback to summary
private final HashSet<R> unselectedValues
visibleValuesDupeCounterback to summary
private final DupeCounter<R> visibleValuesDupeCounter

Constructor Detail

ColumnFilterback to summary
public ColumnFilter(TableFilter<T> tableFilter, TableColumn<T, R> tableColumn)

Method Detail

addBackingItemback to summary
private void addBackingItem(T item, ObservableValue<R> cellValue)
addVisibleItemback to summary
private void addVisibleItem(ObservableValue<R> cellValue)
applyFilterback to summary
public void applyFilter()

Re-executes filter based on selections for this given ColumnFilter

applyFilterIconback to summary
pack-priv void applyFilterIcon()

Display or hides the Filter Icon in the tableColumn header. This should only be called through TableFilter#executeFilter()

attachContextMenuback to summary
private void attachContextMenu()

Leverages tableColumn's context menu to attach filter panel

evaluateback to summary
pack-priv boolean evaluate(T item)
getFilterPanelback to summary
pack-priv FilterPanel<T, R> getFilterPanel()
getFilterValuesback to summary
public ObservableList<FilterValue<T, R>> getFilterValues()

Gets the FilterValues for this given ColumnFilter

getSearchStrategyback to summary
public BiPredicate<String, String> getSearchStrategy()

Returns the search implementation for this given ColumnFilter.

getTableColumnback to summary
public TableColumn<T, R> getTableColumn()

Returns the TableColumn attached to this given ColumnFilter

getTableFilterback to summary
public TableFilter<T> getTableFilter()

Returns the entire TableFilter this ColumnFilter belongs to

hasUnselectionsback to summary
pack-priv boolean hasUnselections()
initializeback to summary
public void initialize()

Initializes this ColumnFilter, particularly if it was set up in a lazy context

initializeListenersback to summary
private void initializeListeners()
initializeValuesback to summary
private void initializeValues()
isFilteredback to summary
public boolean isFiltered()

Indicates whether a filter is active on this ColumnFilter

isInitializedback to summary
public boolean isInitialized()

Returns boolean indicating whether this ColumnFilter was initialized

removeBackingItemback to summary
private void removeBackingItem(T item, ObservableValue<R> cellValue)
removeValueback to summary
private void removeValue(R value)
removeVisibleItemback to summary
private void removeVisibleItem(ObservableValue<R> cellValue)
resetAllFiltersback to summary
pack-priv void resetAllFilters()
selectAllValuesback to summary
public void selectAllValues()

Selects all values for this given ColumnFilter

selectValueback to summary
public void selectValue(Object value)

Allows selecting a given value programmatically for this ColumnFilter

setFilterPanelback to summary
pack-priv void setFilterPanel(FilterPanel<T, R> filterPanel)
setSearchStrategyback to summary
public void setSearchStrategy(BiPredicate<String, String> searchStrategy)

Sets a search implementation for this BiPredicate for this given ColumnFilter.

unSelectAllValuesback to summary
public void unSelectAllValues()

Unselects all values for this given ColumnFilter

unselectValueback to summary
public void unselectValue(Object value)

Allows unselecting a given value programmatically for this ColumnFilter

valueIsVisibleback to summary
public boolean valueIsVisible(R value)

Indicates whether a given value is currently visible for this ColumnFilter

wasLastFilteredback to summary
pack-priv boolean wasLastFiltered()
org.controlsfx.control.table back to summary

private final Class ColumnFilter.CellIdentity<T>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final T

Constructor Summary

AccessConstructor and Description
pack-priv
CellIdentity(T item)

Method Summary

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

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 T item

Constructor Detail

CellIdentityback to summary
pack-priv CellIdentity(T item)

Method Detail

equalsback to summary
public boolean equals(Object other)

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