1
0
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:
Shigeru KANEMOTO 2013-02-13 01:01:59 +09:00 committed by Federico Fissore
parent 2fde40f46a
commit f183579eaa

View File

@ -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();
} }