- // a better hack which works instead
- JFrame dialogParent = new JFrame();
- dialogParent.setAlwaysOnTop(true);
+ 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))
+ {
+ FlatDesktop.setQuitHandler(response -> {
+ boolean confirmQuit = jalview.bin.Cache.getDefault(
+ jalview.gui.Desktop.CONFIRM_KEYBOARD_QUIT, true);
+ boolean canQuit = !confirmQuit;
+ int n;
+ if (confirmQuit)
+ {
+ // ensure Jalview window is brought to front for Quit confirmation
+ // window to be
+ // visible