From c725e57e2907b4b9a8eb0dada6eccbf2e1cf0dde Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 23 Apr 2018 09:41:59 +0100 Subject: [PATCH] JAL-591 ensure slider hidden if text input field only --- src/jalview/gui/OptsAndParamsPage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) { -- 1.7.10.2