Fix sim table not taking proper spotlight
This commit is contained in:
parent
36e0cf2168
commit
a47e2f416e
@ -1404,21 +1404,26 @@ public class SimulationPanel extends JPanel {
|
|||||||
* Focus on the simulation table and maintain the previous row selection(s).
|
* Focus on the simulation table and maintain the previous row selection(s).
|
||||||
*/
|
*/
|
||||||
public void takeTheSpotlight() {
|
public void takeTheSpotlight() {
|
||||||
simulationTable.requestFocusInWindow();
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
if (simulationTable.getRowCount() == 0 || simulationTable.getSelectedRows().length > 0) {
|
@Override
|
||||||
return;
|
public void run() {
|
||||||
}
|
simulationTable.requestFocusInWindow();
|
||||||
if (previousSelection == null || previousSelection.length == 0) {
|
if (simulationTable.getRowCount() == 0 || simulationTable.getSelectedRows().length > 0) {
|
||||||
simulationTable.getSelectionModel().setSelectionInterval(0, 0);
|
return;
|
||||||
} else {
|
|
||||||
simulationTable.clearSelection();
|
|
||||||
for (int row : previousSelection) {
|
|
||||||
if (row < 0 || row >= simulationTable.getRowCount()) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
simulationTable.addRowSelectionInterval(row, row);
|
if (previousSelection == null || previousSelection.length == 0) {
|
||||||
|
simulationTable.getSelectionModel().setSelectionInterval(0, 0);
|
||||||
|
} else {
|
||||||
|
simulationTable.clearSelection();
|
||||||
|
for (int row : previousSelection) {
|
||||||
|
if (row < 0 || row >= simulationTable.getRowCount()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
simulationTable.addRowSelectionInterval(row, row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateActions();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
updateActions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user