Apache JMeter

## org.apache.jmeter.gui.util
Class MenuFactory

    java.lang.Object
      org.apache.jmeter.gui.util.MenuFactory

    public final class MenuFactory

extends Object

Field Summary
`static String` `ASSERTIONS`
`static String` `CONFIG_ELEMENTS`
`static String` `CONTROLLERS`
`static String` `LISTENERS`
`static String` `NON_TEST_ELEMENTS`
`static String` `POST_PROCESSORS`
`static String` `PRE_PROCESSORS`
`static String` `SAMPLERS`
`static String` `THREADS`
`static String` `TIMERS`

Method Summary
`static void` `addEditMenu(JPopupMenu menu, boolean removable)`
`static void` `addFileMenu(JPopupMenu menu)`
`static void` `addPasteResetMenu(JPopupMenu menu)`
`static boolean` `canAddTo(JMeterTreeNode parentNode, JMeterTreeNode[] nodes)` Determine whether or not nodes can be added to this parent.
`static boolean` `canAddTo(JMeterTreeNode parentNode, TestElement element)` Determine whether or not nodes can be added to this parent.
`static JPopupMenu` `getDefaultAssertionMenu()`
`static JPopupMenu` `getDefaultConfigElementMenu()`
`static JPopupMenu` `getDefaultControllerMenu()`
`static JPopupMenu` `getDefaultExtractorMenu()`
`static JPopupMenu` `getDefaultMenu()`
`static JPopupMenu` `getDefaultSamplerMenu()`
`static JPopupMenu` `getDefaultTimerMenu()`
`static JPopupMenu` `getDefaultVisualizerMenu()`
`static JMenu` `makeMenu(Collection<MenuInfo> menuInfo, String actionCommand, String menuName)` Create a menu from a collection of items.
`static JMenu` `makeMenu(String category, String actionCommand)` Create a menu from a menu category.
`static Component` `makeMenuItem(MenuInfo info, String actionCommand)` Create a single menu item from a MenuInfo object
`static JMenuItem` `makeMenuItem(String label, String name, String actionCommand)` Create a single menu item
`static JMenuItem` `makeMenuItem(String label, String name, String actionCommand, KeyStroke accel)`
`static JMenuItem` `makeMenuItemRes(String resource, String actionCommand)` Create a single menu item from the resource name.
`static JMenuItem` `makeMenuItemRes(String resource, String actionCommand, KeyStroke accel)`
`static JMenu` `makeMenus(String[] categories, String label, String actionCommand)`
`static void` `setEnabled(JMenu menu)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### THREADS

    public static final String THREADS

See Also:
  Constant Field Values

### TIMERS

    public static final String TIMERS

See Also:
  Constant Field Values

### CONTROLLERS

    public static final String CONTROLLERS

See Also:
  Constant Field Values

### SAMPLERS

    public static final String SAMPLERS

See Also:
  Constant Field Values

### CONFIG_ELEMENTS

    public static final String CONFIG_ELEMENTS

See Also:
  Constant Field Values

### POST_PROCESSORS

    public static final String POST_PROCESSORS

See Also:
  Constant Field Values

### PRE_PROCESSORS

    public static final String PRE_PROCESSORS

See Also:
  Constant Field Values

### ASSERTIONS

    public static final String ASSERTIONS

See Also:
  Constant Field Values

### NON_TEST_ELEMENTS

    public static final String NON_TEST_ELEMENTS

See Also:
  Constant Field Values

### LISTENERS

    public static final String LISTENERS

See Also:
  Constant Field Values

Method Detail

### addEditMenu

    public static void addEditMenu(JPopupMenu menu,
                                   boolean removable)

### addPasteResetMenu

    public static void addPasteResetMenu(JPopupMenu menu)

### addFileMenu

    public static void addFileMenu(JPopupMenu menu)

### makeMenus

    public static JMenu makeMenus(String[] categories,
                                  String label,
                                  String actionCommand)

### getDefaultControllerMenu

    public static JPopupMenu getDefaultControllerMenu()

### getDefaultSamplerMenu

    public static JPopupMenu getDefaultSamplerMenu()

### getDefaultConfigElementMenu

    public static JPopupMenu getDefaultConfigElementMenu()

### getDefaultVisualizerMenu

    public static JPopupMenu getDefaultVisualizerMenu()

### getDefaultTimerMenu

    public static JPopupMenu getDefaultTimerMenu()

### getDefaultAssertionMenu

    public static JPopupMenu getDefaultAssertionMenu()

### getDefaultExtractorMenu

    public static JPopupMenu getDefaultExtractorMenu()

### getDefaultMenu

    public static JPopupMenu getDefaultMenu()

### makeMenu

    public static JMenu makeMenu(String category,
                                 String actionCommand)

  Create a menu from a menu category.

  Parameters:
    `category` - - predefined string (used as key for menuMap HashMap and messages.properties lookup)
    `actionCommand` - - predefined string, e.g. ActionNames.ADD
  Returns:
    the menu
  See Also:
    `ActionNames`

### makeMenu

    public static JMenu makeMenu(Collection<MenuInfo> menuInfo,
                                 String actionCommand,
                                 String menuName)

  Create a menu from a collection of items.

  Parameters:
    `menuInfo` - - collection of MenuInfo items
    `actionCommand` - - predefined string, e.g. ActionNames.ADD
    `menuName` -
  Returns:
    the menu
  See Also:
    `ActionNames`

### setEnabled

    public static void setEnabled(JMenu menu)

### makeMenuItem

    public static JMenuItem makeMenuItem(String label,
                                         String name,
                                         String actionCommand)

  Create a single menu item

  Parameters:
    `label` - for the MenuItem
    `name` - for the MenuItem
    `actionCommand` - - predefined string, e.g. ActionNames.ADD
  Returns:
    the menu item
  See Also:
    `ActionNames`

### makeMenuItemRes

    public static JMenuItem makeMenuItemRes(String resource,
                                            String actionCommand)

  Create a single menu item from the resource name.

  Parameters:
    `resource` - for the MenuItem
    `actionCommand` - - predefined string, e.g. ActionNames.ADD
  Returns:
    the menu item
  See Also:
    `ActionNames`

### makeMenuItem

    public static Component makeMenuItem(MenuInfo info,
                                         String actionCommand)

  Create a single menu item from a MenuInfo object

  Parameters:
    `info` - the MenuInfo object
    `actionCommand` - - predefined string, e.g. ActionNames.ADD
  Returns:
    the menu item
  See Also:
    `ActionNames`

### makeMenuItemRes

    public static JMenuItem makeMenuItemRes(String resource,
                                            String actionCommand,
                                            KeyStroke accel)

### makeMenuItem

    public static JMenuItem makeMenuItem(String label,
                                         String name,
                                         String actionCommand,
                                         KeyStroke accel)

### canAddTo

    public static boolean canAddTo(JMeterTreeNode parentNode,
                                   TestElement element)

  Determine whether or not nodes can be added to this parent. Used by Merge

  Parameters:
    `parentNode` -
    `element` - - top-level test element to be added
  Returns:
    whether it is OK to add the element to this parent

### canAddTo

    public static boolean canAddTo(JMeterTreeNode parentNode,
                                   JMeterTreeNode[] nodes)

  Determine whether or not nodes can be added to this parent. Used by DragNDrop and Paste.

  Parameters:
    `parentNode` -
    `nodes` - - array of nodes that are to be added
  Returns:
    whether it is OK to add the dragged nodes to this parent

Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.