From: Ben Soares Date: Thu, 12 Sep 2024 12:29:49 +0000 (+0100) Subject: JAL-4460 Don't display the All-known-alignment-files format when a JalviewFileChoose... X-Git-Tag: Release_2_11_4_0~6^2~1^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=efcc858be7c5023e58786f8117092b5879e573d7;p=jalview.git JAL-4460 Don't display the All-known-alignment-files format when a JalviewFileChooser is made with acceptAny set to false (usually a Save-as dialog) --- diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index 9a0640c..e38c94e 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -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)