com.sptci.echo2.table
Class DefaultSortableTableModel<D>
java.lang.Object
nextapp.echo2.app.table.AbstractTableModel
com.sptci.echo2.table.AbstractTableModel<D>
com.sptci.echo2.table.TableModel<D>
com.sptci.echo2.table.DefaultSortableTableModel<D>
- Type Parameters:
D - The class of the model object displayed in the table.
- All Implemented Interfaces:
- SortableTableModel, Serializable, TableModel
public class DefaultSortableTableModel<D>
- extends TableModel<D>
- implements SortableTableModel
A genericised TableModel used to
hold instances of objects of the type specified. Contains additional
methods to sort the contents of the model.
© Copyright 2007 Sans Pareil Technologies, Inc.
- Version:
- $Id: DefaultSortableTableModel.java 4120 2008-05-25 20:49:48Z rakesh $
- Author:
- Rakesh Vidyadharan 2007-11-12
- See Also:
- Serialized Form
|
Method Summary |
void |
sort(int column)
Sort the data by the values in the specified column index. |
void |
sort(int column,
SortableTableModel.Direction direction)
Sort the data by the values in the specified column index. |
| Methods inherited from class com.sptci.echo2.table.TableModel |
addRow, deleteRow, deleteRow, getColumnAnnotations, getColumnClass, getColumnCount, getColumnName, getObjectAt, getRowCount, getValueAt, init, insertRow, processColumnAnnotations, processColumns, processColumnsAnnotation, processFields, updateRow |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultSortableTableModel
protected DefaultSortableTableModel()
- Default constructor.
DefaultSortableTableModel
public DefaultSortableTableModel(Collection<D> collection)
- Create a new instance of the model using the specified collection of
data objects.
- Parameters:
collection - The collection of data objects to display in the
Table.- See Also:
TableModel.processColumns()
sort
public void sort(int column)
- Sort the data by the values in the specified column index. Default
implemented uses a
TreeMap to sort the value in
the specified column index.
- Specified by:
sort in interface SortableTableModel
- Parameters:
column - The index of the column by which the data is to
be sorted.- See Also:
AbstractTableModel.getSortDirection(int),
SortableTableModel.sort( int, Direction )
sort
public void sort(int column,
SortableTableModel.Direction direction)
- Sort the data by the values in the specified column index. Default
implemented uses a
TreeMap to sort the value in
the specified column index.
- Specified by:
sort in interface SortableTableModel
- Parameters:
column - The index of the column by which the data is to
be sorted.direction - The direction of sorting to be applied.- See Also:
AbstractTableModel.fireTableDataChanged()