From: gmungoc Date: Wed, 30 May 2018 11:09:51 +0000 (+0100) Subject: JAL-3005 new argument type FileParameter for file chooser X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7f68870deed3116cee84b6fa5e637dde3957a3b2;p=jalview.git JAL-3005 new argument type FileParameter for file chooser --- diff --git a/src/jalview/ws/params/ValueConstrainI.java b/src/jalview/ws/params/ValueConstrainI.java index 47f454a..d1bdc98 100644 --- a/src/jalview/ws/params/ValueConstrainI.java +++ b/src/jalview/ws/params/ValueConstrainI.java @@ -29,7 +29,7 @@ public interface ValueConstrainI public enum ValueType { - Integer, Float, String, Double + Integer, Float, String, Double, File }; ValueType getType(); diff --git a/src/jalview/ws/params/simple/FileParameter.java b/src/jalview/ws/params/simple/FileParameter.java new file mode 100644 index 0000000..aa8e7ad --- /dev/null +++ b/src/jalview/ws/params/simple/FileParameter.java @@ -0,0 +1,47 @@ +package jalview.ws.params.simple; + +import jalview.ws.params.ValueConstrainI; + +/** + * A class that represents a file parameter. User entry options should include + * direct input of a file path as text, or file selection using a file browser. + * + * @author gmcarstairs + * + */ +public class FileParameter extends StringParameter +{ + + public FileParameter(String name, String description, boolean required, + String defValue, String value) + { + super(name, description, required, defValue, value); + } + + @Override + public ValueConstrainI getValidValue() + { + return new ValueConstrainI() + { + + @Override + public ValueType getType() + { + return ValueType.File; + } + + @Override + public Number getMax() + { + return null; + } + + @Override + public Number getMin() + { + return null; + } + }; + } + +}