1 | public void setEditMenu(JPopupMenu menu) {↵ | | 1 | public void setEditMenu(JPopupMenu menu) {↵
|
2 | menuBar.setEditMenu(menu);↵ | | 2 | menuBar.setEditMenu(menu);↵
|
3 | }↵ | | 3 | }↵
|
|
4 | /**↵ | | 4 | /**↵
|
5 | * Specify whether or not the Edit menu item should be enabled.↵ | | 5 | * Specify whether or not the Edit menu item should be enabled.↵
|
6 | * ↵ | | 6 | * ↵
|
7 | * @param enabled↵ | | 7 | * @param enabled↵
|
8 | * true if the menu item should be enabled, false otherwise↵ | | 8 | * true if the menu item should be enabled, false otherwise↵
|
9 | */↵ | | 9 | */↵
|
10 | public void setEditEnabled(boolean enabled) {↵ | | 10 | public void setEditEnabled(boolean enabled) {↵
|
11 | menuBar.setEditEnabled(enabled);↵ | | 11 | menuBar.setEditEnabled(enabled);↵
|
12 | }↵ | | 12 | }↵
|
|
13 | /**↵ | | 13 | /**↵
|
14 | * Set the menu that should be used for the Edit|Add menu.↵ | | 14 | * Set the menu that should be used for the Edit|Add menu.↵
|
15 | * ↵ | | 15 | * ↵
|
16 | * @param menu↵ | | 16 | * @param menu↵
|
17 | * the new Edit|Add menu↵ | | 17 | * the new Edit|Add menu↵
|
18 | */↵ | | 18 | */↵
|
19 | public void setEditAddMenu(JMenu menu) {↵ | | 19 | public void setEditAddMenu(JMenu menu) {↵
|
20 | menuBar.setEditAddMenu(menu);↵ | | 20 | menuBar.setEditAddMenu(menu);↵
|
21 | }↵ | | 21 | }↵
|
|
22 | /**↵ | | 22 | /**↵
|
23 | * Specify whether or not the Edit|Add menu item should be enabled.↵ | | 23 | * Specify whether or not the Edit|Add menu item should be enabled.↵
|
24 | * ↵ | | 24 | * ↵
|
25 | * @param enabled↵ | | 25 | * @param enabled↵
|
26 | * true if the menu item should be enabled, false otherwise↵ | | 26 | * true if the menu item should be enabled, false otherwise↵
|
27 | */↵ | | 27 | */↵
|
28 | public void setEditAddEnabled(boolean enabled) {↵ | | 28 | public void setEditAddEnabled(boolean enabled) {↵
|
29 | menuBar.setEditAddEnabled(enabled);↵ | | 29 | menuBar.setEditAddEnabled(enabled);↵
|
30 | }↵ | | 30 | }↵
|
|
31 | /**↵ | | 31 | /**↵
|
32 | * Specify whether or not the Edit|Remove menu item should be enabled.↵ | | 32 | * Specify whether or not the Edit|Remove menu item should be enabled.↵
|
33 | * ↵ | | 33 | * ↵
|
34 | * @param enabled↵ | | 34 | * @param enabled↵
|
35 | * true if the menu item should be enabled, false otherwise↵ | | 35 | * true if the menu item should be enabled, false otherwise↵
|
36 | */↵ | | 36 | */↵
|
37 | public void setEditRemoveEnabled(boolean enabled) {↵ | | 37 | public void setEditRemoveEnabled(boolean enabled) {↵
|
38 | menuBar.setEditRemoveEnabled(enabled);↵ | | 38 | menuBar.setEditRemoveEnabled(enabled);↵
|
39 | }↵ | | 39 | }↵
|
|
40 | /**↵ | | 40 | /**↵
|
41 | * Close the currently selected menu.↵ | | 41 | * Close the currently selected menu.↵
|
42 | */↵ | | 42 | */↵
|
43 | public void closeMenu() {↵ | | 43 | public void closeMenu() {↵
|
44 | if (menuBar.isSelected()) {↵ | | 44 | if (menuBar.isSelected()) {↵
|
45 | MenuElement[] menuElement = menuBar.getSubElements();↵ | | 45 | MenuElement[] menuElement = menuBar.getSubElements();↵
|
46 | if (menuElement != null) {↵ | | 46 | if (menuElement != null) {↵
|
47 | for (int i = 0; i < menuElement.length; i++) {↵ | | 47 | for (int i = 0; i < menuElement.length; i++) {↵
|
48 | JMenu menu = (JMenu) menuElement[i];↵ | | 48 | JMenu menu = (JMenu) menuElement[i];↵
|
49 | if (menu.isSelected()) {↵ | | 49 | if (menu.isSelected()) {↵
|
50 | menu.setPopupMenuVisible(false);↵ | | 50 | menu.setPopupMenuVisible(false);↵
|
51 | menu.setSelected(false);↵ | | 51 | menu.setSelected(false);↵
|
52 | break;↵ | | |
|
53 | }↵ | | |
|
54 | }↵ | | |
|
55 | }↵ | | |
|
56 | }↵ | | |
|
57 | }↵ | | |
|
|
58 | ↵ | | 52 | break;↵
|
| | | 53 | }↵
|
| | | 54 | }↵
|
| | | 55 | }↵
|
| | | 56 | }↵
|
| | | 57 | }↵
|
59 | /**↵ | | 58 | /**↵
|
60 | * Show a dialog indicating that JMeter threads are stopping on a particular↵ | | 59 | * Show a dialog indicating that JMeter threads are stopping on a particular↵
|
61 | * host.↵ | | 60 | * host.↵
|
62 | * ↵ | | 61 | * ↵
|
63 | * @param host↵ | | 62 | * @param host↵
|
64 | * the host where JMeter threads are stopping↵ | | 63 | * the host where JMeter threads are stopping↵
|
65 | */↵ | | 64 | */↵
|
66 | public void showStoppingMessage(String host) {↵ | | 65 | public void showStoppingMessage(String host) {↵
|
67 | stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true); //$NON-NLS-1$↵ | | 66 | stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true);// $NON-NLS-1$↵
|
68 | JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host); //$NON-NLS-1$$NON-NLS-2$↵ | | 67 | JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host);// $NON-NLS-1$↵
|
69 | ↵ | | |
|
70 | stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));↵ | | 68 | stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));↵
|
71 | stoppingMessage.getContentPane().add(stopLabel);↵ | | 69 | stoppingMessage.getContentPane().add(stopLabel);↵
|
72 | stoppingMessage.pack();↵ | | 70 | stoppingMessage.pack();↵
|
73 | ComponentUtil.centerComponentInComponent(this, stoppingMessage);↵ | | 71 | ComponentUtil.centerComponentInComponent(this, stoppingMessage);↵
|
74 | SwingUtilities.invokeLater(new Runnable() {↵ | | 72 | SwingUtilities.invokeLater(new Runnable() {↵
|
75 | public void run() {↵ | | 73 | public void run() {↵
|
76 | if (stoppingMessage != null) {// TODO - how can this be null?↵ | | 74 | if (stoppingMessage != null) {↵
|
77 | ↵ | | |
|
78 | stoppingMessage.show() | | 75 | stoppingMessage.show()
|