Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class ValuesTableFilter

java.lang.Object
  extended by com.citra.filter.TableFilter
      extended by com.citra.filter.ValuesTableFilter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TableColumnFilter

public class ValuesTableFilter
extends TableFilter

A table filter for filtering the rows of a TableModel based on a list of values. This list of values is specified in the constructor and can be assigned later on with the ValuesTableFilter.setValues(java.lang.Object[]) method.

See Also:
Serialized Form

Field Summary
protected  Object[] values
          the list of accepted values
 
Fields inherited from class com.citra.filter.TableFilter
ALL_COLUMNS, column, filter
 
Constructor Summary
ValuesTableFilter(Object[] values, Filter filter)
          Constructs a ValuesTableFilter.
ValuesTableFilter(Object[] values, Filter filter, int column)
          Constructs a ValuesTableFilter.
 
Method Summary
 boolean filter(ListTableModel model, Object row)
          Decides whether a particular row of a JTable will be filtered.
 boolean filter(TableModel model, int rowIndex)
          Decides whether a particular row of a JTable will be filtered.
 Object[] getValues()
          Retrieves the list of accepted values.
 void setValues(Object[] values)
          Assigns the list of accepted values.
 
Methods inherited from class com.citra.filter.TableFilter
getColumn, getFilter, setColumn, setFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected Object[] values
the list of accepted values

Constructor Detail

ValuesTableFilter

public ValuesTableFilter(Object[] values,
                         Filter filter)
Constructs a ValuesTableFilter.


ValuesTableFilter

public ValuesTableFilter(Object[] values,
                         Filter filter,
                         int column)
Constructs a ValuesTableFilter.

Method Detail

filter

public boolean filter(ListTableModel model,
                      Object row)
Decides whether a particular row of a JTable will be filtered. An alternative to this method is filter(TableModel m, int rowIndex).

Overrides:
filter in class TableFilter
Parameters:
model - the ListTableModel that holds a reference to the tabular row data
row - the row of the table to filter, represented as an object
Returns:
true if the row is to be filtered, false otherwise

filter

public boolean filter(TableModel model,
                      int rowIndex)
Decides whether a particular row of a JTable will be filtered. This method is presented as an alternative to filter(ListTableModel ltm, Object o).

Overrides:
filter in class TableFilter
Parameters:
model - the TableModel that holds the unfiltered row data
rowIndex - the index of the row of the table to filter
Returns:
true if the row is to be filtered, false otherwise

getValues

public Object[] getValues()
Retrieves the list of accepted values. If the supplied array is null, the filter will block all rows.

Returns:
an array containing the values that this table filter will allow

setValues

public void setValues(Object[] values)
Assigns the list of accepted values. If the supplied array is null, the filter will block all rows.

Parameters:
values - an array containing the values that this table filter will allow

Copyright © 2011 Citra Technologies. All Rights Reserved.