Merge lp:~tapaal-contributor/tapaal/manual-edit-error-messages into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1138
Merged at revision: 1143
Proposed branch: lp:~tapaal-contributor/tapaal/manual-edit-error-messages
Merge into: lp:tapaal
Diff against target: 51 lines (+16/-4)
1 file modified
src/pipe/gui/widgets/QueryDialog.java (+16/-4)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/manual-edit-error-messages
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+407311@code.launchpad.net

Commit message

The error found during parsing manually edited queries is shown to the user

To post a comment you must log in.
1138. By <email address hidden>

fixed spacing between "placeswere used"

Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/pipe/gui/widgets/QueryDialog.java'
--- src/pipe/gui/widgets/QueryDialog.java 2021-08-12 08:28:49 +0000
+++ src/pipe/gui/widgets/QueryDialog.java 2021-09-11 17:12:22 +0000
@@ -2293,15 +2293,28 @@
2293 TCTLAbstractProperty newQuery = null;2293 TCTLAbstractProperty newQuery = null;
22942294
2295 try {2295 try {
2296 if (lens.isTimed()) {2296 if (queryField.getText().trim().equals("<*>")) {
2297 int choice = JOptionPane.showConfirmDialog(
2298 CreateGui.getApp(),
2299 "It is not possible to parse an empty query.\nThe specified query has not been saved. Do you want to edit it again?",
2300 "Error Parsing Query",
2301 JOptionPane.YES_NO_OPTION,
2302 JOptionPane.ERROR_MESSAGE);
2303 if (choice == JOptionPane.NO_OPTION)
2304 returnFromManualEdit(null);
2305 else
2306 return;
2307 } else if (lens.isTimed()) {
2297 newQuery = TAPAALQueryParser.parse(queryField.getText());2308 newQuery = TAPAALQueryParser.parse(queryField.getText());
2298 } else {2309 } else {
2299 newQuery = TAPAALCTLQueryParser.parse(queryField.getText());2310 newQuery = TAPAALCTLQueryParser.parse(queryField.getText());
2300 }2311 }
2301 } catch (Throwable ex) {2312 } catch (Throwable ex) {
2313 String message = ex.getMessage() == null ? "TAPAAL encountered an error while trying to parse the specified query\n" :
2314 "TAPAAL encountered the following error while trying to parse the specified query:\n\n"+ex.getMessage();
2302 int choice = JOptionPane.showConfirmDialog(2315 int choice = JOptionPane.showConfirmDialog(
2303 CreateGui.getApp(),2316 CreateGui.getApp(),
2304 "TAPAAL encountered an error trying to parse the specified query.\n\nWe recommend using the query construction buttons unless you are an experienced user.\n\n The specified query has not been saved. Do you want to edit it again?",2317 message+"\nWe recommend using the query construction buttons unless you are an experienced user.\n\n The specified query has not been saved. Do you want to edit it again?",
2305 "Error Parsing Query",2318 "Error Parsing Query",
2306 JOptionPane.YES_NO_OPTION,2319 JOptionPane.YES_NO_OPTION,
2307 JOptionPane.ERROR_MESSAGE);2320 JOptionPane.ERROR_MESSAGE);
@@ -2309,7 +2322,6 @@
2309 returnFromManualEdit(null);2322 returnFromManualEdit(null);
2310 else2323 else
2311 return;2324 return;
2312
2313 }2325 }
23142326
2315 if (newQuery != null) // new query parsed successfully2327 if (newQuery != null) // new query parsed successfully
@@ -2343,7 +2355,7 @@
2343 if (isResultFalse) {2355 if (isResultFalse) {
2344 StringBuilder s = new StringBuilder();2356 StringBuilder s = new StringBuilder();
2345 s.append("The following places" + (lens.isTimed() ? "" : " or transitions") +2357 s.append("The following places" + (lens.isTimed() ? "" : " or transitions") +
2346 "were used in the query, but are not present in your model:\n\n");2358 " were used in the query, but are not present in your model:\n\n");
23472359
2348 for (String placeName : c.getIncorrectPlaceNames()) {2360 for (String placeName : c.getIncorrectPlaceNames()) {
2349 s.append(placeName);2361 s.append(placeName);

Subscribers

People subscribed via source and target branches