Java 类javax.swing.event.RowSorterEvent.Type 实例源码
项目:minimal-j
文件:SwingTable.java
@Override
public void sorterChanged(RowSorterEvent e) {
if (e.getType() == Type.SORT_ORDER_CHANGED) {
@SuppressWarnings("unchecked")
List<? extends SortKey> sortKeys = e.getSource().getSortKeys();
Object[] keys = new Object[sortKeys.size()];
boolean[] directions = new boolean[sortKeys.size()];
int index = 0;
for (SortKey s : sortKeys) {
keys[index] = SwingTable.this.keys[s.getColumn()];
directions[index] = s.getSortOrder() == SortOrder.ASCENDING;
index++;
}
if (list instanceof Sortable) {
((Sortable) list).sort(keys, directions);
}
setOffset(0);
}
}
项目:breakout
文件:BetterJTable.java
protected void updateViewSelectionModel(RowSorterEvent e) {
if (e.getType() == Type.SORTED) {
rebuildViewSelectionModel();
}
}