Package org.apache.jmeter.gui.util
Class MenuFactory
-
- All Implemented Interfaces:
public final class MenuFactory
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
THREADS
public final static String
FRAGMENTS
public final static String
TIMERS
public final static String
CONTROLLERS
public final static String
SAMPLERS
public final static String
CONFIG_ELEMENTS
public final static String
POST_PROCESSORS
public final static String
PRE_PROCESSORS
public final static String
ASSERTIONS
public final static String
NON_TEST_ELEMENTS
public final static String
LISTENERS
public final static String
SEPARATOR
-
Method Summary
Modifier and Type Method Description static void
addEditMenu(JPopupMenu menu, boolean removable)
static void
addPasteResetMenu(JPopupMenu menu)
static void
addFileMenu(JPopupMenu pop)
static void
addFileMenu(JPopupMenu menu, boolean addSaveTestFragmentMenu)
static JMenu
makeMenus(Array<String> categories, String label, String actionCommand)
static JPopupMenu
getDefaultControllerMenu()
static JPopupMenu
getDefaultSamplerMenu()
static JPopupMenu
getDefaultConfigElementMenu()
static JPopupMenu
getDefaultVisualizerMenu()
static JPopupMenu
getDefaultTimerMenu()
static JPopupMenu
getDefaultAssertionMenu()
static JPopupMenu
getDefaultExtractorMenu()
static JPopupMenu
getDefaultMenu()
static JMenu
makeMenu(String category, String actionCommand)
Create a menu from a menu category. static void
setEnabled(JMenu menu)
static JMenuItem
makeMenuItem(String label, String name, String actionCommand)
Create a single menu item static JMenuItem
makeMenuItemRes(String resource, String actionCommand)
Create a single menu item from the resource name. static boolean
canAddTo(JMeterTreeNode parentNode, TestElement element)
Determine whether or not nodes can be added to this parent. static boolean
canAddTo(JMeterTreeNode parentNode, Array<JMeterTreeNode> nodes)
Determine whether or not nodes can be added to this parent. -
-
Method Detail
-
addEditMenu
static void addEditMenu(JPopupMenu menu, boolean removable)
-
addPasteResetMenu
static void addPasteResetMenu(JPopupMenu menu)
-
addFileMenu
static void addFileMenu(JPopupMenu pop)
-
addFileMenu
static void addFileMenu(JPopupMenu menu, boolean addSaveTestFragmentMenu)
- Parameters:
menu
- JPopupMenuaddSaveTestFragmentMenu
- Add Save as Test Fragment menu if true
-
getDefaultControllerMenu
static JPopupMenu getDefaultControllerMenu()
-
getDefaultSamplerMenu
static JPopupMenu getDefaultSamplerMenu()
-
getDefaultConfigElementMenu
static JPopupMenu getDefaultConfigElementMenu()
-
getDefaultVisualizerMenu
static JPopupMenu getDefaultVisualizerMenu()
-
getDefaultTimerMenu
static JPopupMenu getDefaultTimerMenu()
-
getDefaultAssertionMenu
static JPopupMenu getDefaultAssertionMenu()
-
getDefaultExtractorMenu
static JPopupMenu getDefaultExtractorMenu()
-
getDefaultMenu
static JPopupMenu getDefaultMenu()
-
makeMenu
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.actionCommand
- predefined string, e.g.- Returns:
the menu
-
setEnabled
static void setEnabled(JMenu menu)
-
makeMenuItem
static JMenuItem makeMenuItem(String label, String name, String actionCommand)
Create a single menu item
- Parameters:
label
- for the MenuItemname
- for the MenuItemactionCommand
- predefined string, e.g.- Returns:
the menu item
-
makeMenuItemRes
static JMenuItem makeMenuItemRes(String resource, String actionCommand)
Create a single menu item from the resource name.
- Parameters:
resource
- for the MenuItemactionCommand
- predefined string, e.g.- Returns:
the menu item
-
canAddTo
static boolean canAddTo(JMeterTreeNode parentNode, TestElement element)
Determine whether or not nodes can be added to this parent.
Used by Merge
- Parameters:
parentNode
- The JMeterTreeNode to test, if a new element can be added to itelement
- top-level test element to be added- Returns:
whether it is OK to add the element to this parent
-
canAddTo
static boolean canAddTo(JMeterTreeNode parentNode, Array<JMeterTreeNode> nodes)
Determine whether or not nodes can be added to this parent.
Used by DragNDrop and Paste.
- Parameters:
parentNode
- The JMeterTreeNode to test, ifnodes[]
can be added to itnodes
- array of nodes that are to be added- Returns:
whether it is OK to add the dragged nodes to this parent
-
-
-
-