private static final Logger log = Logger.getLogger(ResultSetTable.class);
private static final TableCellRenderer nullRenderer = new NullValueRenderer();
+ private static final boolean[] booleans = {false, true};
private final AnyActionListener anyActionListener;
private final ColumnHeaderCellRenderer columnHeaderRenderer;
rowHeader.addMouseListener(rowHeaderMouseListener);
rowHeader.addMouseMotionListener(rowHeaderMouseListener);
// cursor
- for (int i = 0; i < 2; i++) {
- final boolean withSelect = (i == 1);
+ for (final boolean withSelect : booleans) {
bindJumpAction("home", VK_HOME, withSelect);
bindJumpAction("end", VK_END, withSelect);
bindJumpAction("top", VK_UP, withSelect);
// key binds
final int shortcutKey = Utilities.getMenuShortcutKeyMask();
AnyAction aa = new AnyAction(this);
+ aa.bindSelf(copyWithEscape, getKeyStroke(VK_C, shortcutKey | InputEvent.SHIFT_DOWN_MASK));
aa.bindSelf(paste, getKeyStroke(VK_V, shortcutKey));
+ aa.bindSelf(clearSelectedCellValue, getKeyStroke(VK_DELETE, 0));
+ aa.bindSelf(deleteRows, getKeyStroke(VK_MINUS, shortcutKey | InputEvent.SHIFT_DOWN_MASK));
aa.bindKeyStroke(true, adjustColumnWidth, getKeyStroke(VK_SLASH, shortcutKey));
aa.bindKeyStroke(false, doNothing, getKeyStroke(VK_ESCAPE, 0));
}
@Override
public void reset() {
- // empty
+ ((DefaultTableModel)getModel()).setRowCount(0);
+ lastSortedIndex = -1;
+ lastSortedIsReverse = false;
}
static final class TableHeaderTextSearch implements TextSearch {