| org.isqlviewer.swing.table.Sortable
All known Subclasses: org.isqlviewer.swing.table.EnhancedTableModel,
Sortable | public interface Sortable (Code) | | An interface to indacte that it's contents are sortable.
This interface is mainly designed for use with TableModel implementations.
author: Mark A. Kobold <mkobold at isqlviewer dot com> version: 1.0 |
Method Summary | |
public boolean | canSort(int column, boolean ascending) Checks to see if a given column can be sorted in a given direction.
Calls should be made to this method prior to calling sort(int, boolean). | public int | getIndexOfColumnName(String ColumnName) Reverse indexing of column names. | public void | sort(int column, boolean sortAscending) Sorts the given column with a given direction. |
canSort | public boolean canSort(int column, boolean ascending)(Code) | | Checks to see if a given column can be sorted in a given direction.
Calls should be made to this method prior to calling sort(int, boolean). Invocation to the sort(int, boolean)
method should only occur if this method returns true.
See Also: Sortable.sort(int,boolean) Parameters: column - to check for sorting. Parameters: ascending - true for ascending, false for descending. if the given column is sortable. |
getIndexOfColumnName | public int getIndexOfColumnName(String ColumnName)(Code) | | Reverse indexing of column names.
This method helps the sort icon show in the Table headers appear on the correct column even if it is reodered.
Parameters: ColumnName - to reverse lookup int the true index of the column in the data model. |
sort | public void sort(int column, boolean sortAscending)(Code) | | Sorts the given column with a given direction.
Implementation should handle if the column index is out of bounds.
Parameters: column - the desired column to sort. Parameters: sortAscending - the sorting direction flag. |
|
|