# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Documents\Programming\JMeter\trunk # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/core/org/apache/jmeter/gui/util/MenuFactory.java --- src/core/org/apache/jmeter/gui/util/MenuFactory.java Base (BASE) +++ src/core/org/apache/jmeter/gui/util/MenuFactory.java Locally Modified (Based On LOCAL) @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -151,6 +152,7 @@ } initializeMenus(); + sortPluginMenus(); } catch (Throwable e) { log.error("", e); if (e instanceof Error){ @@ -639,4 +641,24 @@ static int elementsToSkip_size() { return elementsToSkip.size(); } + + /** + * Menu sort helper class + */ + private static class MenuInfoComparator implements Comparator { + public int compare(MenuInfo o1, MenuInfo o2) { + return o1.getLabel().compareTo(o2.getLabel()); } + } + + /** + * Sort loaded menus + */ + private static void sortPluginMenus() { + Iterator> it = menuMap.values().iterator(); + while (it.hasNext()) { + List menuToSort = it.next(); + Collections.sort(menuToSort, new MenuInfoComparator()); + } + } +}