Apache JMeter

org.apache.jmeter.gui.util
Class MenuFactory

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

public final class MenuFactory
extends java.lang.Object


Field Summary
static java.lang.String ASSERTIONS
           
static java.lang.String CONFIG_ELEMENTS
           
static java.lang.String CONTROLLERS
           
static java.lang.String LISTENERS
           
static java.lang.String NON_TEST_ELEMENTS
           
static java.lang.String POST_PROCESSORS
           
static java.lang.String PRE_PROCESSORS
           
static java.lang.String SAMPLERS
           
static java.lang.String TIMERS
           
 
Method Summary
static void addEditMenu(javax.swing.JPopupMenu menu, boolean removable)
           
static void addFileMenu(javax.swing.JPopupMenu menu)
           
static void addPasteResetMenu(javax.swing.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 javax.swing.JPopupMenu getDefaultAssertionMenu()
           
static javax.swing.JPopupMenu getDefaultConfigElementMenu()
           
static javax.swing.JPopupMenu getDefaultControllerMenu()
           
static javax.swing.JPopupMenu getDefaultExtractorMenu()
           
static javax.swing.JPopupMenu getDefaultSamplerMenu()
           
static javax.swing.JPopupMenu getDefaultTimerMenu()
           
static javax.swing.JPopupMenu getDefaultVisualizerMenu()
           
static javax.swing.JMenu makeMenu(java.util.Collection menuInfo, java.lang.String actionCommand, java.lang.String menuName)
          Create a menu from a collection of items.
static javax.swing.JMenu makeMenu(java.lang.String category, java.lang.String actionCommand)
          Create a menu from a menu category.
static java.awt.Component makeMenuItem(MenuInfo info, java.lang.String actionCommand)
          Create a single menu item from a MenuInfo object
static javax.swing.JMenuItem makeMenuItem(java.lang.String label, java.lang.String name, java.lang.String actionCommand)
          Create a single menu item
static javax.swing.JMenuItem makeMenuItem(java.lang.String label, java.lang.String name, java.lang.String actionCommand, javax.swing.KeyStroke accel)
           
static javax.swing.JMenuItem makeMenuItemRes(java.lang.String resource, java.lang.String actionCommand)
          Create a single menu item from the resource name.
static javax.swing.JMenuItem makeMenuItemRes(java.lang.String resource, java.lang.String actionCommand, javax.swing.KeyStroke accel)
           
static javax.swing.JMenu makeMenus(java.lang.String[] categories, java.lang.String label, java.lang.String actionCommand)
           
static void setEnabled(javax.swing.JMenu menu)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMERS

public static final java.lang.String TIMERS
See Also:
Constant Field Values

CONTROLLERS

public static final java.lang.String CONTROLLERS
See Also:
Constant Field Values

SAMPLERS

public static final java.lang.String SAMPLERS
See Also:
Constant Field Values

CONFIG_ELEMENTS

public static final java.lang.String CONFIG_ELEMENTS
See Also:
Constant Field Values

POST_PROCESSORS

public static final java.lang.String POST_PROCESSORS
See Also:
Constant Field Values

PRE_PROCESSORS

public static final java.lang.String PRE_PROCESSORS
See Also:
Constant Field Values

ASSERTIONS

public static final java.lang.String ASSERTIONS
See Also:
Constant Field Values

NON_TEST_ELEMENTS

public static final java.lang.String NON_TEST_ELEMENTS
See Also:
Constant Field Values

LISTENERS

public static final java.lang.String LISTENERS
See Also:
Constant Field Values
Method Detail

addEditMenu

public static void addEditMenu(javax.swing.JPopupMenu menu,
                               boolean removable)

addPasteResetMenu

public static void addPasteResetMenu(javax.swing.JPopupMenu menu)

addFileMenu

public static void addFileMenu(javax.swing.JPopupMenu menu)

makeMenus

public static javax.swing.JMenu makeMenus(java.lang.String[] categories,
                                          java.lang.String label,
                                          java.lang.String actionCommand)

getDefaultControllerMenu

public static javax.swing.JPopupMenu getDefaultControllerMenu()

getDefaultSamplerMenu

public static javax.swing.JPopupMenu getDefaultSamplerMenu()

getDefaultConfigElementMenu

public static javax.swing.JPopupMenu getDefaultConfigElementMenu()

getDefaultVisualizerMenu

public static javax.swing.JPopupMenu getDefaultVisualizerMenu()

getDefaultTimerMenu

public static javax.swing.JPopupMenu getDefaultTimerMenu()

getDefaultAssertionMenu

public static javax.swing.JPopupMenu getDefaultAssertionMenu()

getDefaultExtractorMenu

public static javax.swing.JPopupMenu getDefaultExtractorMenu()

makeMenu

public static javax.swing.JMenu makeMenu(java.lang.String category,
                                         java.lang.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 javax.swing.JMenu makeMenu(java.util.Collection menuInfo,
                                         java.lang.String actionCommand,
                                         java.lang.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(javax.swing.JMenu menu)

makeMenuItem

public static javax.swing.JMenuItem makeMenuItem(java.lang.String label,
                                                 java.lang.String name,
                                                 java.lang.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 javax.swing.JMenuItem makeMenuItemRes(java.lang.String resource,
                                                    java.lang.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 java.awt.Component makeMenuItem(MenuInfo info,
                                              java.lang.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 javax.swing.JMenuItem makeMenuItemRes(java.lang.String resource,
                                                    java.lang.String actionCommand,
                                                    javax.swing.KeyStroke accel)

makeMenuItem

public static javax.swing.JMenuItem makeMenuItem(java.lang.String label,
                                                 java.lang.String name,
                                                 java.lang.String actionCommand,
                                                 javax.swing.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.