mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Fix: Exception if type ESC for close confirmation.
If you type an Escape key if a close econfirmation dialog is prompted for unsaved file, an exception thrown. This behavior fixed.
This commit is contained in:
parent
2fde40f46a
commit
f183579eaa
@ -2043,16 +2043,15 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
JOptionPane.YES_NO_CANCEL_OPTION,
|
JOptionPane.YES_NO_CANCEL_OPTION,
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
|
|
||||||
if (result == JOptionPane.YES_OPTION) {
|
switch (result) {
|
||||||
|
case JOptionPane.YES_OPTION:
|
||||||
return handleSave(true);
|
return handleSave(true);
|
||||||
|
case JOptionPane.NO_OPTION:
|
||||||
} else if (result == JOptionPane.NO_OPTION) {
|
|
||||||
return true; // ok to continue
|
return true; // ok to continue
|
||||||
|
case JOptionPane.CANCEL_OPTION:
|
||||||
} else if (result == JOptionPane.CANCEL_OPTION) {
|
case JOptionPane.CLOSED_OPTION: // Escape key pressed
|
||||||
return false;
|
return false;
|
||||||
|
default:
|
||||||
} else {
|
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user