JAL-1354 replacement of bare strings in GUI dialogs with i18n bundle lookup via jalvi...
[jalview.git] / src / jalview / gui / OptsAndParamsPage.java
index eab240f..eb55994 100644 (file)
@@ -109,7 +109,7 @@ public class OptsAndParamsPage
 
         enabled.setToolTipText("<html>"
                 + JvSwingUtils
-                        .wrapTooltip(((desc == null) ? "see further details by right-clicking"
+                        .wrapTooltip(((desc == null || desc.trim().length()==0) ? "see further details by right-clicking"
                                 : desc)
                                 + "<br><img src=\"" + linkImageURL + "\"/>")
                 + "</html>");
@@ -117,7 +117,7 @@ public class OptsAndParamsPage
       }
       else
       {
-        if (desc != null)
+        if (desc != null && desc.trim().length()>0)
         {
           enabled.setToolTipText("<html>"
                   + JvSwingUtils.wrapTooltip(opt.getDescription())
@@ -235,10 +235,11 @@ public class OptsAndParamsPage
 
     }
 
-    public void resetToDefault()
+
+    public void resetToDefault(boolean setDefaultParams)
     {
       enabled.setSelected(false);
-      if (option.isRequired())
+      if (option.isRequired() || (setDefaultParams && option.getValue()!=null))
       {
         // Apply default value
         selectOption(option, option.getValue());
@@ -258,7 +259,7 @@ public class OptsAndParamsPage
         initVal = (initEnabled) ? (String) val.getSelectedItem() : null;
       }
     }
-
+    
   }
 
   public class ParamBox extends JPanel implements ChangeListener,
@@ -783,9 +784,9 @@ public class OptsAndParamsPage
 
   URL linkImageURL = getClass().getResource("/images/link.gif");
 
-  Map<String, OptionBox> optSet = new Hashtable<String, OptionBox>();
+  Map<String, OptionBox> optSet = new java.util.LinkedHashMap<String, OptionBox>();
 
-  Map<String, ParamBox> paramSet = new Hashtable<String, ParamBox>();
+  Map<String, ParamBox> paramSet = new java.util.LinkedHashMap<String, ParamBox>();
 
   public Map<String, OptionBox> getOptSet()
   {