M
- The type of the table modelpublic class RowSorter<M extends TableModel> extends TableRowSorter<M>
JTable table;
...
table.setRowSorter<TableModel>(new RowSorter(table.getModel()))
DefaultRowSorter.ModelWrapper<M,I>
RowSorter.SortKey
Constructor and Description |
---|
RowSorter()
Constructor.
|
RowSorter(M model)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
setToggleSequence(List<SortOrder> sequence)
Sets the toggle sequence.
|
void |
toggleSortOrder(int column) |
getComparator, getStringConverter, setModel, setStringConverter, useToString
allRowsChanged, convertRowIndexToModel, convertRowIndexToView, getMaxSortKeys, getModel, getModelRowCount, getModelWrapper, getRowFilter, getSortKeys, getSortsOnUpdates, getViewRowCount, isSortable, modelStructureChanged, rowsDeleted, rowsInserted, rowsUpdated, rowsUpdated, setComparator, setMaxSortKeys, setModelWrapper, setRowFilter, setSortable, setSortKeys, setSortsOnUpdates, sort
addRowSorterListener, fireRowSorterChanged, fireSortOrderChanged, removeRowSorterListener
public RowSorter()
public RowSorter(M model)
model
- The table's model.public void toggleSortOrder(int column)
toggleSortOrder
in class DefaultRowSorter<M extends TableModel,Integer>
public void setToggleSequence(List<SortOrder> sequence)
sequence
- the toggle sequence, a non empty list of SortOrder. Null to restore the default order.
Please note that if a SorterOrder occurs twice in the list, the behavior of this class is unpredictable.IllegalArgumentException
- if the sequence is emptyCopyright © 2022. All rights reserved.