jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1818942 - in /jmeter/trunk/src/core/org/apache/jmeter: gui/util/MenuFactory.java threads/gui/AbstractThreadGroupGui.java
Date Thu, 21 Dec 2017 15:31:54 GMT
Author: pmouawad
Date: Thu Dec 21 15:31:54 2017
New Revision: 1818942

URL: http://svn.apache.org/viewvc?rev=1818942&view=rev
Log:
Bug 61919 - UX : Reorder Menus
Fix regressions : 
Unable to add Controllers to Thread Group
Unable to add Controllers to Controllers
Bugzilla Id: 61919

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java?rev=1818942&r1=1818941&r2=1818942&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java Thu Dec 21 15:31:54
2017
@@ -148,9 +148,9 @@ public final class MenuFactory {
                     log.debug("{} participates in no menus.", className);
                     continue;
                 }
-                for (String key: menus.keySet()) {
-                    if (categories.contains(key)) {
-                        menus.get(key).add(new MenuInfo(item, className));
+                for (Map.Entry<String, List<MenuInfo>> entry: menus.entrySet())
{
+                    if (categories.contains(entry.getKey())) {
+                        entry.getValue().add(new MenuInfo(item, className));
                     }
                 }
             }
@@ -315,7 +315,13 @@ public final class MenuFactory {
 
     public static JPopupMenu getDefaultControllerMenu() {
         JPopupMenu pop = new JPopupMenu();
-        pop.add(createDefaultAddMenu());
+        String addAction = ActionNames.ADD;
+        JMenu addMenu = new JMenu(JMeterUtils.getResString("add")); // $NON-NLS-1$
+        addMenu.add(MenuFactory.makeMenu(MenuFactory.SAMPLERS, addAction));
+        addMenu.addSeparator();
+        addMenu.add(MenuFactory.makeMenu(MenuFactory.CONTROLLERS, addAction));
+        addMenu.addSeparator();
+        pop.add(addDefaultAddMenuToMenu(addMenu, addAction));
         pop.add(MenuFactory.makeMenuItemRes("add_think_times",// $NON-NLS-1$
                 ActionNames.ADD_THINK_TIME_BETWEEN_EACH_STEP));
 
@@ -337,6 +343,11 @@ public final class MenuFactory {
     private static JMenu createDefaultAddMenu() {
         String addAction = ActionNames.ADD;
         JMenu addMenu = new JMenu(JMeterUtils.getResString("add")); // $NON-NLS-1$
+        addDefaultAddMenuToMenu(addMenu, addAction);
+        return addMenu;
+    }
+    
+    private static JMenu addDefaultAddMenuToMenu(JMenu addMenu, String addAction) {
         addMenu.add(MenuFactory.makeMenu(MenuFactory.ASSERTIONS, addAction));
         addMenu.addSeparator();
         addMenu.add(MenuFactory.makeMenu(MenuFactory.TIMERS, addAction));
@@ -513,12 +524,6 @@ public final class MenuFactory {
         item.setAccelerator(accel);
         return item;
     }
-
-    private static JMenuItem makeMenuItem(String label, String name, String actionCommand,
KeyStroke accel) {
-        JMenuItem item = makeMenuItem(label, name, actionCommand);
-        item.setAccelerator(accel);
-        return item;
-    }
 
     private static void addSeparator(JPopupMenu menu) {
         MenuElement[] elements = menu.getSubElements();

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java?rev=1818942&r1=1818941&r2=1818942&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java Thu Dec
21 15:31:54 2017
@@ -94,6 +94,8 @@ public abstract class AbstractThreadGrou
         JMenu addMenu = new JMenu(JMeterUtils.getResString("add")); // $NON-NLS-1$
         addMenu.add(MenuFactory.makeMenu(MenuFactory.SAMPLERS, addAction));
         addMenu.addSeparator();
+        addMenu.add(MenuFactory.makeMenu(MenuFactory.CONTROLLERS, addAction));
+        addMenu.addSeparator();
         addMenu.add(MenuFactory.makeMenu(MenuFactory.PRE_PROCESSORS, addAction));
         addMenu.add(MenuFactory.makeMenu(MenuFactory.POST_PROCESSORS, addAction));
         addMenu.add(MenuFactory.makeMenu(MenuFactory.ASSERTIONS, addAction));



Mime
View raw message