From dce53361c4b6bb56dc8567ac77e85a2300a5458d Mon Sep 17 00:00:00 2001 From: TZVanaalten Date: Mon, 28 Aug 2017 12:13:13 +0100 Subject: [PATCH] JAL-2629 add StringParameter --- src/jalview/ws/params/simple/StringParameter.java | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 src/jalview/ws/params/simple/StringParameter.java diff --git a/src/jalview/ws/params/simple/StringParameter.java b/src/jalview/ws/params/simple/StringParameter.java new file mode 100644 index 0000000..1d6a37e --- /dev/null +++ b/src/jalview/ws/params/simple/StringParameter.java @@ -0,0 +1,118 @@ +package jalview.ws.params.simple; + +import jalview.ws.params.ParameterI; +import jalview.ws.params.ValueConstrainI; + +import java.net.URL; +import java.util.List; + +public class StringParameter extends Option implements ParameterI +{ + + @Override + public URL getFurtherDetails() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isRequired() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getDescription() + { + // TODO Auto-generated method stub + return description; + } + + @Override + public List getPossibleValues() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getName() + { + // TODO Auto-generated method stub + return name; + } + + @Override + public String getValue() + { + // TODO Auto-generated method stub + return value; + } + + @Override + public void setValue(String selectedItem) + { + value = selectedItem; + + } + + @Override + public ValueConstrainI getValidValue() + { + // TODO Auto-generated method stub + return new StringValueConstrain(); + } + + @Override + public ParameterI copy() + { + return new StringParameter(this); + } + + private class StringValueConstrain implements ValueConstrainI + { + + @Override + public ValueType getType() + { + return ValueType.String; + } + + @Override + public Number getMax() + { + return null; + } + + @Override + public Number getMin() + { + return null; + } + + } + + public StringParameter(StringParameter parm) + { + this.name = parm.name; + this.defvalue = parm.defvalue; + } + + public StringParameter(String name, String description, boolean required, + String defValue) + { + super(name, description, required, String.valueOf(defValue), null, null, + null); + this.defvalue = defValue; + } + + public StringParameter(String name, String description, boolean required, + String defValue, String value) + { + super(name, description, required, String.valueOf(defValue), + String.valueOf(value), null, null); + this.defvalue = defValue; + } +} -- 1.7.10.2