use of javax.swing.JPopupMenu in project jmeter by apache.
the class WorkBenchGui method createPopupMenu.
/**
* When a user right-clicks on the component in the test tree, or selects
* the edit menu when the component is selected, the component will be asked
* to return a JPopupMenu that provides all the options available to the
* user from this component.
* <p>
* The WorkBench returns a popup menu allowing you to add anything.
*
* @return a JPopupMenu appropriate for the component.
*/
@Override
public JPopupMenu createPopupMenu() {
JPopupMenu menu = new JPopupMenu();
JMenu addMenu = MenuFactory.makeMenus(new String[] { MenuFactory.NON_TEST_ELEMENTS, MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, MenuFactory.SAMPLERS, MenuFactory.POST_PROCESSORS, MenuFactory.ASSERTIONS, MenuFactory.LISTENERS }, // $NON-NLS-1$
JMeterUtils.getResString("add"), ActionNames.ADD);
menu.add(addMenu);
MenuFactory.addPasteResetMenu(menu);
MenuFactory.addFileMenu(menu);
return menu;
}
use of javax.swing.JPopupMenu in project jmeter by apache.
the class TestPlanGui method createPopupMenu.
/**
* When a user right-clicks on the component in the test tree, or selects
* the edit menu when the component is selected, the component will be asked
* to return a JPopupMenu that provides all the options available to the
* user from this component.
* <p>
* The TestPlan will return a popup menu allowing you to add ThreadGroups,
* Listeners, Configuration Elements, Assertions, PreProcessors,
* PostProcessors, and Timers.
*
* @return a JPopupMenu appropriate for the component.
*/
@Override
public JPopupMenu createPopupMenu() {
JPopupMenu pop = new JPopupMenu();
// $NON-NLS-1$
JMenu addMenu = new JMenu(JMeterUtils.getResString("add"));
addMenu.add(MenuFactory.makeMenu(MenuFactory.THREADS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.FRAGMENTS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.CONFIG_ELEMENTS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.TIMERS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.PRE_PROCESSORS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.POST_PROCESSORS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.ASSERTIONS, ActionNames.ADD));
addMenu.add(MenuFactory.makeMenu(MenuFactory.LISTENERS, ActionNames.ADD));
pop.add(addMenu);
MenuFactory.addPasteResetMenu(pop);
MenuFactory.addFileMenu(pop, false);
return pop;
}
use of javax.swing.JPopupMenu in project jmeter by apache.
the class AbstractThreadGroupGui method createPopupMenu.
@Override
public JPopupMenu createPopupMenu() {
JPopupMenu pop = new JPopupMenu();
pop.add(MenuFactory.makeMenus(new String[] { MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, MenuFactory.SAMPLERS, MenuFactory.POST_PROCESSORS, MenuFactory.ASSERTIONS, MenuFactory.LISTENERS }, // $NON-NLS-1$
JMeterUtils.getResString("add"), ActionNames.ADD));
if (this.isEnabled() && // Check test is not started already
!JMeterUtils.isTestRunning()) {
pop.addSeparator();
JMenuItem addThinkTimesToChildren = new JMenuItem(JMeterUtils.getResString("add_think_times"));
addThinkTimesToChildren.setName("add_think_times");
addThinkTimesToChildren.addActionListener(ActionRouter.getInstance());
addThinkTimesToChildren.setActionCommand(ActionNames.ADD_THINK_TIME_BETWEEN_EACH_STEP);
pop.add(addThinkTimesToChildren);
JMenuItem runTg = new JMenuItem(JMeterUtils.getResString("run_threadgroup"));
runTg.setName("run_threadgroup");
runTg.addActionListener(ActionRouter.getInstance());
runTg.setActionCommand(ActionNames.RUN_TG);
pop.add(runTg);
JMenuItem runTgNotimers = new JMenuItem(JMeterUtils.getResString("run_threadgroup_no_timers"));
runTgNotimers.setName("run_threadgroup_no_timers");
runTgNotimers.addActionListener(ActionRouter.getInstance());
runTgNotimers.setActionCommand(ActionNames.RUN_TG_NO_TIMERS);
pop.add(runTgNotimers);
JMenuItem validateTg = new JMenuItem(JMeterUtils.getResString("validate_threadgroup"));
validateTg.setName("validate_threadgroup");
validateTg.addActionListener(ActionRouter.getInstance());
validateTg.setActionCommand(ActionNames.VALIDATE_TG);
pop.add(validateTg);
}
MenuFactory.addEditMenu(pop, true);
MenuFactory.addFileMenu(pop, false);
return pop;
}
use of javax.swing.JPopupMenu in project jmeter by apache.
the class MenuFactory method getDefaultSamplerMenu.
public static JPopupMenu getDefaultSamplerMenu() {
JPopupMenu pop = new JPopupMenu();
pop.add(MenuFactory.makeMenus(MENU_ADD_SAMPLER, // $NON-NLS-1$
JMeterUtils.getResString("add"), ActionNames.ADD));
pop.add(makeMenus(MENU_PARENT_SAMPLER, // $NON-NLS-1$
JMeterUtils.getResString("insert_parent"), ActionNames.ADD_PARENT));
MenuFactory.addEditMenu(pop, true);
MenuFactory.addFileMenu(pop);
return pop;
}
use of javax.swing.JPopupMenu in project jmeter by apache.
the class MenuFactory method getDefaultExtractorMenu.
public static JPopupMenu getDefaultExtractorMenu() {
JPopupMenu pop = new JPopupMenu();
MenuFactory.addEditMenu(pop, true);
MenuFactory.addFileMenu(pop);
return pop;
}
Aggregations