| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.fest.swing.driver; |
| 16 |
|
|
| 17 |
|
import static org.fest.swing.driver.JTableCellValidator.validateCellIsEditable; |
| 18 |
|
import static org.fest.swing.driver.JTableCellValidator.validateIndices; |
| 19 |
|
import static org.fest.swing.edt.GuiActionRunner.execute; |
| 20 |
|
|
| 21 |
|
import javax.swing.JTable; |
| 22 |
|
import javax.swing.table.TableCellEditor; |
| 23 |
|
|
| 24 |
|
import org.fest.swing.annotation.RunsInCurrentThread; |
| 25 |
|
import org.fest.swing.annotation.RunsInEDT; |
| 26 |
|
import org.fest.swing.edt.GuiTask; |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
@link |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@author |
| 33 |
|
@author |
| 34 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 9 |
Complexity Density: 0.75 |
|
| 35 |
|
final class JTableStopCellEditingTask { |
| 36 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 37 |
7
|
@RunsInEDT... |
| 38 |
|
static void stopEditing(final TableCellEditor cellEditor) { |
| 39 |
7
|
execute(new GuiTask() { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 40 |
7
|
protected void executeInEDT() {... |
| 41 |
7
|
doStopCellEditing(cellEditor); |
| 42 |
|
} |
| 43 |
|
}); |
| 44 |
|
} |
| 45 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 46 |
5
|
@RunsInEDT... |
| 47 |
|
static void stopEditing(final JTable table, final int row, final int column) { |
| 48 |
5
|
execute(new GuiTask() { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
5
|
protected void executeInEDT() {... |
| 50 |
5
|
doStopCellEditing(table, row, column); |
| 51 |
|
} |
| 52 |
|
}); |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
4
|
@RunsInEDT... |
| 56 |
|
static void validateAndStopEditing(final JTable table, final int row, final int column) { |
| 57 |
4
|
execute(new GuiTask() { |
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 58 |
4
|
protected void executeInEDT() {... |
| 59 |
4
|
validateIndices(table, row, column); |
| 60 |
2
|
validateCellIsEditable(table, row, column); |
| 61 |
1
|
doStopCellEditing(table, row, column); |
| 62 |
|
} |
| 63 |
|
}); |
| 64 |
|
} |
| 65 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
6
|
@RunsInCurrentThread... |
| 67 |
|
private static void doStopCellEditing(JTable table, int row, int column) { |
| 68 |
6
|
doStopCellEditing(table.getCellEditor(row, column)); |
| 69 |
|
} |
| 70 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 71 |
13
|
@RunsInCurrentThread... |
| 72 |
|
private static void doStopCellEditing(TableCellEditor cellEditor) { |
| 73 |
1
|
if (cellEditor == null) return; |
| 74 |
12
|
cellEditor.stopCellEditing(); |
| 75 |
|
} |
| 76 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 77 |
|
private JTableStopCellEditingTask() {}... |
| 78 |
|
} |