Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various UI bugs #3216

Merged
merged 44 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
70b6b0d
Fix division by zero and NPE in proof tree search
FliegendeWurst Jul 22, 2023
8b266fe
Fix that navigation was active without proof
FliegendeWurst Jul 22, 2023
4406916
Fix test case generation dialog not centered
FliegendeWurst Jul 22, 2023
98b1475
Make sure UI is usable after any exception
FliegendeWurst Jul 22, 2023
322e225
Make sure UI is active after loading PO
FliegendeWurst Jul 22, 2023
a7bfac5
Make sure SMT dialog is centered
FliegendeWurst Jul 22, 2023
9b48e48
Center heatmap options dialog
FliegendeWurst Jul 22, 2023
ec24ae5
Make sure taclet load dialog is centered
FliegendeWurst Jul 22, 2023
0e9189b
Log all exceptions
FliegendeWurst Jul 22, 2023
d8d2990
Make sure taclet load dialog is centered 2.0
FliegendeWurst Jul 22, 2023
3d73e59
New UI testing facility
FliegendeWurst Jul 22, 2023
59a6703
Make sure proof caching button is active on time
FliegendeWurst Jul 22, 2023
3f8f088
Make sure proof caching dialog displays right goal
FliegendeWurst Jul 22, 2023
e7dcc14
Make sure proof file is recorded for non-Java proofs
FliegendeWurst Jul 22, 2023
84ed558
Ensure proof caching checks user lemmas
FliegendeWurst Jul 22, 2023
2945ec4
Test: ensure full exception stack trace is printed
FliegendeWurst Jul 22, 2023
af73403
Bug fix in selection history
FliegendeWurst Jul 22, 2023
bec7d6a
UI test: allow interaction with dockables
FliegendeWurst Jul 24, 2023
87339a9
Do not read settings if file does not exist
FliegendeWurst Jul 24, 2023
4cb61ce
Fix recent files not saving without ~/.key
FliegendeWurst Jul 24, 2023
f19d91c
Apply global font factor setting on startup
FliegendeWurst Jul 24, 2023
48d5da6
Fix filters applying on proof tree menu open
FliegendeWurst Jul 24, 2023
4a4e337
Restore proof tree expansion state after filtering
FliegendeWurst Jul 24, 2023
21ffd66
Optimize expansion state restore
FliegendeWurst Jul 24, 2023
200309b
UI test: also click menu items
FliegendeWurst Jul 24, 2023
9eb8437
Fix watchdog preventing JVM exit
FliegendeWurst Jul 25, 2023
04aee0c
Fix proof tree font update
FliegendeWurst Jul 25, 2023
e3153ea
Merge remote-tracking branch 'origin/KeY-2.12.0' into chaosMonkey
FliegendeWurst Jul 25, 2023
90c7632
Fix exceptions when abandoning a running prover
FliegendeWurst Jul 25, 2023
6279146
Fix UI deadlock
FliegendeWurst Jul 25, 2023
f391c20
Merge remote-tracking branch 'origin/KeY-2.12.0' into chaosMonkey
FliegendeWurst Jul 26, 2023
66f2d6c
Fix font factor issue in menu bar
FliegendeWurst Jul 26, 2023
9f8055c
Show errors in auto mode in issue dialog
FliegendeWurst Jul 26, 2023
4114738
Fix enabling actions on proof load
FliegendeWurst Jul 26, 2023
33703a7
Sort SMT solvers alphabetically
FliegendeWurst Jul 26, 2023
7f075dc
Make goal select/below actually do what they say
FliegendeWurst Jul 26, 2023
dc10b51
Extract examples when needed
FliegendeWurst Jul 26, 2023
fc02e43
Update email in license
FliegendeWurst Jul 26, 2023
bcd7472
Fix JML warning in example
FliegendeWurst Jul 27, 2023
562c29a
Merge remote-tracking branch 'origin/KeY-2.12.0' into chaosMonkey
FliegendeWurst Jul 27, 2023
614852f
Fix default LaF
FliegendeWurst Jul 27, 2023
6e6898d
Re-enable test for release branch
FliegendeWurst Jul 27, 2023
7fe3ebc
UI test: mark manual test as disabled
FliegendeWurst Jul 27, 2023
cbd6e0c
Merge remote-tracking branch 'origin/KeY-2.12.0' into chaosMonkey
FliegendeWurst Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.SwingUtil;

import bibliothek.gui.dock.common.action.CAction;
import org.slf4j.Logger;
Expand Down Expand Up @@ -678,6 +679,10 @@ public boolean setFilter(ProofTreeViewFilter filter, boolean selected) {
return false;
}

// Save expansion state to restore.
List<TreePath> rowsToExpand = new ArrayList<>(expansionState);


final TreePath branch;
final Node invokedNode;
if (selectedPath.getLastPathComponent() instanceof GUIProofTreeNode) {
Expand Down Expand Up @@ -741,6 +746,12 @@ public boolean setFilter(ProofTreeViewFilter filter, boolean selected) {
delegateView.setSelectionPath(tp);
}
}

// Expand previously visible rows.
for (TreePath tp : rowsToExpand) {
TreePath newTp = SwingUtil.findPathInNewTree(delegateView, tp);
delegateView.expandPath(newTp);
}
return true;
}

Expand Down
43 changes: 43 additions & 0 deletions key.ui/src/main/java/org/key_project/util/java/SwingUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;
import java.util.Set;
import javax.swing.*;
import javax.swing.tree.TreePath;

import bibliothek.gui.dock.themes.basic.BasicDockableDisplayer;

Expand Down Expand Up @@ -149,4 +150,46 @@ public static JScrollPane createScrollPane(JTable table) {

return scrollPane;
}

/**
* Try to find a tree path after updating the nodes of a {@link JTree}.
* This will compare nodes by their string representation.
*
* @param tree the tree to search
* @param tp the tree path
* @return a tree path or null
*/
public static TreePath findPathInNewTree(JTree tree, TreePath tp) {
TreePath root = tree.getPathForRow(0);
Object last = root.getLastPathComponent();
int pathIndex = 0;
if (!last.toString().equals(tp.getPathComponent(pathIndex).toString())) {
FliegendeWurst marked this conversation as resolved.
Show resolved Hide resolved
return null;
}
pathIndex++;
TreePath newPath = root;
if (tp.getPathCount() == 1) {
return newPath;
}
while (true) {
int c = tree.getModel().getChildCount(last);
boolean found = false;
for (int i = 0; i < c; i++) {
var child = tree.getModel().getChild(last, i);
if (child.toString().equals(tp.getPathComponent(pathIndex).toString())) {
last = child;
newPath = newPath.pathByAddingChild(last);
pathIndex++;
if (pathIndex == tp.getPathCount()) {
return newPath;
}
found = true;
break;
}
}
if (!found) {
return null;
}
}
}
}
Loading