- n = JOptionPane.showConfirmDialog(dialogParent,
- MessageManager.getString("label.quit_jalview"),
- MessageManager.getString("action.quit"),
- JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
- null);
-
- dialogParent.setAlwaysOnTop(false);
- dialogParent.dispose();
- }
- else
- {
- n = JOptionPane.OK_OPTION;
- }
- canQuit = (n == JOptionPane.OK_OPTION);
- if (canQuit)
- {
- response.performQuit();
- }
- else
- {
- response.cancelQuit();
- }
- });
+ public static boolean setAPQHandlers(GDesktop desktop)
+ {
+ if (Platform.isJS())
+ {
+ return false;
+ }
+ if (FlatDesktop.isSupported(Action.APP_ABOUT))
+ {
+ FlatDesktop.setAboutHandler(() -> {
+ desktop.aboutMenuItem_actionPerformed(null);
+ });
+ setAbout = true;
+ }
+ if (FlatDesktop.isSupported(Action.APP_PREFERENCES))
+ {
+ FlatDesktop.setPreferencesHandler(() -> {
+ desktop.preferences_actionPerformed(null);
+ });
+ setPreferences = true;
+ }
+ if (FlatDesktop.isSupported(Action.APP_QUIT_HANDLER))
+ {
+ QuitHandler.setQuitHandler();
+ setQuit = true;
+ }