|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
de.muntjak.tinylookandfeel.controlpanel.NonSortableTableModel
de.muntjak.tinylookandfeel.controlpanel.TinyTableModel
public class TinyTableModel
An example table model implementing SortableTableData. See de.muntjak.tinylookandfeel.controlpanel.NonSortableTableModel for details about the data structure.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.muntjak.tinylookandfeel.controlpanel.NonSortableTableModel |
|---|
NonSortableTableModel.Record, NonSortableTableModel.TableColorIcon |
| Field Summary |
|---|
| Fields inherited from class de.muntjak.tinylookandfeel.controlpanel.NonSortableTableModel |
|---|
data |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Fields inherited from interface de.muntjak.tinylookandfeel.table.SortableTableData |
|---|
SORT_ASCENDING, SORT_DESCENDING |
| Constructor Summary | |
|---|---|
TinyTableModel()
|
|
| 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. |
| Methods inherited from class de.muntjak.tinylookandfeel.controlpanel.NonSortableTableModel |
|---|
addColumn, createNewData, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeAllRows, removeColumn, setValueAt |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TinyTableModel()
| Method Detail |
|---|
public boolean isColumnSortable(int column)
SortableTableDatatrue if the specified column
is sortable, false otherwise. Non-sortable
column headers will not react to mouse clicks or rollovers.
isColumnSortable in interface SortableTableDatacolumn - a column index
true if the specified column
is sortable, false otherwisepublic boolean supportsMultiColumnSort()
SortableTableDatatrue 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.
supportsMultiColumnSort in interface SortableTableDatatrue if the table model supports
multiple sorted columns, false otherwise
public void sortColumns(int[] columns,
int[] sortingDirections,
javax.swing.JTable table)
SortableTableData
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).
sortColumns in interface SortableTableDatacolumns - 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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||