From 76290527ce60730c9df0b10046ae189e2d660880 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Wed, 11 Sep 2019 11:19:28 +0100 Subject: [PATCH] Change choice field to use dropbox instead of radio buttons. --- src/jalview/ws/slivkaws/SlivkaParamSet.java | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/jalview/ws/slivkaws/SlivkaParamSet.java b/src/jalview/ws/slivkaws/SlivkaParamSet.java index 86755cb..7a55832 100644 --- a/src/jalview/ws/slivkaws/SlivkaParamSet.java +++ b/src/jalview/ws/slivkaws/SlivkaParamSet.java @@ -5,7 +5,6 @@ import jalview.ws.params.WsParamSetI; import jalview.ws.params.simple.BooleanOption; import jalview.ws.params.simple.DoubleParameter; import jalview.ws.params.simple.IntegerParameter; -import jalview.ws.params.simple.RadioChoiceParameter; import jalview.ws.params.simple.StringParameter; import java.io.IOException; @@ -15,7 +14,6 @@ import java.util.List; import uk.ac.dundee.compbio.slivkaclient.BooleanField; import uk.ac.dundee.compbio.slivkaclient.ChoiceField; import uk.ac.dundee.compbio.slivkaclient.DecimalField; -import uk.ac.dundee.compbio.slivkaclient.Form; import uk.ac.dundee.compbio.slivkaclient.FormField; import uk.ac.dundee.compbio.slivkaclient.IntegerField; import uk.ac.dundee.compbio.slivkaclient.SlivkaForm; @@ -39,35 +37,38 @@ public class SlivkaParamSet implements WsParamSetI case BOOLEAN: BooleanField boolField = (BooleanField) field; arg = new BooleanOption( - field.getName(), field.getDescription(), field.isRequired(), boolField.getDefault(), - boolField.getDefault(), null + field.getName(), field.getDescription(), field.isRequired(), + boolField.getDefault(), boolField.getDefault(), null ); break; case TEXT: TextField textField = (TextField) field; arg = new StringParameter( - field.getName(), field.getDescription(), field.isRequired(), textField.getDefault(), - textField.getDefault() + field.getName(), field.getDescription(), field.isRequired(), + textField.getDefault(), textField.getDefault() ); break; case INTEGER: IntegerField intField = (IntegerField) field; arg = new IntegerParameter( - field.getName(), field.getDescription(), field.isRequired(), intField.getDefault(), - intField.getMin(), intField.getMax() + field.getName(), field.getDescription(), field.isRequired(), + intField.getDefault(), intField.getMin(), intField.getMax() ); break; case DECIMAL: DecimalField doubleField = (DecimalField) field; arg = new DoubleParameter( - field.getName(), field.getDescription(), field.isRequired(), doubleField.getDefault(), - doubleField.getMin(), doubleField.getMax() + field.getName(), field.getDescription(), field.isRequired(), + doubleField.getDefault(), doubleField.getMin(), + doubleField.getMax() ); break; case CHOICE: ChoiceField choiceField = (ChoiceField) field; - arg = new RadioChoiceParameter( - field.getName(), field.getDescription(), new ArrayList<>(choiceField.getChoices()), choiceField.getDefault() + List choices = new ArrayList<>(choiceField.getChoices()); + arg = new StringParameter(field.getName(), field.getDescription(), + field.isRequired(), choiceField.getDefault(), choices.get(0), + choices, choices ); break; case FILE: -- 1.7.10.2