Skip to content

Commit

Permalink
Fix proof management dialog double click like the examples dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiesler committed Mar 6, 2023
1 parent 752fc30 commit d7efb02
Showing 1 changed file with 16 additions and 9 deletions.
Expand Up @@ -85,15 +85,22 @@ private ProofManagementDialog(MainWindow mainWindow, final InitConfig initConfig
classTree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
final ClassTree.Entry entry = classTree.getSelectedEntry();
if (entry.kjt != null && entry.target != null) {
final ImmutableSet<Contract> contracts = initConfig.getServices()
.getSpecificationRepository().getContracts(entry.kjt, entry.target);
final Contract c = contracts.iterator().next();
if (contracts.size() == 1 && c == contractPanelByMethod.getContract()) {
startButton.doClick();
}
// Check that it is a double click on an item, not a folder or the background
if (e.getClickCount() != 2) {
return;
}
// row is -1 when the user does not click on an entry but on the background
int row = classTree.getRowForLocation(e.getX(), e.getY());
if (row == -1) {
return;
}
final ClassTree.Entry entry = classTree.getSelectedEntry();
if (entry.kjt != null && entry.target != null) {
final ImmutableSet<Contract> contracts = initConfig.getServices()
.getSpecificationRepository().getContracts(entry.kjt, entry.target);
final Contract c = contracts.iterator().next();
if (contracts.size() == 1 && c == contractPanelByMethod.getContract()) {
startButton.doClick();
}
}
}
Expand Down

0 comments on commit d7efb02

Please sign in to comment.