|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel edu.ucla.stat.SOCR.util.tablemodels.FilteredTableModel
public class FilteredTableModel
An AbstractTableModel
implementation with filtering support.
It uses supplied RowFilter
to filter table rows.
The original TableModel
is used only as the data
source and is not modified.
Sample usage:
// Old code:
// JTable jTable = new JTable(tableModel);
// New code:
JTable jTable = new JTable(new FilteredTableModel(tableModel));
RowFilter
,
Serialized FormField Summary | |
---|---|
protected javax.swing.table.TableModel |
model
Original TableModel used as data source. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
FilteredTableModel(javax.swing.table.TableModel model)
Creates FilteredTableModel object with specified TableModel
as the data source. |
Method Summary | |
---|---|
void |
filter()
Forces filtering of data contained in model . |
java.lang.Class |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
java.lang.String |
getColumnName(int columnIndex)
|
javax.swing.table.TableModel |
getModel()
Returns original TableModel used as data source. |
int |
getRealRowIndex(int rowIndex)
Returns row index in original model by index in current model (view index). |
int |
getRowCount()
|
RowFilter |
getRowFilter()
Returns RowFilter used to filter table rows. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
void |
setModel(javax.swing.table.TableModel model)
Sets original TableModel used as data source. |
void |
setRowFilter(RowFilter rowFilter)
Sets RowFilter used to filter table rows. |
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
|
void |
tableChanged(javax.swing.event.TableModelEvent e)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.swing.table.TableModel model
TableModel
used as data source.
Constructor Detail |
---|
public FilteredTableModel(javax.swing.table.TableModel model)
FilteredTableModel
object with specified TableModel
as the data source.
model
- TableModel
used as the data sourceMethod Detail |
---|
public RowFilter getRowFilter()
RowFilter
used to filter table rows.
RowFilter
used to filter table rows.public void setRowFilter(RowFilter rowFilter)
RowFilter
used to filter table rows. Invokes filter()
before return.
rowFilter
- RowFilter
used to filter table rowspublic void filter()
model
. The original model
is not modified.
public int getRealRowIndex(int rowIndex)
model
by index in current model (view index).
rowIndex
- index in current model (view index)
model
.public void setModel(javax.swing.table.TableModel model)
TableModel
used as data source.
model
- original TableModel
used as data sourcepublic java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface javax.swing.table.TableModel
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged
in interface javax.swing.event.TableModelListener
public javax.swing.table.TableModel getModel()
TableModel
used as data source.
TableModel
used as data source.public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Class getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |