JAL-2154 ignore all but the primary source resolved during programmatic invocation
authorJim Procter <jprocter@issues.jalview.org>
Sat, 13 Aug 2016 15:57:58 +0000 (16:57 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Sat, 13 Aug 2016 15:57:58 +0000 (16:57 +0100)
src/jalview/gui/SequenceFetcher.java

index a9df882..a875053 100755 (executable)
@@ -303,13 +303,21 @@ public class SequenceFetcher extends JPanel implements Runnable
     try
     {
       List<DbSourceProxy> sp = sfetch.getSourceProxy(selectedDb);
-      if (sp == null || sp.size() != 1)
+      for (DbSourceProxy sourcep : sp)
+      {
+        if (sourcep.getTier() == 0)
+        {
+          database.selection = Arrays
+                  .asList(new DbSourceProxy[] { sourcep });
+          break;
+        }
+      }
+      if (database.selection == null || database.selection.size() == 0)
       {
         System.err.println("Ignoring fetch parameter db='" + selectedDb
                 + "'");
         return false;
       }
-      database.selection = sp;
       textArea.setText(queryString);
     } catch (Exception q)
     {