echopointng.table
Class DefaultSortableTableModel

java.lang.Object
  extended by nextapp.echo2.app.table.AbstractTableModel
      extended by nextapp.echo2.app.table.DefaultTableModel
          extended by echopointng.table.DefaultSortableTableModel
All Implemented Interfaces:
SortableTableModel, java.io.Serializable, TableModel
Direct Known Subclasses:
DefaultPageableSortableTableModel

public class DefaultSortableTableModel
extends DefaultTableModel
implements SortableTableModel

The default implementation for the SortableTableModel interface. The sort algorithm is deferred to Collections.sort()

See Also:
Serialized Form

Constructor Summary
DefaultSortableTableModel(TableColumnModel columnModel)
           
 
Method Summary
 int getCurrentSortColumn()
          Returns the currently sorted column number.
protected  java.util.List getRows()
          Creates a List of Lists based on the data backing this model in the superclass.
 boolean isCurrentSortAscending()
          Returns true if this model is currently being sorted ascending
protected  void setRows(java.util.List rows)
          Synchronizes the given List of Lists to the data backing this model in the superclass.
 void sortByColumn(int column, boolean ascending)
          Sorts the data backing this model based on the given column and ascending flag.
 
Methods inherited from class nextapp.echo2.app.table.DefaultTableModel
addRow, deleteRow, getColumnCount, getColumnName, getRowCount, getValueAt, insertRow, setColumnCount, setColumnName, setRowCount, setValueAt
 
Methods inherited from class nextapp.echo2.app.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getEventListenerList, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextapp.echo2.app.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, removeTableModelListener
 

Constructor Detail

DefaultSortableTableModel

public DefaultSortableTableModel(TableColumnModel columnModel)
Method Detail

sortByColumn

public void sortByColumn(int column,
                         boolean ascending)
Description copied from interface: SortableTableModel
Sorts the data backing this model based on the given column and ascending flag.

Specified by:
sortByColumn in interface SortableTableModel
Parameters:
column - the column to sort by
ascending - sort the column ascending or not
See Also:
SortableTableModel.sortByColumn(int, boolean)

getRows

protected java.util.List getRows()
Creates a List of Lists based on the data backing this model in the superclass.


setRows

protected void setRows(java.util.List rows)
Synchronizes the given List of Lists to the data backing this model in the superclass.


getCurrentSortColumn

public int getCurrentSortColumn()
Description copied from interface: SortableTableModel
Returns the currently sorted column number.

Specified by:
getCurrentSortColumn in interface SortableTableModel
Returns:
the column number.
See Also:
SortableTableModel.getCurrentSortColumn()

isCurrentSortAscending

public boolean isCurrentSortAscending()
Description copied from interface: SortableTableModel
Returns true if this model is currently being sorted ascending

Specified by:
isCurrentSortAscending in interface SortableTableModel
Returns:
true if sort is ascending
See Also:
SortableTableModel.isCurrentSortAscending()