jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1239739 - in /jmeter/trunk/src/core/org/apache/jmeter: functions/gui/FunctionHelper.java gui/action/CreateFunctionDialog.java
Date Thu, 02 Feb 2012 17:31:44 GMT
Author: sebb
Date: Thu Feb  2 17:31:44 2012
New Revision: 1239739

URL: http://svn.apache.org/viewvc?rev=1239739&view=rev
Log:
Bug 52551 - Function Helper Dialog does not switch language correctly
Rework to avoid recreating FunctionHelper, as this causes failures when testing under Eclipse:

org.apache.jmeter.timers.JSR223Timer - pt - BR(org.apache.jmeter.testbeans.gui.PackageTest)java.lang.InternalError:
Not enough storage is available to process this command.
     [java] 	at sun.awt.windows.WToolkit.eventLoop(Native Method)
     [java] 	at sun.awt.windows.WToolkit.run(WToolkit.java:269)
     [java] 	at java.lang.Thread.run(Thread.java:595)

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/functions/gui/FunctionHelper.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java

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=1239739&r1=1239738&r2=1239739&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 Thu Feb  2 17:31:44
2012
@@ -42,12 +42,14 @@ import org.apache.jmeter.gui.action.Acti
 import org.apache.jmeter.gui.action.Help;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jmeter.util.LocaleChangeEvent;
+import org.apache.jmeter.util.LocaleChangeListener;
 import org.apache.jorphan.gui.ComponentUtil;
 import org.apache.jorphan.gui.JLabeledChoice;
 import org.apache.jorphan.gui.JLabeledTextField;
 import org.apache.jorphan.reflect.ClassFinder;
 
-public class FunctionHelper extends JDialog implements ActionListener, ChangeListener {
+public class FunctionHelper extends JDialog implements ActionListener, ChangeListener, LocaleChangeListener
{
     private static final long serialVersionUID = 240L;
 
     private JLabeledChoice functionList;
@@ -64,6 +66,7 @@ public class FunctionHelper extends JDia
     public FunctionHelper() {
         super((JFrame) null, JMeterUtils.getResString("function_helper_title"), false); //$NON-NLS-1$
         init();
+        JMeterUtils.addLocaleChangeListener(this);
     }
 
     private void init() {
@@ -159,4 +162,10 @@ public class FunctionHelper extends JDia
             ActionRouter.getInstance().actionPerformed(helpEvent);
         }
     }
+
+    public void localeChanged(LocaleChangeEvent event) {
+        setTitle(JMeterUtils.getResString("function_helper_title"));
+        this.getContentPane().removeAll(); // so we can add them again in init
+        init();
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java?rev=1239739&r1=1239738&r2=1239739&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java Thu Feb 
2 17:31:44 2012
@@ -23,12 +23,9 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.jmeter.functions.gui.FunctionHelper;
-import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jmeter.util.LocaleChangeEvent;
-import org.apache.jmeter.util.LocaleChangeListener;
 
-public class CreateFunctionDialog extends AbstractAction implements LocaleChangeListener
{
-    private FunctionHelper helper = null;
+public class CreateFunctionDialog extends AbstractAction {
+    private final FunctionHelper helper;
 
     private static final Set<String> commands;
     static {
@@ -37,7 +34,6 @@ public class CreateFunctionDialog extend
     }
 
     public CreateFunctionDialog() {
-        JMeterUtils.addLocaleChangeListener(this);
         helper = new FunctionHelper();
     }
 
@@ -53,11 +49,4 @@ public class CreateFunctionDialog extend
     public void doAction(ActionEvent arg0) {
         helper.setVisible(true);
     }
-
-    /**
-     * {@inheritDoc}}
-     */
-    public void localeChanged(LocaleChangeEvent event) {
-        helper = new FunctionHelper();
-    }
 }



Mime
View raw message