From 7f68870deed3116cee84b6fa5e637dde3957a3b2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 30 May 2018 12:09:51 +0100 Subject: [PATCH] JAL-3005 new argument type FileParameter for file chooser --- src/jalview/ws/params/ValueConstrainI.java | 2 +- src/jalview/ws/params/simple/FileParameter.java | 47 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/jalview/ws/params/simple/FileParameter.java 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; + } + }; + } + +} -- 1.7.10.2