JAL-4460 Don't display the All-known-alignment-files format when a JalviewFileChoose... bug/JAL-4460_alignment_save_as_format_not_registering
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 12 Sep 2024 12:29:49 +0000 (13:29 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 12 Sep 2024 12:29:49 +0000 (13:29 +0100)
src/jalview/io/JalviewFileChooser.java

index 9a0640c..e38c94e 100755 (executable)
@@ -280,17 +280,21 @@ public class JalviewFileChooser extends JFileChooser
         }
       }
     }
-    allExtensions.sort(null);
-    JalviewFileFilter alljvf = new JalviewFileFilter(
-            allExtensions.toArray(new String[] {}),
-            MessageManager.getString("label.all_known_alignment_files"));
-    alljvf.setMultiFormat(true);
-    alljvf.setExtensionListInDescription(false);
-    addChoosableFileFilter(alljvf);
-
-    if (selected == null)
+
+    if (acceptAny)
     {
-      chosen = alljvf;
+      allExtensions.sort(null);
+      JalviewFileFilter alljvf = new JalviewFileFilter(
+              allExtensions.toArray(new String[] {}),
+              MessageManager.getString("label.all_known_alignment_files"));
+      alljvf.setMultiFormat(true);
+      alljvf.setExtensionListInDescription(false);
+      addChoosableFileFilter(alljvf);
+
+      if (selected == null)
+      {
+        chosen = alljvf;
+      }
     }
 
     for (String[] format : formats)