Merge remote-tracking branch 'origin/tasks/JAL-3070_wsinterfaces' into alpha/JAL...
[jalview.git] / src / jalview / ws / params / AutoCalcSetting.java
index 55eeb50..68ec7a6 100644 (file)
@@ -26,7 +26,7 @@ import jalview.ws.api.ServiceWithParameters;
 import java.util.ArrayList;
 import java.util.List;
 
-public abstract class AutoCalcSetting
+public class AutoCalcSetting
 {
 
   protected boolean autoUpdate;
@@ -99,11 +99,37 @@ public abstract class AutoCalcSetting
   }
 
   /**
+   * default WsParamFile generator method - clients with custom formats should
+   * override and implement their own
    * 
    * @return stringified representation of the parameters for this setting
    */
-  public abstract String getWsParamFile();
-
+  public String getWsParamFile()
+  {
+    List<ArgumentI> opts = null;
+    if (jobArgset != null)
+    {
+      opts = jobArgset;
+    }
+    else
+    {
+      if (preset != null)
+      {
+        opts = preset.getArguments();
+      }
+    }
+    if (opts == null || opts.size() == 0)
+    {
+      return "";
+    }
+    StringBuffer pset = new StringBuffer();
+    for (ArgumentI ps : opts)
+    {
+      pset.append(ps.getName() + "\t" + ps.getValue());
+      pset.append("\n");
+    }
+    return pset.toString();
+  }
   public ServiceWithParameters getService()
   {
     return service;