jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1812228 - in /jmeter/trunk: src/core/org/apache/jmeter/functions/gui/FunctionHelper.java xdocs/changes.xml
Date Sun, 15 Oct 2017 18:50:56 GMT
Author: pmouawad
Date: Sun Oct 15 18:50:56 2017
New Revision: 1812228

URL: http://svn.apache.org/viewvc?rev=1812228&view=rev
Log:
Bug 61619 - In Function Helper Dialog, the 1st function doesn't display default parameters
Bugzilla Id: 61619

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java?rev=1812228&r1=1812227&r2=1812228&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java Sun Oct 15 18:50:56
2017
@@ -143,14 +143,7 @@ public class FunctionHelper extends JDia
     @Override
     public void stateChanged(ChangeEvent event) {
         try {
-            Arguments args = new Arguments();
-            Function function = CompoundVariable.getFunctionClass(functionList.getText()).newInstance();
-            List<String> argumentDesc = function.getArgumentDesc();
-            for (String help : argumentDesc) {
-                args.addArgument(help, ""); //$NON-NLS-1$
-            }
-            parameterPanel.configure(args);
-            parameterPanel.revalidate();
+            initParameterPanel();
             getContentPane().remove(parameterPanel);
             this.pack();
             getContentPane().add(parameterPanel, BorderLayout.CENTER);
@@ -162,6 +155,21 @@ public class FunctionHelper extends JDia
         }
     }
 
+    /**
+     * @throws InstantiationException
+     * @throws IllegalAccessException
+     */
+    protected void initParameterPanel() throws InstantiationException, IllegalAccessException
{
+        Arguments args = new Arguments();
+        Function function = CompoundVariable.getFunctionClass(functionList.getText()).newInstance();
+        List<String> argumentDesc = function.getArgumentDesc();
+        for (String help : argumentDesc) {
+            args.addArgument(help, ""); //$NON-NLS-1$
+        }
+        parameterPanel.configure(args);
+        parameterPanel.revalidate();
+    }
+
     @Override
     public void actionPerformed(ActionEvent e) {
         StringBuilder functionCall = new StringBuilder("${");
@@ -209,4 +217,16 @@ public class FunctionHelper extends JDia
         this.getContentPane().removeAll(); // so we can add them again in init
         init();
     }
+    
+    @Override
+    public void setVisible(boolean visible) {
+        super.setVisible(visible);
+        if (visible) {
+            try {
+                initParameterPanel();
+            } catch (InstantiationException | IllegalAccessException ex) {
+                log.error("Error initializing parameter panel", ex);
+            }
+        }
+    }
 }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1812228&r1=1812227&r2=1812228&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Oct 15 18:50:56 2017
@@ -155,6 +155,7 @@ Summary
 <h3>Functions</h3>
 <ul>
     <li><bug>61588</bug>Better log message for RandomDate function</li>
+    <li><bug>61619</bug>In Function Helper Dialog, the 1st function doesn't
display default parameters</li>
 </ul>
 
 <h3>I18N</h3>



Mime
View raw message