We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fde40f commit f183579Copy full SHA for f183579
app/src/processing/app/Editor.java
@@ -2043,16 +2043,15 @@ protected boolean checkModified() {
2043
JOptionPane.YES_NO_CANCEL_OPTION,
2044
JOptionPane.QUESTION_MESSAGE);
2045
2046
- if (result == JOptionPane.YES_OPTION) {
+ switch (result) {
2047
+ case JOptionPane.YES_OPTION:
2048
return handleSave(true);
-
2049
- } else if (result == JOptionPane.NO_OPTION) {
+ case JOptionPane.NO_OPTION:
2050
return true; // ok to continue
2051
2052
- } else if (result == JOptionPane.CANCEL_OPTION) {
2053
- return false;
2054
2055
- } else {
+ case JOptionPane.CANCEL_OPTION:
+ case JOptionPane.CLOSED_OPTION: // Escape key pressed
+ return false;
+ default:
2056
throw new IllegalStateException();
2057
}
2058
0 commit comments