org.freehep.swing.table
Class DefaultSortableTableModel
java.lang.Object
org.freehep.swing.table.DefaultSortableTableModel
- All Implemented Interfaces:
- TableModel, SortableTableModel
public class DefaultSortableTableModel
- extends Object
- implements SortableTableModel
Converts any TableModel to a SortableTableModel.
- Version:
- $Id: DefaultSortableTableModel.java 12627 2007-06-10 04:50:35Z tonyj $
- Author:
- Tony Johnson
DefaultSortableTableModel
public DefaultSortableTableModel(TableModel source)
- Creates a new instance of DefaultTableSorter
- Parameters:
source - The table model to be converted.
addTableModelListener
public void addTableModelListener(TableModelListener l)
- Specified by:
addTableModelListener in interface TableModel
getColumnClass
public Class getColumnClass(int columnIndex)
- Specified by:
getColumnClass in interface TableModel
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount in interface TableModel
getColumnName
public String getColumnName(int columnIndex)
- Specified by:
getColumnName in interface TableModel
getRowCount
public int getRowCount()
- Specified by:
getRowCount in interface TableModel
getValueAt
public Object getValueAt(int rowIndex,
int columnIndex)
- Specified by:
getValueAt in interface TableModel
isCellEditable
public boolean isCellEditable(int rowIndex,
int columnIndex)
- Specified by:
isCellEditable in interface TableModel
removeTableModelListener
public void removeTableModelListener(TableModelListener l)
- Specified by:
removeTableModelListener in interface TableModel
setValueAt
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
- Specified by:
setValueAt in interface TableModel
sort
public void sort(int column,
boolean ascending)
- Description copied from interface:
SortableTableModel
- Sort the table model using the given column. Once this method
has been called the table model should reorder its rows so that
they are sorted using the given column. The table model should
generate appropriate change events to reflect any changes made
to the model as a result of the sort. If the table data is modified
after sort has been called, the table model should continue to sort
the data using the given column.
- Specified by:
sort in interface SortableTableModel
- Parameters:
column - The index of the column to sort on, or UNSORTED if no sort is necessary.ascending - If true sort in ascending order, else sort in descending order.
isSortAscending
public boolean isSortAscending()
- Specified by:
isSortAscending in interface SortableTableModel
getSortOnColumn
public int getSortOnColumn()
- Description copied from interface:
SortableTableModel
- Returns the sort column, or
UNSORTED if no sort currently in effect.
- Specified by:
getSortOnColumn in interface SortableTableModel
Copyright © 2000-2013 FreeHEP. All Rights Reserved.