JAL-4262 Dialog for GUI and WARN for CLI of old style arguments, or mixed arguments...
[jalview.git] / src / jalview / gui / JvOptionPane.java
index 5b926c3..3f5de0a 100644 (file)
@@ -722,7 +722,8 @@ public class JvOptionPane extends JOptionPane
 
   private static void outputMessage(Object message)
   {
-    jalview.bin.Console.outPrintln(">>> JOption Message : " + message.toString());
+    jalview.bin.Console
+            .outPrintln(">>> JOption Message : " + message.toString());
   }
 
   public static Object getMockResponse()
@@ -1264,6 +1265,17 @@ public class JvOptionPane extends JOptionPane
           int JOPTIONPANE_MESSAGETYPE, Icon icon, Object[] options,
           Object initialValue, boolean modal, JButton[] buttons)
   {
+    showDialogOnTopAsync(dialogParent, label, actionString,
+            JOPTIONPANE_OPTION, JOPTIONPANE_MESSAGETYPE, icon, options,
+            initialValue, modal, buttons, true);
+  }
+
+  public void showDialogOnTopAsync(JFrame dialogParent, Object label,
+          String actionString, int JOPTIONPANE_OPTION,
+          int JOPTIONPANE_MESSAGETYPE, Icon icon, Object[] options,
+          Object initialValue, boolean modal, JButton[] buttons,
+          boolean dispose)
+  {
     if (!isInteractiveMode())
     {
       handleResponse(getMockResponse());
@@ -1285,8 +1297,11 @@ public class JvOptionPane extends JOptionPane
             JOPTIONPANE_MESSAGETYPE, icon, options, initialValue, modal,
             buttons);
 
-    dialogParent.setAlwaysOnTop(false);
-    dialogParent.dispose();
+    if (dispose)
+    {
+      dialogParent.setAlwaysOnTop(false);
+      dialogParent.dispose();
+    }
   }
 
   /**