jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1646980 - in /jmeter/trunk/src/core/org/apache/jmeter: JMeter.java gui/action/LookAndFeelCommand.java
Date Sat, 20 Dec 2014 13:52:25 GMT
Author: pmouawad
Date: Sat Dec 20 13:52:24 2014
New Revision: 1646980

URL: http://svn.apache.org/r1646980
Log:
Bug 57365 - Selected LAF is not correctly setup due to call of UIManager.setLookAndFeel too
late 
Fix test failure
Bugzilla Id: 57365

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java?rev=1646980&r1=1646979&r2=1646980&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/JMeter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/JMeter.java Sat Dec 20 13:52:24 2014
@@ -101,15 +101,6 @@ import com.thoughtworks.xstream.converte
 public class JMeter implements JMeterPlugin {
     private static final Logger log = LoggingManager.getLoggerForClass();
     
-    static {
-        String jMeterLaf = LookAndFeelCommand.getJMeterLaf();
-        try {
-            UIManager.setLookAndFeel(jMeterLaf);
-        } catch (Exception ex) {
-            log.warn("Could not set LAF to:"+jMeterLaf, ex);
-        }
-    }
-
     public static final int UDP_PORT_DEFAULT = 4445; // needed for ShutdownClient
 
     public static final String HTTP_PROXY_PASS = "http.proxyPass"; // $NON-NLS-1$
@@ -234,8 +225,15 @@ public class JMeter implements JMeterPlu
      * Starts up JMeter in GUI mode
      */
     private void startGui(String testFile) {
+        String jMeterLaf = LookAndFeelCommand.getJMeterLaf();
+        try {
+            UIManager.setLookAndFeel(jMeterLaf);
+        } catch (Exception ex) {
+            log.warn("Could not set LAF to:"+jMeterLaf, ex);
+        }
 
         PluginManager.install(this, true);
+
         JMeterTreeModel treeModel = new JMeterTreeModel();
         JMeterTreeListener treeLis = new JMeterTreeListener(treeModel);
         treeLis.setActionHandler(ActionRouter.getInstance());

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java?rev=1646980&r1=1646979&r2=1646980&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java Sat Dec 20
13:52:24 2014
@@ -30,7 +30,6 @@ import java.util.prefs.Preferences;
 
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
 
 import org.apache.jmeter.gui.util.JMeterMenuBar;
 import org.apache.jmeter.util.JMeterUtils;
@@ -59,26 +58,19 @@ public class LookAndFeelCommand implemen
         for (int i = 0; i < lfs.length; i++) {
             commands.add(ActionNames.LAF_PREFIX + lfs[i].getClassName());
         }
-        try {
-            String jMeterLaf = getJMeterLaf();
-            UIManager.setLookAndFeel(jMeterLaf);
-            if (log.isInfoEnabled()) {
-                ArrayList<String> names=new ArrayList<String>();
-                for(UIManager.LookAndFeelInfo laf : lfs) {
-                    if (laf.getClassName().equals(jMeterLaf)) {
-                        names.add(laf.getName());
-                    }
-                }
-                if (names.size() > 0) {
-                    log.info("Using look and feel: "+jMeterLaf+ " " +names.toString());
-                } else {
-                    log.info("Using look and feel: "+jMeterLaf);
+        String jMeterLaf = getJMeterLaf();
+        if (log.isInfoEnabled()) {
+            ArrayList<String> names=new ArrayList<String>();
+            for(UIManager.LookAndFeelInfo laf : lfs) {
+                if (laf.getClassName().equals(jMeterLaf)) {
+                    names.add(laf.getName());
                 }
             }
-        } catch (IllegalAccessException e) {
-        } catch (ClassNotFoundException e) {
-        } catch (InstantiationException e) {
-        } catch (UnsupportedLookAndFeelException e) {
+            if (names.size() > 0) {
+                log.info("Using look and feel: "+jMeterLaf+ " " +names.toString());
+            } else {
+                log.info("Using look and feel: "+jMeterLaf);
+            }
         }
     }
 



Mime
View raw message