application specific validIOformat method
authorjprocter <Jim Procter>
Tue, 4 Nov 2008 09:15:23 +0000 (09:15 +0000)
committerjprocter <Jim Procter>
Tue, 4 Nov 2008 09:15:23 +0000 (09:15 +0000)
src/jalview/io/FormatAdapter.java

index 17a5c68..6514e60 100755 (executable)
@@ -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);
+  }
 }