From: Mateusz Warowny Date: Wed, 11 Sep 2019 10:19:28 +0000 (+0100) Subject: Change choice field to use dropbox instead of radio buttons. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=76290527ce60730c9df0b10046ae189e2d660880;p=jalview.git Change choice field to use dropbox instead of radio buttons. --- 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: