git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
983bf69
)
JAL-4460 In save as, set format from file extension if a multi-format file filter...
author
Ben Soares
<b.soares@dundee.ac.uk>
Wed, 11 Sep 2024 16:24:33 +0000
(17:24 +0100)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Wed, 11 Sep 2024 16:24:33 +0000
(17:24 +0100)
src/jalview/io/JalviewFileChooser.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/JalviewFileChooser.java
b/src/jalview/io/JalviewFileChooser.java
index
ee39458
..
9a0640c
100755
(executable)
--- a/
src/jalview/io/JalviewFileChooser.java
+++ b/
src/jalview/io/JalviewFileChooser.java
@@
-518,6
+518,18
@@
public class JalviewFileChooser extends JFileChooser
selectedFile = (new File(getCurrentDirectory(), withExtension));
setSelectedFile(selectedFile);
}
+ else if (jvf.isMultiFormat() && jvf.accept(selectedFile))
+ {
+ // if a multiFormat filter is selected, with an acceptable file
+ // extension, see if we can set the format from the file extension
+ for (FileFilter jff : this.getChoosableFileFilters())
+ {
+ if (jff.accept(selectedFile))
+ {
+ this.setFileFilter(jff);
+ }
+ }
+ }
}
if (selectedFile.exists())