From efcc858be7c5023e58786f8117092b5879e573d7 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 12 Sep 2024 13:29:49 +0100 Subject: [PATCH] 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) --- src/jalview/io/JalviewFileChooser.java | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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) -- 1.7.10.2