X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFormatAdapter.java;h=25e2fead225df2ea6cf010de36b8d29b4da66b52;hb=16342ec2ab61d371ee70f61ac0294f2716fab638;hp=17a5c6841134da0acfe58f7b5fd17d87b97d64bb;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index 17a5c68..25e2fea 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -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); + } }