- confirmResponse = JvOptionPane.CANCEL_OPTION;
-
- if (QuitHandler.quitting())
- {
-
- Callable<Void> yesCall = () -> {
- Console.debug("YES");
- confirmResponse = JvOptionPane.YES_OPTION;
- return null;
- };
- Callable<Void> noCall = () -> {
- Console.debug("NO");
- confirmResponse = JvOptionPane.NO_OPTION;
- return null;
- };
- Callable<Void> cancelCall = () -> {
- Console.debug("CANCEL");
- confirmResponse = JvOptionPane.CANCEL_OPTION;
- return null;
- };
- Callable<Void>[] calls = new Callable[] { yesCall, noCall,
- cancelCall };
- String cancelQuit = MessageManager.getString("action.cancel_quit");
- String[] buttonsText = { MessageManager.getString("action.yes"),
- MessageManager.getString("action.no"), cancelQuit };
- JvOptionPane dialog = JvOptionPane.frameDialog(prompt,
- MessageManager.getString("label.close_viewer"),
- JvOptionPane.WARNING_MESSAGE, buttonsText, cancelQuit, calls,
- false);
- // wait for response
- ExecutorService executor = dialog.getExecutor();
- executor.shutdown();
- try
- {
- Console.debug("### executor.awaitTermination() starting");
- executor.awaitTermination(60, TimeUnit.SECONDS);
- Console.debug("### executor.awaitTermination() finished");
- } catch (InterruptedException e)
- {
- }
- }
- else
- {
- confirmResponse = JvOptionPane.showConfirmDialog(this, prompt,
- MessageManager.getString("label.close_viewer"),
- JvOptionPane.YES_NO_CANCEL_OPTION,
- JvOptionPane.WARNING_MESSAGE);
- }
+ int confirmResponse = JvOptionPane.CANCEL_OPTION;
+ confirmResponse = JvOptionPane.showConfirmDialog(this, prompt,
+ MessageManager.getString("label.close_viewer"),
+ JvOptionPane.YES_NO_CANCEL_OPTION,
+ JvOptionPane.WARNING_MESSAGE);