import jalview.bin.Cache;
import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.FileFormatI;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import jalview.jbgui.GPreferences;
@Override
public void startupFileTextfield_mouseClicked()
{
- JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] {
- "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc",
- "jar" }, new String[] { "Fasta", "Clustal", "PFAM", "MSF",
- "PIR", "BLC", "Jalview" },
- jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
+ String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
+ JalviewFileChooser chooser = JalviewFileChooser.forRead(
+ Cache.getProperty("LAST_DIRECTORY"), fileFormat, true);
+ // new String[] {
+ // "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc",
+ // "jar" }, new String[] { "Fasta", "Clustal", "PFAM", "MSF",
+ // "PIR", "BLC", "Jalview" },
+ // fileFormat);
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.select_startup_file"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
- jalview.bin.Cache.applicationProperties.setProperty(
- "DEFAULT_FILE_FORMAT", chooser.getSelectedFormat());
+ FileFormatI format = chooser.getSelectedFormat();
+ if (format != null)
+ {
+ Cache.applicationProperties.setProperty("DEFAULT_FILE_FORMAT",
+ format.toString());
+ }
startupFileTextfield.setText(chooser.getSelectedFile()
.getAbsolutePath());
}