Merge branch 'alpha/JAL-3362_Jalview_212_alpha' into alpha/merge_212_JalviewJS_2112
[jalview.git] / src / jalview / ws / params / simple / BooleanOption.java
index f80ff77..df17296 100644 (file)
  */
 package jalview.ws.params.simple;
 
-import jalview.ws.params.OptionI;
-
 import java.net.URL;
 import java.util.Arrays;
 
-public class BooleanOption extends Option implements OptionI
+public class BooleanOption extends Option
 {
 
   public BooleanOption(String name, String descr, boolean required,
-          boolean defVal, boolean val, URL link)
+      Boolean defVal, Boolean val, URL link)
   {
+    super(name, descr, required, (defVal != null && defVal ? name : null),
+        (val != null && val ? name : null), Arrays.asList(name), link);
+  }
 
-    super(name, descr, required, (defVal ? name : ""), (val ? name : ""),
-            Arrays.asList(new String[]
-            { name }), link);
+  public BooleanOption(String name, String description, String label,
+      boolean isrequired, Boolean defValue, String reprValue, URL link)
+  {
+    super(name, description, label, isrequired,
+        defValue != null && defValue ? reprValue : null,
+        defValue != null && defValue ? reprValue : null,
+        Arrays.asList(reprValue), link);
   }
 
+  public BooleanOption(String name, String description, String label,
+      boolean isrequired, Boolean defValue, URL link)
+  {
+    this(name, description, label, isrequired, defValue, String.valueOf(true), link);
+  }
 }