JAL-3048 add additional wrapper methods for JOptionPane to ensure JvOptionPane tests...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 18 Jul 2018 16:21:52 +0000 (17:21 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 18 Jul 2018 16:21:52 +0000 (17:21 +0100)
src/jalview/gui/JvOptionPane.java

index 89899e2..3a5e0f7 100644 (file)
@@ -482,6 +482,25 @@ public class JvOptionPane extends JOptionPane
   }
 
   /**
+   * adds inital selection value
+   * 
+   * @param message
+   * @param initialSelectionValue
+   * @return
+   */
+  public static String showInputDialog(Object message,
+          Object initialSelectionValue)
+  {
+    if (!isInteractiveMode())
+    {
+      return getMockResponse().toString();
+    }
+
+    // AnnotationPanel character option
+
+    return JOptionPane.showInputDialog(message, initialSelectionValue);
+  }
+  /**
    * centered on parent
    * 
    * @param parentComponent
@@ -518,6 +537,27 @@ public class JvOptionPane extends JOptionPane
                     initialSelectionValue)
             : getMockResponse().toString();
   }
+  
+
+  /**
+   * input with initial selection
+   * 
+   * @param parentComponent
+   * @param message
+   * @param initialSelectionValue
+   * @return
+   */
+  public static String showInputDialog(Component parentComponent,
+          Object message, Object initialSelectionValue)
+  {
+    
+    // AnnotationPanel
+    
+    return isInteractiveMode()
+            ? JOptionPane.showInputDialog(parentComponent, message,
+                    initialSelectionValue)
+            : getMockResponse().toString();
+  }
 
   /**
    *