use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class JMeterThread method threadStarted.
private void threadStarted() {
JMeterContextService.incrNumberOfThreads();
threadGroup.incrNumberOfThreads();
GuiPackage gp = GuiPackage.getInstance();
if (gp != null) {
// check there is a GUI
gp.getMainFrame().updateCounts();
}
ThreadListenerTraverser startup = new ThreadListenerTraverser(true);
// call ThreadListener.threadStarted()
testTree.traverse(startup);
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class RemoteThreadsListenerImpl method threadFinished.
/* (non-Javadoc)
* @see org.apache.jmeter.samplers.RemoteThreadsListener#threadFinished()
*/
@Override
public void threadFinished() {
JMeterContextService.decrNumberOfThreads();
GuiPackage gp = GuiPackage.getInstance();
if (gp != null) {
// check there is a GUI
gp.getMainFrame().updateCounts();
}
for (RemoteThreadsLifeCycleListener listener : listeners) {
listener.threadNumberDecreased(JMeterContextService.getNumberOfThreads());
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class JMeterMenuBar method makeOptionsMenu.
private void makeOptionsMenu() {
// OPTIONS MENU
//$NON-NLS-1$
optionsMenu = makeMenuRes("option", 'O');
//$NON-NLS-1$
JMenuItem functionHelper = makeMenuItemRes("function_dialog_menu_item", 'F', ActionNames.FUNCTIONS, KeyStrokes.FUNCTIONS);
//$NON-NLS-1$
lafMenu = makeMenuRes("appearance", 'L');
for (LookAndFeelInfo laf : getAllLAFs()) {
JMenuItem menuItem = new JMenuItem(laf.getName());
menuItem.addActionListener(ActionRouter.getInstance());
menuItem.setActionCommand(ActionNames.LAF_PREFIX + laf.getClassName());
// show the classname to the user
menuItem.setToolTipText(laf.getClassName());
lafMenu.add(menuItem);
}
optionsMenu.add(functionHelper);
optionsMenu.add(lafMenu);
//$NON-NLS-1$
JCheckBoxMenuItem menuLoggerPanel = makeCheckBoxMenuItemRes("menu_logger_panel", ActionNames.LOGGER_PANEL_ENABLE_DISABLE);
GuiPackage guiInstance = GuiPackage.getInstance();
if (guiInstance != null) {
//avoid error in ant task tests (good way?)
guiInstance.setMenuItemLoggerPanel(menuLoggerPanel);
}
optionsMenu.add(menuLoggerPanel);
//$NON-NLS-1$
JMenu menuLoggerLevel = makeMenuRes("menu_logger_level");
JMenuItem menuItem;
String levelString;
for (Level level : Level.values()) {
levelString = level.toString();
menuItem = new JMenuItem(levelString);
menuItem.addActionListener(ActionRouter.getInstance());
menuItem.setActionCommand(ActionNames.LOG_LEVEL_PREFIX + levelString);
// show the classname to the user
menuItem.setToolTipText(levelString);
menuLoggerLevel.add(menuItem);
}
optionsMenu.add(menuLoggerLevel);
if (SSLManager.isSSLSupported()) {
//$NON-NLS-1$
sslManager = makeMenuItemRes("sslmanager", 'S', ActionNames.SSL_MANAGER, KeyStrokes.SSL_MANAGER);
optionsMenu.add(sslManager);
}
optionsMenu.add(makeLanguageMenu());
//$NON-NLS-1$
JMenuItem collapse = makeMenuItemRes("menu_collapse_all", ActionNames.COLLAPSE_ALL, KeyStrokes.COLLAPSE_ALL);
optionsMenu.add(collapse);
//$NON-NLS-1$
JMenuItem expand = makeMenuItemRes("menu_expand_all", ActionNames.EXPAND_ALL, KeyStrokes.EXPAND_ALL);
optionsMenu.add(expand);
//$NON-NLS-1$
JMenuItem zoomIn = makeMenuItemRes("menu_zoom_in", ActionNames.ZOOM_IN);
optionsMenu.add(zoomIn);
//$NON-NLS-1$
JMenuItem zoomOut = makeMenuItemRes("menu_zoom_out", ActionNames.ZOOM_OUT);
optionsMenu.add(zoomOut);
addPluginsMenuItems(optionsMenu, menuCreators, MENU_LOCATION.OPTIONS);
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class ProxyControlGui method reinitializeTargetCombo.
private void reinitializeTargetCombo() {
log.debug("Reinitializing target combo");
// Stop action notifications while we shuffle this around:
targetNodes.removeActionListener(this);
targetNodesModel.removeAllElements();
GuiPackage gp = GuiPackage.getInstance();
JMeterTreeNode root;
if (gp != null) {
root = (JMeterTreeNode) GuiPackage.getInstance().getTreeModel().getRoot();
targetNodesModel.addElement(// $NON-NLS-1$
new TreeNodeWrapper(null, JMeterUtils.getResString("use_recording_controller")));
buildNodesModel(root, "", 0);
}
TreeNodeWrapper choice = null;
for (int i = 0; i < targetNodesModel.getSize(); i++) {
choice = (TreeNodeWrapper) targetNodesModel.getElementAt(i);
log.debug("Selecting item " + choice + " for model " + model + " in " + this);
if (// .equals caused NPE
choice.getTreeNode() == model.getTarget()) {
break;
}
}
// Reinstate action notifications:
targetNodes.addActionListener(this);
// Set the current value:
targetNodesModel.setSelectedItem(choice);
log.debug("Reinitialization complete");
}
Aggregations