-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new buttons to statistics dialog
- Loading branch information
1 parent
ae3b90a
commit 7322c85
Showing
6 changed files
with
103 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...c/main/java/de/uka/ilkd/key/gui/plugins/caching/DefaultReferenceSearchDialogListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package de.uka.ilkd.key.gui.plugins.caching; | ||
|
||
import javax.swing.*; | ||
|
||
import de.uka.ilkd.key.core.KeYMediator; | ||
import de.uka.ilkd.key.gui.MainWindow; | ||
import de.uka.ilkd.key.gui.actions.ShowProofStatistics; | ||
import de.uka.ilkd.key.proof.Proof; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class DefaultReferenceSearchDialogListener implements ReferenceSearchDialogListener { | ||
private static final Logger LOGGER = | ||
LoggerFactory.getLogger(DefaultReferenceSearchDialogListener.class); | ||
private final KeYMediator mediator; | ||
|
||
public DefaultReferenceSearchDialogListener(KeYMediator mediator) { | ||
this.mediator = mediator; | ||
} | ||
|
||
@Override | ||
public void closeButtonClicked(ReferenceSearchDialog dialog) { | ||
dialog.dispose(); | ||
} | ||
|
||
@Override | ||
public void copyButtonClicked(ReferenceSearchDialog dialog) { | ||
System.out.println("copy clicked !!!"); | ||
mediator.stopInterface(true); | ||
Proof p = mediator.getSelectedProof(); | ||
new Thread(() -> { | ||
try { | ||
p.copyCachedGoals(null, | ||
total -> SwingUtilities.invokeLater(() -> dialog.setMaximum(total)), | ||
() -> SwingUtilities.invokeLater(() -> { | ||
if (dialog.incrementProgress()) { | ||
mediator.startInterface(true); | ||
dialog.dispose(); | ||
new ShowProofStatistics.Window(MainWindow.getInstance(), p) | ||
.setVisible(true); | ||
} | ||
})); | ||
} catch (Exception e) { | ||
LOGGER.error("failed to copy cache ", e); | ||
} | ||
}).start(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters