Distinguish text-only output formats and others (.jar/.jvp)
[jalview.git] / src / jalview / io / FileFormat.java
index a43bc22..d0ce86e 100644 (file)
@@ -218,7 +218,7 @@ public enum FileFormat implements FileFormatI
     }
 
   },
-  Pileup("PileUp", "pileup", false, true)
+  Pileup("PileUp", "pileup", true, true)
   {
     @Override
     public AlignmentFileI getAlignmentFile(String inFile,
@@ -329,7 +329,7 @@ public enum FileFormat implements FileFormatI
     }
 
   },
-  Features("GFF or Jalview features", "gff2,gff3", false, false)
+  Features("GFF or Jalview features", "gff2,gff3", true, false)
   {
     @Override
     public AlignmentFileI getAlignmentFile(String inFile,
@@ -351,7 +351,7 @@ public enum FileFormat implements FileFormatI
       return new FeaturesFile();
     }
   },
-  PDB("PDB", "", false, false)
+  PDB("PDB", "pdb,ent", true, false)
   {
 
     @Override
@@ -414,7 +414,7 @@ public enum FileFormat implements FileFormatI
       return new JmolParser(); // todo or null?
     }
   },
-  MMCif("mmCIF", "cif", false, false)
+  MMCif("mmCIF", "cif", true, false)
   {
 
     @Override
@@ -445,7 +445,7 @@ public enum FileFormat implements FileFormatI
       return new JmolParser(); // todo or null?
     }
   },
-  Jalview("Jalview", "jar,jvp", true, false)
+  Jalview("Jalview", "jar,jvp", true, true)
   {
 
     @Override
@@ -467,6 +467,12 @@ public enum FileFormat implements FileFormatI
     {
       return null;
     }
+
+    @Override
+    public boolean isTextFormat()
+    {
+      return false;
+    }
   };
 
   /**
@@ -496,12 +502,12 @@ public enum FileFormat implements FileFormatI
    * 
    * @return
    */
-  public static List<String> getWritableFormats()
+  public static List<String> getWritableFormats(boolean textOnly)
   {
     List<String> l = new ArrayList<String>();
     for (FileFormatI ff : values())
     {
-      if (ff.isWritable())
+      if (ff.isWritable() && (!textOnly || ff.isTextFormat()))
       {
         l.add(ff.toString());
       }
@@ -596,4 +602,10 @@ public enum FileFormat implements FileFormatI
   {
     return getAlignmentFile((AlignmentI) null);
   }
+
+  @Override
+  public boolean isTextFormat()
+  {
+    return true;
+  }
 }