Merge branch 'develop' into releases/Release_2_11_3_Branch
[jalview.git] / src / jalview / gui / AnnotationExporter.java
index 894db79..a23496d 100644 (file)
@@ -163,6 +163,14 @@ public class AnnotationExporter extends JPanel
     frame.setTitle(MessageManager.getString("label.export_annotations"));
   }
 
+  public void setExportAsCSV()
+  {
+    if (CSVFormat != null)
+    {
+      CSVFormat.setSelected(true);
+    }
+  }
+
   private void toFile_actionPerformed()
   {
     // TODO: JAL-3048 JalviewFileChooser - Save option
@@ -202,7 +210,7 @@ public class AnnotationExporter extends JPanel
    * 
    * @return
    */
-  private String getText()
+  public String getText()
   {
     return exportFeatures ? getFeaturesText() : getAnnotationsText();
   }
@@ -213,12 +221,14 @@ public class AnnotationExporter extends JPanel
    * 
    * @return
    */
-  private String getAnnotationsText()
+  public String getAnnotationsText()
   {
     String text;
     if (CSVFormat.isSelected())
     {
-      text = new AnnotationFile().printCSVAnnotations(annotations);
+      text = new AnnotationFile().printCSVAnnotations(
+              wholeView ? ap.av.getAlignment().getAlignmentAnnotation()
+                      : annotations);
     }
     else
     {
@@ -241,7 +251,7 @@ public class AnnotationExporter extends JPanel
    * 
    * @return
    */
-  private String getFeaturesText()
+  public String getFeaturesText()
   {
     String text;
     SequenceI[] sequences = ap.av.getAlignment().getSequencesArray();