import jalview.datamodel.AlignmentI;
import jalview.io.FileFormat;
import jalview.io.FileFormatI;
+import jalview.io.FileFormats;
import jalview.io.FormatAdapter;
import jalview.ws.params.OptionI;
import jalview.ws.params.simple.BooleanOption;
if (tok.startsWith("format"))
{
- for (FileFormatI fmt : FileFormat.values())
+ for (FileFormatI fmt : FileFormats.getInstance().getFormats())
{
- if (fmt.isWritable() && val.equalsIgnoreCase(fmt.toString()))
+ if (fmt.isWritable() && val.equalsIgnoreCase(fmt.getName()))
{
format = fmt;
return true;
}
warnings.append("Invalid alignment format '" + val
+ "'. Must be one of (");
- for (FileFormatI fmt : FileFormat.values())
+ for (String fmt : FileFormats.getInstance().getWritableFormats(true))
{
- if (fmt.isWritable())
- {
- warnings.append(" " + fmt).toString();
- }
+ warnings.append(" ").append(fmt);
}
warnings.append(")\n");
}
"Append jalview style /start-end suffix to ID", false, false,
writeAsFile, null));
+ List<String> writable = FileFormats
+ .getInstance().getWritableFormats(true);
lst.add(new Option("format", "Alignment upload format", true,
- FileFormat.Fasta.toString(), format.toString(), getWritableFormats(),
+ FileFormat.Fasta.toString(), format.getName(), writable,
null));
lst.add(createMolTypeOption("type", "Sequence type", false, type, null));
return lst;
}
- /**
- * @return
- */
- protected List<String> getWritableFormats()
- {
- List<String> formats = new ArrayList<String>();
- for (FileFormatI ff : FileFormat.values())
- {
- if (ff.isWritable())
- {
- formats.add(ff.toString());
- }
- }
- return formats;
- }
-
}