- int confirmResponse = JvOptionPane.showOptionDialog(
- Desktop.instance, prompt, title,
- JvOptionPane.YES_NO_CANCEL_OPTION,
- JvOptionPane.WARNING_MESSAGE, null, buttonsText,
- cancelQuit);
+ int confirmResponse = -1;
+ if (alwaysCloseExternalViewers == null || "ask".equals(
+ alwaysCloseExternalViewers.toLowerCase(Locale.ROOT)))
+ {
+ confirmResponse = JvOptionPane.showOptionDialog(Desktop.instance,
+ prompt, title, JvOptionPane.YES_NO_CANCEL_OPTION,
+ JvOptionPane.WARNING_MESSAGE, null, buttonsText,
+ cancelQuit);
+ }
+ else
+ {
+ confirmResponse = Cache
+ .getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false)
+ ? JvOptionPane.YES_OPTION
+ : JvOptionPane.NO_OPTION;
+ }