Class ArrayTableSorter<R>
java.lang.Object
uk.ac.starlink.util.gui.ArrayTableSorter<R>
Handles GUI aspects of allowing the user to sort columns in a table
by clicking on the column header.
After construction you have to install it on a suitable table header.
The table must be represented by a
ArrayTableModel.- Since:
- 14 Oct 2009
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinstall(JTableHeader header) Sets this object up to allow sorting its model by clicking on a given JTable header.voidsetSorting(int icol, boolean descending) Performs a sort on a given column.voiduninstall(JTableHeader header) Reverses the action of a previousinstall(JTableHeader)action.
-
Constructor Details
-
ArrayTableSorter
-
-
Method Details
-
install
Sets this object up to allow sorting its model by clicking on a given JTable header.- Parameters:
header- table header component
-
uninstall
Reverses the action of a previousinstall(JTableHeader)action.- Parameters:
header- table header component
-
setSorting
public void setSorting(int icol, boolean descending) Performs a sort on a given column. Note, the header should be repainted following a call to this method.- Parameters:
icol- column indexdescending- true sort down, false sort up
-