|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sciapp.filter.FilterHeaderModel
public abstract class FilterHeaderModel
FilterHeaderModel is used to provide real-time row filtering via a component that is installed on the table header.
The methods that need to be implemented deal with the component that is added on each filtering column.
Field Summary | |
---|---|
static int |
ALL_VALUES_MODE
Defines the filter mode for showing all objects under a certain column |
protected boolean |
autoCreateAllFilters
A flag that if true will automatically install a filter for each column added to the table. |
protected int |
columnShowing
the column of the header that is currently showing available filter expressions. |
protected HashMap |
defaultFiltersByColumnClass
A table that contains filters indexed by class. |
protected FilterTableHeader |
filterHeader
The header that is installed on the table. |
protected int |
filterMode
The mode that is being employed to populate the available filter expressions. |
protected FilterModel |
filterModel
The filtermodel that will be used to propagate the filter events. |
static int |
ORDERED_MODE
Defines the filter mode for showing objects depending on the order the filters were installed. |
static int |
PROGRESSIVE_MODE
Defines the filter mode for showing objects depending on all the filters currently installed. |
protected FilterTableModel |
tableModel
The filtertablemodel that will be used to process the filter events. |
Constructor Summary | |
---|---|
FilterHeaderModel()
Constructs a FilterHeaderModel. |
Method Summary | |
---|---|
void |
addFilterInColumn(TableColumn aColumn)
Installs a filter on the supplied column. |
void |
addFilterInColumns()
Installs filters on all columns. |
void |
attachToTable(JTable table)
Installs this FilterHeaderModel instance to a table. |
void |
attachToTable(JTable table,
FilterTableModel ftm)
Installs this FilterHeaderModel instance to a table, by explicitly specifying the FilterTableModel object that will process filter events. |
protected void |
createDefaultFilters()
Creates default filters for objects, strings, numbers and boolean values. |
protected FilterTableHeader |
createTableHeader()
Returns a new instance of the header that will be installed on the table. |
boolean |
getAutoCreateAllFilters()
Returns the autoCreateAllFilters property value. |
int |
getColumnShowing()
Returns the column that is currently showing available filter expressions. |
Filter |
getDefaultFilter(Class columnClass)
Returns the filter to use for the class defined by columnClass. |
protected Filter |
getFilter(int index)
Returns a filter object for the column with model index index . |
int |
getFilterMode()
Returns the mode that is being employed to populate the available filter expressions. |
int |
getFilterOrder(int c)
Returns the order in which the filter expression was selected. |
Object |
getFilterValue(int c)
Returns the object that is used as the filter expression for the column at c . |
Collection |
getFilterValues(int c,
Collection list)
Returns a collection filled with the objects that will be available to be selected as filter expressions for the specified column and the current filter mode. |
Collection |
getFilterValues(int c,
Collection list,
int mode)
Returns a collection filled with the objects that will be available to be selected as filter expressions for the specified column and mode. |
Object |
getListValue(int c)
Returns the object that is used as a label to identify the filter that is installed on the column at c . |
TableFilter |
getTableFilter(int c)
Returns the TableFilter object that is installed on the column at c
and that is responsible for filtering that column. |
TableFilter |
getTableFilterForObject(Object o,
int c)
Returns an appropriate table filter object for the supplied object and column index. |
FilterTableHeader |
getTableHeader()
Returns the header that will be used for displaying a visual representation of a filter on columns. |
boolean |
hasFilter(int c)
Determines whether a column has a filter installed. |
Class |
inferColumnClass(int c)
A utility method to retrieve the class for the objects under the column at c
In most cases, this is similar to calling getColumnClass on the table. |
void |
installFilter(Object listValue,
int c)
Assigns a new table filter to the column c . |
void |
installFilter(Object listValue,
Object filterValue,
int c)
Assigns a new table filter to the column c . |
void |
installFilter(TableFilter tableFilter,
Object listValue,
Object filterValue,
int c)
Assigns a new table filter to the column c . |
void |
removeFilter(int c)
Removes the filter value from the supplied column. |
void |
removeFilterFromColumn(TableColumn aColumn)
Removes a filter previously installed on a column. |
void |
removeFilterInColumns()
Removes the filters from all the columns. |
void |
removeFromTable()
Removes this FilterHeaderModel instance from the table to which it was previously assigned. |
protected abstract void |
removeRenderer(TableColumn aColumn)
Remove the renderer for aColumn . |
void |
sendFilterEvent()
Sends a filter event to the associated FilterTableModel. |
void |
setAutoCreateAllFilters(boolean newAutoCreateAllFilters)
Assigns a new value for the autoCreateAllFilters property. |
void |
setColumnShowing(int c)
Sets the column for which the user requested a filter to appear. |
void |
setDefaultFilter(Class columnClass,
Filter filter)
Sets the default filter for columnClass. |
void |
setFilterMode(int mode)
Assigns a mode that is being employed to populate the available filter expressions. |
void |
setModel(FilterTableModel ftm)
Assigns the filtertable model that will be used to process the filter events. |
void |
setModel(TableModel tm)
Assigns the filtertable model that will be used to process the filter events. |
protected abstract void |
setRenderer(TableColumn aColumn)
Assigns a renderer for aColumn . |
void |
setTableHeader(FilterTableHeader header)
Associates a header that will be used for displaying a visual representation of a filter on columns. |
abstract void |
updateUI()
Calls to this method should update all components that are used to display the filter on the header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sciapp.filter.FilterHeaderCallback |
---|
shouldProcessEvent |
Field Detail |
---|
protected FilterTableModel tableModel
protected FilterModel filterModel
protected FilterTableHeader filterHeader
protected boolean autoCreateAllFilters
protected HashMap defaultFiltersByColumnClass
protected int columnShowing
public static final int ALL_VALUES_MODE
public static final int PROGRESSIVE_MODE
public static final int ORDERED_MODE
protected int filterMode
Constructor Detail |
---|
public FilterHeaderModel()
Method Detail |
---|
public void addFilterInColumn(TableColumn aColumn)
aColumn
- the column for which a filter we want to add.public void addFilterInColumns()
public void attachToTable(JTable table)
ListTableMap
, contain one in the
chain of ListTableMaps. This FilterTableModel will be used to process filter events.
table
- the table on which the FilterHeaderModel is installed.public void attachToTable(JTable table, FilterTableModel ftm)
table
- the table on which the FilterHeaderModel is installed.ftm
- the FilterTableModel that will be used to process filter events on behalf of the table.protected void createDefaultFilters()
protected FilterTableHeader createTableHeader()
public boolean getAutoCreateAllFilters()
public int getColumnShowing()
public Filter getDefaultFilter(Class columnClass)
columnClass
- the class to which a filter is associated.
protected Filter getFilter(int index)
index
.
This method returns null by default.
index
- the model index of the column
public int getFilterMode()
public int getFilterOrder(int c)
c
- the view index of the column.
public Object getFilterValue(int c)
c
.
c
- the view index of the column.
public Collection getFilterValues(int c, Collection list)
c
- the view index of the columnlist
- the collection to be populated with values
public Collection getFilterValues(int c, Collection list, int mode)
c
- the view index of the columnlist
- the collection to be populated with valuesmode
- the mode to be used when populating the list
public Object getListValue(int c)
c
.
c
- the view index of the column.
public TableFilter getTableFilter(int c)
c
and that is responsible for filtering that column.
c
- the view index of the column.
public TableFilter getTableFilterForObject(Object o, int c)
c
- the view index of the column.
public FilterTableHeader getTableHeader()
public boolean hasFilter(int c)
c
- the view index of the column.
c
has a filter installed, false otherwise.public Class inferColumnClass(int c)
c
In most cases, this is similar to calling getColumnClass on the table.
c
- the view index of the column.
public void installFilter(TableFilter tableFilter, Object listValue, Object filterValue, int c)
c
.
tableFilter
- the new table filter to assign.listValue
- the label of the filter.filterValue
- the value of the filter.c
- the view index of the column.public void installFilter(Object listValue, int c)
c
.
The table filter will be retrieved by calling getTableFilterForObject(filterValue, c),
whereas the filter value will be the same as the supplied list value.
listValue
- the label of the filter.c
- the view index of the column.public void installFilter(Object listValue, Object filterValue, int c)
c
.
The table filter will be retrieved by calling getTableFilterForObject(filterValue, c).
listValue
- the label of the filter.filterValue
- the value of the filter.c
- the view index of the column.public void removeFilter(int c)
c
- the view index of the columnpublic void removeFilterFromColumn(TableColumn aColumn)
aColumn
- the column from which a filter we want to remove.public void removeFilterInColumns()
public void removeFromTable()
protected abstract void removeRenderer(TableColumn aColumn)
aColumn
.
aColumn
- the column which renderer we want to remove.public void sendFilterEvent()
public void setAutoCreateAllFilters(boolean newAutoCreateAllFilters)
newAutoCreateAllFilters
- boolean the new value to assignpublic void setColumnShowing(int c)
c
- the view index of the columnpublic void setDefaultFilter(Class columnClass, Filter filter)
columnClass
- the Class with which a filter we want to associatefilter
- the filter to setpublic void setFilterMode(int mode)
mode
- the new current filter mode to assign.public void setModel(FilterTableModel ftm)
ftm
- the new filtertable model to assign.public void setModel(TableModel tm)
tm
must be an instance of FilterTableModel, or, if it is a ListTableMap
,
it should contain one FilterTableModel in its chain of ListTableMaps.
The first FilterTableModel found will be used to process filter events.
tm
- the new filtertable model to assign.protected abstract void setRenderer(TableColumn aColumn)
aColumn
.
aColumn
- the column to which a renderer we want to assign.public void setTableHeader(FilterTableHeader header)
header
- the new header to assignpublic abstract void updateUI()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |