From ccebd462f3616f4c08cda443d246c0c7c0d54e00 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 22 May 2018 17:06:10 +0100 Subject: [PATCH] JAL-2716 fix to reset choice parameter on Revert --- src/jalview/gui/OptsAndParamsPage.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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; -- 1.7.10.2