|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFilterableTableModel
An interface to allow you to implement filtering feature on any table model.
Nested Class Summary | |
---|---|
static class |
IFilterableTableModel.FilterItem
FilterItem contains a column and a filter for that column. |
Nested classes/interfaces inherited from interface com.jidesoft.grid.AutoFilterTableHeaderAdapter |
---|
AutoFilterTableHeaderAdapter.FilterTitleFormatter |
Field Summary | |
---|---|
static int |
ALL_COLUMNS
Specifies all columns. |
static int |
ANY_COLUMNS
Specifies any columns. |
static String |
IDENTIFIER_ALL_COLUMNS
|
static String |
IDENTIFIER_ANY_COLUMNS
|
Method Summary | |
---|---|
void |
addFilter(Filter filter)
Adds a filter to all columns. |
void |
addFilter(IFilterableTableModel.FilterItem filterItem)
Adds a FilterItem. |
void |
addFilter(int column,
Filter filter)
Adds a filter to the specified column. |
void |
addFilterableTableModelListener(FilterableTableModelListener l)
Adds a listener to the list that's notified each time a change to the filter occurs. |
void |
clearFilters()
Removes all filters from all columns. |
FilterableTableModelListener[] |
getFilterableTableModelListeners()
Returns an array of all the FilterableTableModel listeners registered on this filter. |
Icon |
getFilterIcon(int column)
Gets the filter icon for a particular column. |
List<IFilterableTableModel.FilterItem> |
getFilterItems()
Gets all the FilterItems added to this FilterableTableModel. |
Filter[] |
getFilters(int column)
Gets the filters for the specified column. |
Object[] |
getPossibleValues(int columnIndex,
Comparator comparator)
Gets all possible values of the table model. |
Object[] |
getPossibleValuesAndConverters(int columnIndex,
Comparator comparator)
|
boolean |
hasFilter()
Checks if the FilterableTableModel has any filters. |
boolean |
hasFilter(int columnIndex)
Checks if the FilterableTableModel has any filters on the specified column. |
boolean |
isAdjusting()
Checks if the FilterableTableModel is adjusting. |
boolean |
isAndMode()
Sets the logic of filters on the same column. |
boolean |
isColumnFilterable(int column)
Checks if the column is filterable for the filters that are added to ALL_COLUMNS . |
boolean |
isColumnVisible(int column)
Checks if the column is visible. |
boolean |
isFilteringPaused()
Checks if the filtering is paused. |
boolean |
isFiltersApplied()
Checks if the filters are in effect. |
boolean |
isSameConverterAt(int columnIndex)
Check if each converter in this column for each row is the same. |
void |
refresh()
Reapply all filters after they are changed. |
void |
removeAllFilters()
Removes all filters that are added using addFilter(Filter) . |
void |
removeAllFilters(int column)
Removes all filters from the specified column. |
void |
removeFilter(Filter filter)
Removes the filter from all columns. |
void |
removeFilter(IFilterableTableModel.FilterItem filterItem)
Removes the filter item. |
void |
removeFilter(int column,
Filter filter)
Removes the filter from the specified column. |
void |
removeFilterableTableModelListener(FilterableTableModelListener l)
Removes a listener from the list that's notified each time a change to the filter occurs. |
void |
setAdjusting(boolean adjusting)
Sets the FilterableTableModel to adjusting mode. |
void |
setAndMode(boolean andMode)
Sets the logic among the filters. |
void |
setFilteringPaused(boolean pause)
If filtering is paused, keep rows in same relative positions Inserts/Deletes shift rows without re-ordering |
void |
setFiltersApplied(boolean apply)
Applies or unapplies the filters. |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from interface com.jidesoft.grid.AutoFilterTableHeaderAdapter |
---|
getDynamicTableFilters, getFilterTitleFormatter, getListCellRenderer, getTitleConverter, isAllowCustomFilter, isAllowMultipleValues, isColumnAutoFilterable, isUseTableCellRenderer, isValuePredetermined |
Field Detail |
---|
static final int ALL_COLUMNS
static final int ANY_COLUMNS
static final String IDENTIFIER_ALL_COLUMNS
static final String IDENTIFIER_ANY_COLUMNS
Method Detail |
---|
void refresh()
boolean isColumnFilterable(int column)
ALL_COLUMNS
. The column will be
excluded if it returns false (same as isColumnVisible(int)
in this case. There is also AutoFilterTableHeaderAdapter.isColumnAutoFilterable(int)
which is used for AutoFilterHeader
to control if the filter button is
visible.
column
- the column index.
boolean isColumnVisible(int column)
column
- the column index.
void addFilter(int column, Filter filter)
column
- the column index. It could also be two special values - ALL_COLUMNS
or ANY_COLUMNS
. If the value is ANY_COLUMNS
, this method will be the same as addFilter(Filter)
.filter
- the filter to be added.void addFilter(Filter filter)
You
can use AbstractFilter
to create new filter. If you need the row index or column index in order to decide
if the value should be filtered, you can use AbstractTableFilter
and use getRowIndex() and
getColumnInde() to find out current row or column index.
filter
- the filter to be added.void addFilter(IFilterableTableModel.FilterItem filterItem)
filterItem
- the FilterItemvoid removeFilter(int column, Filter filter)
addFilter(int, Filter)
.
Please note, removeFilter will not change the FilterableTableModel data right away. You still need to call
setFiltersApplied(true) to apply the filter. The reason is to give developers a chance to add/remove multiple
filters and only updates the data once at the end.
column
- the column index. It could also be two special values - ALL_COLUMNS
or ANY_COLUMNS
. If the value is ANY_COLUMNS
, this method will be the same as removeFilter(Filter)
.filter
- the filter to be removed.void removeFilter(Filter filter)
addFilter(Filter)
.
Please note, removeFilter will not change the FilterableTableModel data right away. You still need to call
setFiltersApplied(true) to apply the filter. The reason is to give developers a chance to add/remove multiple
filters and only updates the data once at the end.
filter
- the filter to be removed.void removeFilter(IFilterableTableModel.FilterItem filterItem)
filterItem
- the FilterItem to be removed.void removeAllFilters(int column)
addFilter(int, Filter)
.
Please note, removeAllFilters will not change the FilterableTableModel data right away. You still need to call
setFiltersApplied(true) to apply the filter. The reason is to give developers a chance to add/remove multiple
filters and only updates the data once at the end.
column
- the column index where all filters for that column should be removed.void removeAllFilters()
addFilter(Filter)
. If you want to remove all filters that
either added using addFilter(int, Filter)
or addFilter(Filter)
, you should use clearFilters()
.
Please note, removeAllFilters will not change the FilterableTableModel data right away. You still need to call
setFiltersApplied(true) to apply the filter. The reason is to give developers a chance to add/remove multiple
filters and only updates the data once at the end.
void clearFilters()
Filter[] getFilters(int column)
column
- the column index.
List<IFilterableTableModel.FilterItem> getFilterItems()
void setFiltersApplied(boolean apply)
apply
- true to apply the filters.boolean isFiltersApplied()
boolean hasFilter()
FilterableTableModel
has any filters.
boolean hasFilter(int columnIndex)
FilterableTableModel
has any filters on the specified column.
columnIndex
- the column index to check if there is a filter on it.
boolean isAndMode()
ALL_COLUMNS
and ANY_COLUMNS
.
void setAndMode(boolean andMode)
FitlerableTableModel
. In order to do more complex
expression, you would need multiple FilterableTableModel
, one wraps the other. You make filters in
each FilterableTableModel
to be OR logic, then the logic among the pipe of
FilterableTableModel
s will always be AND logic.
andMode
- true or false.boolean isAdjusting()
void setAdjusting(boolean adjusting)
adjusting
- true or false.Object[] getPossibleValues(int columnIndex, Comparator comparator)
AutoFilterTableHeader
to populate the drop down filter list.
columnIndex
- the column index.comparator
- the comparator. It is used to sort the values.
Object[] getPossibleValuesAndConverters(int columnIndex, Comparator comparator)
Icon getFilterIcon(int column)
column
- the column index.
void setFilteringPaused(boolean pause)
pause
- TRUE = Filtering is Paused; FALSE = Filtering is Activeboolean isFilteringPaused()
void addFilterableTableModelListener(FilterableTableModelListener l)
l
- the FilterableTableModelListenervoid removeFilterableTableModelListener(FilterableTableModelListener l)
l
- the FilterableTableModelListenerFilterableTableModelListener[] getFilterableTableModelListeners()
FilterableTableModelListener
s or an empty array if no filter listeners
are currently registeredaddFilterableTableModelListener(com.jidesoft.grid.FilterableTableModelListener)
,
removeFilterableTableModelListener(com.jidesoft.grid.FilterableTableModelListener)
boolean isSameConverterAt(int columnIndex)
columnIndex
- the column index
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |