/**
* Set the menu that should be used for the Edit menu.
*
* @param menu
* the new Edit menu
*/
public void setEditMenu(JPopupMenu menu) {
menuBar.setEditMenu(menu);
}
/**
* Specify whether or not the Edit menu item should be enabled.
*
* @param enabled
* true if the menu item should be enabled, false otherwise
*/
public void setEditEnabled(boolean enabled) {
menuBar.setEditEnabled(enabled);
}
/**
* Set the menu that should be used for the Edit|Add menu.
*
* @param menu
* the new Edit|Add menu
*/
public void setEditAddMenu(JMenu menu) {
menuBar.setEditAddMenu(menu);
}
/**
* Specify whether or not the Edit|Add menu item should be enabled.
*
* @param enabled
* true if the menu item should be enabled, false otherwise
*/
public void setEditAddEnabled(boolean enabled) {
menuBar.setEditAddEnabled(enabled);
}
/**
* Specify whether or not the Edit|Remove menu item should be enabled.
*
* @param enabled
* true if the menu item should be enabled, false otherwise
*/
public void setEditRemoveEnabled(boolean enabled) {
menuBar.setEditRemoveEnabled(enabled);
}
/**
* Close the currently selected menu.
*/
/**
* Close the currently selected menu.
*/
public void closeMenu() {
if (menuBar.isSelected()) {
MenuElement[] menuElement = menuBar.getSubElements();
if (menuElement != null) {
for (int i = 0; i < menuElement.length; i++) {
JMenu menu = (JMenu) menuElement[i];
if (menu.isSelected()) {
menu.setPopupMenuVisible(false);
menu.setSelected(false);
break;
}
}
}
}
}
/**
* Show a dialog indicating that JMeter threads are stopping on a particular
* host.
*
* @param host
* the host where JMeter threads are stopping
*/
/**
* Show a dialog indicating that JMeter threads are stopping on a particular
* host.
*
* @param host
* the host where JMeter threads are stopping
*/
public void showStoppingMessage(String host) {
stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true); // $NON-NLS-1$ //$NON-NLS-1$
JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host); // $NON-NLS-1$ //$NON-NLS-1$$NON-NLS-2$
stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
stoppingMessage.getContentPane().add(stopLabel);
stoppingMessage.pack();
ComponentUtil.centerComponentInComponent(this, stoppingMessage);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (stoppingMessage != null) { // TODO - how can this be null?
stoppingMessage.show();
}
}
} );
}
|