| java.lang.Object javax.swing.table.AbstractTableModel org.apache.lucene.swing.models.TableSearcher
TableSearcher | public class TableSearcher extends AbstractTableModel (Code) | | This is a TableModel that encapsulates Lucene
search logic within a TableModel implementation.
It is implemented as a TableModel decorator,
similar to the TableSorter demo from Sun that decorates
a TableModel and provides sorting functionality. The benefit
of this architecture is that you can decorate any TableModel
implementation with this searching table model -- making it
easy to add searching functionaliy to existing JTables -- or
making new search capable table lucene.
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.
author: Jonathan Simon - jonathan_s_simon@yahoo.com |
tableModel | protected TableModel tableModel(Code) | | The inner table model we are decorating
|
TableSearcher | public TableSearcher(TableModel tableModel)(Code) | | Parameters: tableModel - The table model to decorate |
getAnalyzer | public Analyzer getAnalyzer()(Code) | | The current lucene analyzer |
getColumnClass | public Class getColumnClass(int column)(Code) | | |
getColumnCount | public int getColumnCount()(Code) | | |
getRowCount | public int getRowCount()(Code) | | |
getTableModel | public TableModel getTableModel()(Code) | | The inner table model this table model is decorating |
getValueAt | public Object getValueAt(int row, int column)(Code) | | |
isCellEditable | public boolean isCellEditable(int row, int column)(Code) | | |
search | public void search(String searchString)(Code) | | Run a new search.
Parameters: searchString - Any valid lucene search string |
setAnalyzer | public void setAnalyzer(Analyzer analyzer)(Code) | | Parameters: analyzer - The new analyzer to use |
setTableModel | public void setTableModel(TableModel tableModel)(Code) | | Set the table model used by this table model
Parameters: tableModel - The new table model to decorate |
setValueAt | public void setValueAt(Object aValue, int row, int column)(Code) | | |
|
|