1 | void closeMenu() {↵ | | 1 | void closeMenu() {↵
|
2 | if (menuBar.isSelected()) {↵ | | 2 | if (menuBar.isSelected()) {↵
|
3 | MenuElement[] menuElement = menuBar.getSubElements();↵ | | 3 | MenuElement[] menuElement = menuBar.getSubElements();↵
|
4 | if (menuElement != null) {↵ | | 4 | if (menuElement != null) {↵
|
5 | for (int i = 0; i < menuElement.length; i++) {↵ | | 5 | for (int i = 0; i < menuElement.length; i++) {↵
|
6 | JMenu menu = (JMenu) menuElement[i];↵ | | 6 | JMenu menu = (JMenu) menuElement[i];↵
|
7 | if (menu.isSelected()) {↵ | | 7 | if (menu.isSelected()) {↵
|
8 | menu.setPopupMenuVisible(false);↵ | | 8 | menu.setPopupMenuVisible(false);↵
|
9 | menu.setSelected(false);↵ | | 9 | menu.setSelected(false);↵
|
10 | break;↵ | | |
|
11 | }↵ | | |
|
12 | }↵ | | |
|
13 | }↵ | | |
|
14 | }↵ | | |
|
15 | }↵ | | |
|
|
16 | ↵ | | 10 | break;↵
|
| | | 11 | }↵
|
| | | 12 | }↵
|
| | | 13 | }↵
|
| | | 14 | }↵
|
| | | 15 | }↵
|
17 | /**↵ | | 16 | /**↵
|
18 | * Show a dialog indicating that JMeter threads are stopping on a particular↵ | | 17 | * Show a dialog indicating that JMeter threads are stopping on a particular↵
|
19 | * host.↵ | | 18 | * host.↵
|
20 | * ↵ | | 19 | * ↵
|
21 | * @param host↵ | | 20 | * @param host↵
|
22 | * the host where JMeter threads are stopping↵ | | 21 | * the host where JMeter threads are stopping↵
|
23 | */↵ | | 22 | */↵
|
24 | public void showStoppingMessage(String host) {↵ | | 23 | public void showStoppingMessage(String host) {↵
|
25 | stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true); //$NON-NLS-1$↵ | | 24 | stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true);// $NON-NLS-1$↵
|
26 | JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host); //$NON-NLS-1$$NON-NLS-2$↵ | | 25 | JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host);// $NON-NLS-1$↵
|
27 | ↵ | | |
|
28 | stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));↵ | | 26 | stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));↵
|
29 | stoppingMessage.getContentPane().add(stopLabel);↵ | | 27 | stoppingMessage.getContentPane().add(stopLabel);↵
|
30 | stoppingMessage.pack();↵ | | 28 | stoppingMessage.pack();↵
|
31 | ComponentUtil.centerComponentInComponent(this, stoppingMessage);↵ | | 29 | ComponentUtil.centerComponentInComponent(this, stoppingMessage);↵
|
32 | SwingUtilities.invokeLater(new Runnable() {↵ | | 30 | SwingUtilities.invokeLater(new Runnable() {↵
|
33 | public void run() {↵ | | 31 | public void run() {↵
|
34 | if (stoppingMessage != null) {// TODO - how can this be null?↵ | | 32 | if (stoppingMessage != null) {↵
|
35 | stoppingMessage.show();↵ | | |
|
36 | }↵ | | |
|
37 | }↵ | | |
|
38 | ↵ | | |
|
| | | 33 | stoppingMessage.show();↵
|
| | | 34 | }↵
|
| | | 35 | }↵
|
39 | });↵ | | 36 | });↵
|
40 | | | 37 |
|