JAL-2716 fix to reset choice parameter on Revert
[jalview.git] / src / jalview / gui / OptsAndParamsPage.java
index c09d729..4cac990 100644 (file)
@@ -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;