org.apache.lucene.swing.models
public class TableSearcher extends AbstractTableModel
This decorator works by holding a reference to a decorated ot inner TableModel. All data is stored within that table model, not this table model. Rather, this table model simply manages links to data in the inner table model according to the search. All methods on TableSearcher forward to the inner table model with subtle filtering or alteration according to the search criteria.
Using the table model: Pass the TableModel you want to decorate in at the constructor. When the TableModel initializes, it displays all search results. Call the search method with any valid Lucene search String and the data will be filtered by the search string. Users can always clear the search at any time by searching with an empty string. Additionally, you can add a button calling the clearSearch() method.
Field Summary | |
---|---|
protected TableModel | tableModel
The inner table model we are decorating |
Constructor Summary | |
---|---|
TableSearcher(TableModel tableModel) |
Method Summary | |
---|---|
Analyzer | getAnalyzer() |
Class | getColumnClass(int column) |
int | getColumnCount() |
String | getColumnName(int column) |
int | getRowCount() |
TableModel | getTableModel() |
Object | getValueAt(int row, int column) |
boolean | isCellEditable(int row, int column) |
void | search(String searchString)
Run a new search.
|
void | setAnalyzer(Analyzer analyzer) |
void | setTableModel(TableModel tableModel)
Set the table model used by this table model |
void | setValueAt(Object aValue, int row, int column) |
Parameters: tableModel The table model to decorate
Returns: The current lucene analyzer
Returns: The inner table model this table model is decorating
Parameters: searchString Any valid lucene search string
Parameters: analyzer The new analyzer to use
Parameters: tableModel The new table model to decorate