Package jaxx.runtime.swing.table.filter
Class AbstractTableFilter<T extends JTable>
- java.lang.Object
-
- jaxx.runtime.swing.table.filter.AbstractTableFilter<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,TableFilter<T>
- Direct Known Subclasses:
JTableFilter
public abstract class AbstractTableFilter<T extends JTable> extends Object implements TableFilter<T>
Partial implementation of table filter Created on Feb 10, 2011- Author:
- Eugene Ryzhikov, Kevin Morin
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jaxx.runtime.swing.table.filter.TableFilter
TableFilter.Row
-
-
Constructor Summary
Constructors Constructor Description AbstractTableFilter(T table)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(FilterChangeListener listener)booleanapply(int col, Collection<Object> items)Apply filter for specified column based on collection of distinct itemsvoidclear()Clear the filterprotected abstract booleanexecute(int col, Collection<Object> items)voidfireFilterChange()Collection<Object>getDistinctColumnItems(int column)Collection<Object>getFilterState(int column)TgetTable()The table under filterbooleanincludeRow(TableFilter.Row row)booleanisFiltered(int column)Checks if column is filteredvoidremoveChangeListener(FilterChangeListener listener)voidsetFilterState(int column, Collection<Object> values)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jaxx.runtime.swing.table.filter.TableFilter
distinctValuesForColumn, modelChanged, toString
-
-
-
-
Constructor Detail
-
AbstractTableFilter
public AbstractTableFilter(T table)
-
-
Method Detail
-
getTable
public T getTable()
Description copied from interface:TableFilterThe table under filter- Specified by:
getTablein interfaceTableFilter<T extends JTable>- Returns:
-
execute
protected abstract boolean execute(int col, Collection<Object> items)
-
apply
public boolean apply(int col, Collection<Object> items)Description copied from interface:TableFilterApply filter for specified column based on collection of distinct items- Specified by:
applyin interfaceTableFilter<T extends JTable>- Returns:
-
addChangeListener
public final void addChangeListener(FilterChangeListener listener)
- Specified by:
addChangeListenerin interfaceTableFilter<T extends JTable>
-
removeChangeListener
public final void removeChangeListener(FilterChangeListener listener)
- Specified by:
removeChangeListenerin interfaceTableFilter<T extends JTable>
-
fireFilterChange
public final void fireFilterChange()
-
getDistinctColumnItems
public Collection<Object> getDistinctColumnItems(int column)
- Specified by:
getDistinctColumnItemsin interfaceTableFilter<T extends JTable>- Parameters:
column- model column index- Returns:
-
getFilterState
public Collection<Object> getFilterState(int column)
- Specified by:
getFilterStatein interfaceTableFilter<T extends JTable>- Parameters:
column- model column index- Returns:
-
isFiltered
public boolean isFiltered(int column)
Description copied from interface:TableFilterChecks if column is filtered- Specified by:
isFilteredin interfaceTableFilter<T extends JTable>- Parameters:
column- model column index- Returns:
- true if column is filtered
-
includeRow
public boolean includeRow(TableFilter.Row row)
- Specified by:
includeRowin interfaceTableFilter<T extends JTable>
-
setFilterState
public void setFilterState(int column, Collection<Object> values)
-
clear
public void clear()
Description copied from interface:TableFilterClear the filter- Specified by:
clearin interfaceTableFilter<T extends JTable>
-
-