From: gmungoc Date: Tue, 22 May 2018 16:06:10 +0000 (+0100) Subject: JAL-2716 fix to reset choice parameter on Revert X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ccebd462f3616f4c08cda443d246c0c7c0d54e00;p=jalview.git JAL-2716 fix to reset choice parameter on Revert --- diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index c09d729..4cac990 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -559,7 +559,7 @@ public class OptsAndParamsPage { if (adjusting) { - // return; + return; } if (!isChoiceParameter) { @@ -724,7 +724,6 @@ public class OptsAndParamsPage if (isChoiceParameter) { choicebox = buildComboBox(parm); - choicebox.setSelectedItem(parm.getValue()); choicebox.addActionListener(this); controlsPanel.add(choicebox, BorderLayout.CENTER); } @@ -757,9 +756,17 @@ public class OptsAndParamsPage } } - if (!isChoiceParameter && parm != null) + String value = parm.getValue(); + if (value != null) { - valueField.setText(parm.getValue()); + if (isChoiceParameter) + { + choicebox.setSelectedItem(value); + } + else + { + valueField.setText(value); + } } lastVal = updateSliderFromValueField(); adjusting = false;