jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1717513 - in /jmeter/trunk: src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java xdocs/changes.xml
Date Tue, 01 Dec 2015 20:23:38 GMT
Author: pmouawad
Date: Tue Dec  1 20:23:38 2015
New Revision: 1717513

URL: http://svn.apache.org/viewvc?rev=1717513&view=rev
Log:
Bug 58675 - Module controller error message can easily be missed
Bugzilla Id: 58675

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java?rev=1717513&r1=1717512&r2=1717513&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java Tue
Dec  1 20:23:38 2015
@@ -18,9 +18,11 @@
 
 package org.apache.jmeter.control.gui;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
+import java.awt.Font;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.Collection;
@@ -35,6 +37,9 @@ import javax.swing.JMenu;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JTree;
+import javax.swing.SwingConstants;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeCellRenderer;
 import javax.swing.tree.DefaultTreeModel;
@@ -107,8 +112,22 @@ public class ModuleControllerGui extends
         moduleToRunTreeNodes = new JTree(moduleToRunTreeModel);
         moduleToRunTreeNodes.setCellRenderer(new ModuleControllerCellRenderer());
 
-        warningLabel = new JLabel(""); // $NON-NLS-1$
+        ImageIcon image = JMeterUtils.getImage("warning.png");
+        warningLabel = new JLabel("", image, SwingConstants.LEFT); // $NON-NLS-1$
+        warningLabel.setForeground(Color.RED);
+        Font font = warningLabel.getFont();
+        warningLabel.setFont(new Font(font.getFontName(), Font.BOLD, (int)(font.getSize()*1.1)));
+        warningLabel.setVisible(false);
+        
         init();
+        
+        TreeSelectionListener tsl = new TreeSelectionListener() {
+            @Override
+            public void valueChanged(TreeSelectionEvent e) {
+                warningLabel.setVisible(false);
+            }
+        };
+        moduleToRunTreeNodes.addTreeSelectionListener(tsl);
     }
 
     /** {@inheritDoc}} */
@@ -116,6 +135,7 @@ public class ModuleControllerGui extends
     public String getLabelResource() {
         return "module_controller_title"; // $NON-NLS-1$
     }
+    
     /** {@inheritDoc}} */
     @Override
     public void configure(TestElement el) {
@@ -125,8 +145,9 @@ public class ModuleControllerGui extends
         if (selected == null && controller.getNodePath() != null) {
             warningLabel.setText(JMeterUtils.getResString("module_controller_warning") //
$NON-NLS-1$
                     + renderPath(controller.getNodePath()));
+            warningLabel.setVisible(true);
         } else {
-            warningLabel.setText(""); // $NON-NLS-1$
+            warningLabel.setVisible(false);
         }
         reinitialize();
     }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1717513&r1=1717512&r2=1717513&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Dec  1 20:23:38 2015
@@ -101,6 +101,7 @@ Summary
 <ul>
     <li><bug>58406</bug>IfController : Allow use of Nashorn Engine if available
for JavaScript evaluation</li>
     <li><bug>58281</bug>RandomOrderController : Improve randomization algorithm
performance. Contributed by Graham Russell (jmeter at ham1.co.uk)</li> 
+    <li><bug>58675</bug>Module controller error message can easily be missed.
Contributed by Benoit Wiart (benoit.wiart at gmail.com)</li>
 </ul>
 
 <h3>Listeners</h3>
@@ -216,6 +217,7 @@ Summary
 <li>Samoht-fr (https://github.com/Samoht-fr)</li>
 <li>Graham Russell (jmeter at ham1.co.uk)</li>
 <li>Maxime Chassagneux (maxime.chassagneux at gmail.com)</li>
+<li>Benoit Wiart (benoit.wiart at gmail.com)</li>
 </ul>
 
 <br/>



Mime
View raw message