JAL-1648 fix to transfer focus back to alignment frame when Finder window is close...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 26 May 2017 11:35:43 +0000 (12:35 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 26 May 2017 11:35:43 +0000 (12:35 +0100)
src/jalview/gui/Finder.java

index a314cef..6bee7df 100755 (executable)
@@ -121,19 +121,11 @@ public class Finder extends GFinder
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        escapeActionPerformed();
+        closeAction();
       }
     });
   }
 
-  /**
-   * Close the panel on Escape key press
-   */
-  protected void escapeActionPerformed()
-  {
-    setVisible(false);
-    frame.dispose();
-  }
 
   /**
    * Performs the 'Find Next' action.
@@ -385,7 +377,12 @@ public class Finder extends GFinder
 
   protected void closeAction()
   {
+    frame.setVisible(false);
     frame.dispose();
     searchBox.persistCache();
+    if (getFocusedViewport())
+    {
+      ap.alignFrame.requestFocus();
+    }
   }
 }