From: gmungoc Date: Mon, 23 Apr 2018 08:41:59 +0000 (+0100) Subject: JAL-591 ensure slider hidden if text input field only X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=764241cc5bd3e94fbd8158ecbcf72361b3ce5829;p=jalview.git JAL-591 ensure slider hidden if text input field only --- diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index fcb293c..483ba3d 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -314,6 +314,8 @@ public class OptsAndParamsPage boolean isIntegerParameter; + boolean isStringParameter; + boolean adjusting; JComboBox choicebox; @@ -358,12 +360,14 @@ public class OptsAndParamsPage { ValueType type = validator.getType(); isIntegerParameter = type == ValueType.Integer; + isStringParameter = type == ValueType.String; /* * ensure slider has an integer range corresponding to * the min-max range of the parameter */ - if (validator.getMin() != null && !isIntegerParameter) + if (validator.getMin() != null && !isIntegerParameter + && !isStringParameter) { double min = validator.getMin().doubleValue(); double max = validator.getMax().doubleValue(); @@ -752,7 +756,7 @@ public class OptsAndParamsPage */ Object updateSliderFromValueField() { - if (validator == null) + if (validator == null || isStringParameter) { if (isChoiceParameter) {