JAL-3038 add ActionListener and FocusListener to SwingJS mode
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 29 Oct 2018 15:02:39 +0000 (15:02 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 29 Oct 2018 15:02:39 +0000 (15:02 +0000)
src/jalview/io/cache/JvCacheableInputBox.java

index d2ad8de..b1b7ac5 100644 (file)
@@ -306,7 +306,11 @@ public class JvCacheableInputBox<E>
 
   public void addActionListener(ActionListener actionListener)
   {
-    if (!Jalview.isJS())
+    if (Jalview.isJS())
+    {
+      textField.addActionListener(actionListener);
+    }
+    else
     {
       comboBox.addActionListener(actionListener);
     }
@@ -323,7 +327,11 @@ public class JvCacheableInputBox<E>
 
   public void addFocusListener(FocusListener focusListener)
   {
-    if (!Jalview.isJS())
+    if (Jalview.isJS())
+    {
+      textField.addFocusListener(focusListener);
+    }
+    else
     {
       comboBox.addFocusListener(focusListener);
     }