JAL-3060 more extensive extract method refactoring of FeatureEditor
[jalview.git] / src / jalview / gui / Finder.java
index fd8eb0c..6361a86 100755 (executable)
@@ -205,11 +205,15 @@ public class Finder extends GFinder
 
   /**
    * Opens a dialog that allows the user to create sequence features for the
-   * find match results.
+   * find match results
    */
   @Override
   public void createFeatures_actionPerformed()
   {
+    if (searchResults.isEmpty())
+    {
+      return; // shouldn't happen
+    }
     List<SequenceI> seqs = new ArrayList<SequenceI>();
     List<SequenceFeature> features = new ArrayList<SequenceFeature>();
 
@@ -227,21 +231,7 @@ public class Finder extends GFinder
               match.getEnd(), desc));
     }
 
-    new FeatureEditor(ap).createFeatures(seqs, features, new Runnable()
-    {
-      @Override
-              public void run()
-              {
-
-                /*
-                 * ensure feature display is turned on to show the new features,
-                 * and remove them as highlighted regions
-                 */
-                ap.alignFrame.showSeqFeatures.setSelected(true);
-                av.setShowSequenceFeatures(true);
-                ap.highlightSearchResults(null);
-              }
-            });
+    new FeatureEditor(ap, seqs, features, true).showDialog();
   }
 
   /**