From 9093578e20efffbf69396efb3a0de1104d144cea Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 4 Nov 2008 09:15:23 +0000 Subject: [PATCH] application specific validIOformat method --- src/jalview/io/FormatAdapter.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index 17a5c68..6514e60 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -212,4 +212,26 @@ public class FormatAdapter extends AppletFormatAdapter } return this.formatSequences(format, alignment, suffix); } + + /** + * validate format is valid for IO in Application. This is basically the + * AppletFormatAdapter.isValidFormat call with additional checks for + * Application only formats like 'Jalview'. + * + * @param format + * a format string to be compared with list of readable or writable formats (READABLE_FORMATS + * or WRITABLE_FORMATS) + * @param forwriting + * when true, format is checked against list of writable formats. + * @return true if format is valid + */ + public static final boolean isValidIOFormat(String format, + boolean forwriting) + { + if (format.equalsIgnoreCase("jalview")) + { + return true; + } + return AppletFormatAdapter.isValidFormat(format, forwriting); + } } -- 1.7.10.2