|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SortableTableData
TableModel
s which want to make use of TinyLaF's table
headers for sortable table data must implement this interface.
See the example implementation in de.muntjak.tinylaf.controlpanel.TinyTableModel.
Field Summary | |
---|---|
static int |
SORT_ASCENDING
value of sortingDirection property: column data sorted in ascending order |
static int |
SORT_DESCENDING
value of sortingDirection property: column data sorted in descending order |
Method Summary | |
---|---|
boolean |
isColumnSortable(int column)
Return true if the specified column
is sortable, false otherwise. |
void |
sortColumns(int[] columns,
int[] sortingDirections,
javax.swing.JTable table)
Sort the data according to the given arguments. |
boolean |
supportsMultiColumnSort()
Return true if the table model supports
multiple sorted columns, false otherwise. |
Field Detail |
---|
static final int SORT_ASCENDING
sortingDirection
property: column data sorted in ascending order
static final int SORT_DESCENDING
sortingDirection
property: column data sorted in descending order
Method Detail |
---|
boolean isColumnSortable(int column)
true
if the specified column
is sortable, false
otherwise. Non-sortable
column headers will not react to mouse clicks or rollovers.
column
- a column index
true
if the specified column
is sortable, false
otherwisevoid sortColumns(int[] columns, int[] sortingDirections, javax.swing.JTable table)
Note for implementors: If your data is dynamically changing you
should think about storing copies of the arguments so
you can re-sort data after each change. It may also be
a good idea to call fireTableDataChanged()
after sorting
(this makes sure that the table is updated).
columns
- array of column indices sorted by priority
(highest priority first)sortingDirections
- array containing the sorting direction
for each sorted column. Values are either
SORT_ASCENDING
- sort column data in ascending order, or
SORT_DESCENDING
- sort column data in descending order
table
- the table displaying the data. Might be useful, for example,
to restore selected cells after sorting.boolean supportsMultiColumnSort()
true
if the table model supports
multiple sorted columns, false
otherwise.
(Supporting multi column sort makes sense only with columns
containing some equal values.)
The TinyLaF user gestures concerning multi column sort are:
Ctrl-Click
: If clicked column was already sorted,
change sorting direction, else add clicked column to sorted columns.
Alt-Click
: If clicked column was already sorted,
remove from sorted columns. Ignore if clicked column was not sorted.
Click
(without Ctrl
or Alt
):
The clicked column becomes the only sorted column. If the clicked column
already was sorted, change sorting direction.
true
if the table model supports
multiple sorted columns, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |