}
return null;
}
+ /**
+ * Unused - could delete ?
+ * @param format - matches and configures the filefilter according to given format
+ * @return true if the format given matched an available filter
+ */
+ public boolean setSelectedFormat(FileFormatI format)
+ {
+ if (format==null)
+ {
+ return false;
+ }
+ String toSelect = format.getName();
+ for (FileFilter available:getChoosableFileFilters())
+ {
+ if (available instanceof JalviewFileFilter)
+ {
+ if (((JalviewFileFilter)available).getDescription().equals(toSelect))
+ {
+ setFileFilter(available);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
@Override
public File getSelectedFile()
// extension, see if we can set the format from the file extension
for (FileFilter jff : this.getChoosableFileFilters())
{
- if (jff.accept(selectedFile))
+ if (jvf!=jff && jff.accept(selectedFile))
{
- this.setFileFilter(jff);
+ setFileFilter(jff);
+ return;
}
}
}