org.apache.jmeter.gui.util

Class 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
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, 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
getDefaultSamplerMenu()
static JPopupMenu
getDefaultTimerMenu()
static JPopupMenu
getDefaultVisualizerMenu()
static JMenu
makeMenu(Collection 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 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 Component
makeMenuItem(MenuInfo info, String actionCommand)
Create a single menu item from a MenuInfo object
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)

Field Details

ASSERTIONS

public static final String ASSERTIONS

CONFIG_ELEMENTS

public static final String CONFIG_ELEMENTS

CONTROLLERS

public static final String CONTROLLERS

LISTENERS

public static final String LISTENERS

NON_TEST_ELEMENTS

public static final String NON_TEST_ELEMENTS

POST_PROCESSORS

public static final String POST_PROCESSORS

PRE_PROCESSORS

public static final String PRE_PROCESSORS

SAMPLERS

public static final String SAMPLERS

TIMERS

public static final String TIMERS

Method Details

addEditMenu

public static void addEditMenu(JPopupMenu menu,
                               boolean removable)

addFileMenu

public static void addFileMenu(JPopupMenu menu)

addPasteResetMenu

public static void addPasteResetMenu(JPopupMenu menu)

canAddTo

public static boolean canAddTo(JMeterTreeNode parentNode,
                               nodes[] )
Determine whether or not nodes can be added to this parent. Used by DragNDrop and Paste.
Parameters:
parentNode -
Returns:
whether it is OK to add the dragged nodes to this parent

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

getDefaultAssertionMenu

public static JPopupMenu getDefaultAssertionMenu()

getDefaultConfigElementMenu

public static JPopupMenu getDefaultConfigElementMenu()

getDefaultControllerMenu

public static JPopupMenu getDefaultControllerMenu()

getDefaultExtractorMenu

public static JPopupMenu getDefaultExtractorMenu()

getDefaultSamplerMenu

public static JPopupMenu getDefaultSamplerMenu()

getDefaultTimerMenu

public static JPopupMenu getDefaultTimerMenu()

getDefaultVisualizerMenu

public static JPopupMenu getDefaultVisualizerMenu()

makeMenu

public static JMenu makeMenu(Collection 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

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

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

makeMenuItem

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

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)
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

makeMenuItemRes

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

makeMenus

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

setEnabled

public static void setEnabled(JMenu menu)

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