sebb        2004/09/26 07:46:29

  Modified:    src/core/org/apache/jmeter/gui/util Tag: rel-2_0
                        MenuFactory.java
  Log:
  Replace Edit Open menu item with Merge (Bug 30829)
  Refactor menu strings into static final strings
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.29.2.1  +32 -21    
jakarta-jmeter/src/core/org/apache/jmeter/gui/util/MenuFactory.java
  
  Index: MenuFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/util/MenuFactory.java,v
  retrieving revision 1.29
  retrieving revision 1.29.2.1
  diff -u -r1.29 -r1.29.2.1
  --- MenuFactory.java  12 Feb 2004 23:59:01 -0000      1.29
  +++ MenuFactory.java  26 Sep 2004 14:46:29 -0000      1.29.2.1
  @@ -58,7 +58,7 @@
   
       public final static String TIMERS = "menu_timer";
       public final static String CONTROLLERS = "menu_logic_controller";
  -    public final static String SAMPLERS = "menu_generative_controller";
  +     public final static String SAMPLERS = "menu_generative_controller";
       public final static String CONFIG_ELEMENTS = "menu_config_element";
       public final static String POST_PROCESSORS = "menu_post_processors";
       public final static String PRE_PROCESSORS = "menu_pre_processors";
  @@ -68,6 +68,30 @@
       private static Map menuMap = new HashMap();
       private static Set elementsToSkip = new HashSet();
   
  +    // MENU_ADD_xxx - controls which items are in the ADD menu
  +    // MENU_PARENT_xxx - controls which items are in the Insert Parent menu
  +     private static final String[] MENU_ADD_CONTROLLER = new String[] {
  +            MenuFactory.CONTROLLERS,
  +            MenuFactory.SAMPLERS,
  +            MenuFactory.CONFIG_ELEMENTS,
  +            MenuFactory.TIMERS,
  +            MenuFactory.LISTENERS,
  +            MenuFactory.PRE_PROCESSORS,
  +            MenuFactory.POST_PROCESSORS };
  +    private static final String[] MENU_PARENT_CONTROLLER = new String[] {
  +             MenuFactory.CONTROLLERS };
  +    
  +    private static final String[] MENU_ADD_SAMPLER = new String[] {
  +            MenuFactory.CONFIG_ELEMENTS,
  +            MenuFactory.ASSERTIONS,
  +            MenuFactory.TIMERS,
  +            MenuFactory.LISTENERS,
  +            MenuFactory.PRE_PROCESSORS,
  +            MenuFactory.POST_PROCESSORS };
  +    private static final String[] MENU_PARENT_SAMPLER = new String[] { 
  +             MenuFactory.CONTROLLERS };
  +
  +    
       private static List timers,
           controllers,
           samplers,
  @@ -161,7 +185,7 @@
       {
           addSeparator(menu);
           menu.add(
  -            makeMenuItem(JMeterUtils.getResString("open"), "Open", "open"));
  +            makeMenuItem(JMeterUtils.getResString("menu_merge"), "Merge", "merge"));
           menu.add(
               makeMenuItem(JMeterUtils.getResString("save_as"), "Save As", 
"save_as"));
           JMenuItem disabled =
  @@ -215,19 +239,12 @@
           JPopupMenu pop = new JPopupMenu();
           pop.add(
               MenuFactory.makeMenus(
  -                new String[] {
  -                    MenuFactory.CONTROLLERS,
  -                    MenuFactory.SAMPLERS,
  -                    MenuFactory.CONFIG_ELEMENTS,
  -                    MenuFactory.TIMERS,
  -                    MenuFactory.LISTENERS,
  -                    MenuFactory.PRE_PROCESSORS,
  -                    MenuFactory.POST_PROCESSORS },
  +                MENU_ADD_CONTROLLER,
                   JMeterUtils.getResString("Add"),
                   "Add"));
           pop.add(
               makeMenus(
  -                new String[] { MenuFactory.CONTROLLERS },
  +                MENU_PARENT_CONTROLLER,
                   JMeterUtils.getResString("insert_parent"),
                   "Add Parent"));
           MenuFactory.addEditMenu(pop, true);
  @@ -240,18 +257,12 @@
           JPopupMenu pop = new JPopupMenu();
           pop.add(
               MenuFactory.makeMenus(
  -                new String[] {
  -                    MenuFactory.CONFIG_ELEMENTS,
  -                    MenuFactory.ASSERTIONS,
  -                    MenuFactory.TIMERS,
  -                    MenuFactory.LISTENERS,
  -                    MenuFactory.PRE_PROCESSORS,
  -                    MenuFactory.POST_PROCESSORS },
  +                MENU_ADD_SAMPLER,
                   JMeterUtils.getResString("Add"),
                   "Add"));
           pop.add(
               makeMenus(
  -                new String[] { MenuFactory.CONTROLLERS },
  +                MENU_PARENT_SAMPLER,
                   JMeterUtils.getResString("insert_parent"),
                   "Add Parent"));
           MenuFactory.addEditMenu(pop, true);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to