Skip to content

Commit 573c82c

Browse files
authored
added checkbox to disable example loader directly in dialog (KeYProject#3424)
2 parents d637fd4 + b4cb677 commit 573c82c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

key.ui/src/main/java/de/uka/ilkd/key/gui/ExampleChooser.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import javax.swing.tree.TreeSelectionModel;
2222

2323
import de.uka.ilkd.key.gui.utilities.GuiUtilities;
24+
import de.uka.ilkd.key.settings.ProofIndependentSettings;
25+
import de.uka.ilkd.key.settings.ViewSettings;
2426

2527
import org.key_project.util.java.IOUtil;
2628

@@ -277,6 +279,15 @@ public void mouseClicked(MouseEvent e) {
277279
.setMaximumSize(new Dimension(Integer.MAX_VALUE, (int) buttonDim.getHeight() + 10));
278280
getContentPane().add(buttonPanel);
279281

282+
// create the checkbox to hide example load on next startup
283+
ViewSettings vs = ProofIndependentSettings.DEFAULT_INSTANCE.getViewSettings();
284+
JCheckBox showAgainCheckbox =
285+
new JCheckBox("Show this dialog on startup", vs.getShowLoadExamplesDialog());
286+
buttonPanel.add(showAgainCheckbox);
287+
showAgainCheckbox.addActionListener(e -> {
288+
vs.setShowLoadExamplesDialog(showAgainCheckbox.isSelected());
289+
});
290+
280291
// create "load" button
281292
loadButton = new JButton("Load Example");
282293
loadButton.addActionListener(e -> {
@@ -312,6 +323,7 @@ public void mouseClicked(MouseEvent e) {
312323
buttonPanel.add(cancelButton);
313324
GuiUtilities.attachClickOnEscListener(cancelButton);
314325

326+
315327
// select first example
316328
DefaultMutableTreeNode firstLeaf =
317329
((DefaultMutableTreeNode) model.getRoot()).getFirstLeaf();

0 commit comments

Comments
 (0)