1 | if (paramTable.isEditing()) {↵ | | 1 | if (table.isEditing()) {↵
|
2 | TableCellEditor cellEditor = paramTable.getCellEditor(paramTable.getEditingRow(), paramTable↵ | | 2 | TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), ↵
|
3 | .getEditingColumn());↵ | | 3 | table.getEditingColumn());↵
|
4 | cellEditor.cancelCellEditing();↵ | | 4 | cellEditor.cancelCellEditing();↵
|
5 | }↵ | | |
|
|
6 | ↵ | | 5 | }↵
|
7 | int rowSelected = paramTable.getSelectedRow();↵ | | 6 | int rowSelected = table.getSelectedRow();↵
|
8 | if (rowSelected >= 0) {↵ | | 7 | if (rowSelected >= 0) {↵
|
9 | tableModel.removeRow(rowSelected);↵ | | 8 | runCommandOnRow(command, rowSelected);↵
|
10 | tableModel.fireTableDataChanged();↵ | | 9 | tableModel.fireTableDataChanged();↵
|
|
11 | // Disable DELETE if there are no rows in the table to delete.↵ | | 10 | // Disable DELETE and BROWSE if there are no rows in the table to delete.↵
|
12 | if (tableModel.getRowCount() == 0) {↵ | | |
|
13 | deleteRowButton.setEnabled(false);↵ | | |
|
14 | }↵ | | |
|
|
15 | ↵ | | 11 | checkDeleteAndBrowseStatus();↵
|
16 | // Table still contains one or more rows, so highlight (select)↵ | | 12 | // Table still contains one or more rows, so highlight (select)↵
|
17 | // the appropriate one.↵ | | 13 | // the appropriate one.↵
|
18 | else {↵ | | |
|
19 | ↵ | | 14 | if (tableModel.getRowCount() != 0) {↵
|
20 | int rowToSelect = rowSelected;↵ | | 15 | int rowToSelect = rowSelected;↵
|
|
21 | if (rowSelected >= tableModel.getRowCount()) {↵ | | 16 | if (rowSelected >= tableModel.getRowCount()) {↵
|
22 | rowToSelect = rowSelected - 1;↵ | | 17 | rowToSelect = rowSelected - 1;↵
|
23 | }↵ | | |
|
|
24 | paramT↵ | | 18 | }↵
|
25 | able.setRowSelectionInterval(rowToSelect, rowToSelect);↵ | | 19 | table.setRowSelectionInterval(rowToSelect, rowToSelect);↵
|
26 | }↵ | | |
|
27 | ↵ | | 20 | }↵
|
28 | } | | 21 | }
|