author | xdono |
Wed, 02 Jul 2008 12:55:45 -0700 | |
changeset 715 | f16baef3a20e |
parent 55 | 5ecee29e98d8 |
child 1017 | 8d24d37ceed8 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
715 | 2 |
* Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
package sun.tools.jconsole.inspector; |
|
27 |
||
28 |
import java.awt.*; |
|
29 |
import java.awt.event.*; |
|
30 |
import java.io.*; |
|
31 |
import javax.management.*; |
|
32 |
import javax.swing.*; |
|
33 |
import javax.swing.border.*; |
|
34 |
import javax.swing.tree.*; |
|
35 |
import sun.tools.jconsole.*; |
|
36 |
import sun.tools.jconsole.inspector.XNodeInfo.Type; |
|
37 |
||
38 |
import static sun.tools.jconsole.Resources.*; |
|
39 |
import static sun.tools.jconsole.Utilities.*; |
|
40 |
||
41 |
@SuppressWarnings("serial") |
|
42 |
public class XSheet extends JPanel |
|
43 |
implements ActionListener, NotificationListener { |
|
44 |
||
45 |
private JPanel mainPanel; |
|
46 |
private JPanel southPanel; |
|
47 |
// Node being currently displayed |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
48 |
private volatile DefaultMutableTreeNode currentNode; |
2 | 49 |
// MBean being currently displayed |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
50 |
private volatile XMBean mbean; |
2 | 51 |
// XMBeanAttributes container |
52 |
private XMBeanAttributes mbeanAttributes; |
|
53 |
// XMBeanOperations container |
|
54 |
private XMBeanOperations mbeanOperations; |
|
55 |
// XMBeanNotifications container |
|
56 |
private XMBeanNotifications mbeanNotifications; |
|
57 |
// XMBeanInfo container |
|
58 |
private XMBeanInfo mbeanInfo; |
|
59 |
// Refresh JButton (mbean attributes case) |
|
60 |
private JButton refreshButton; |
|
61 |
// Subscribe/Unsubscribe/Clear JButton (mbean notifications case) |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
62 |
private JButton clearButton, subscribeButton, unsubscribeButton; |
2 | 63 |
// Reference to MBeans tab |
64 |
private MBeansTab mbeansTab; |
|
65 |
||
66 |
public XSheet(MBeansTab mbeansTab) { |
|
67 |
this.mbeansTab = mbeansTab; |
|
68 |
setupScreen(); |
|
69 |
} |
|
70 |
||
71 |
public void dispose() { |
|
72 |
clear(); |
|
73 |
XDataViewer.dispose(mbeansTab); |
|
74 |
mbeanNotifications.dispose(); |
|
75 |
} |
|
76 |
||
77 |
private void setupScreen() { |
|
78 |
setLayout(new BorderLayout()); |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
79 |
setBorder(BorderFactory.createLineBorder(Color.GRAY)); |
2 | 80 |
// add main panel to XSheet |
81 |
mainPanel = new JPanel(); |
|
82 |
mainPanel.setLayout(new BorderLayout()); |
|
83 |
add(mainPanel, BorderLayout.CENTER); |
|
84 |
// add south panel to XSheet |
|
85 |
southPanel = new JPanel(); |
|
86 |
add(southPanel, BorderLayout.SOUTH); |
|
87 |
// create the refresh button |
|
88 |
String refreshButtonKey = "MBeansTab.refreshAttributesButton"; |
|
89 |
refreshButton = new JButton(getText(refreshButtonKey)); |
|
90 |
refreshButton.setMnemonic(getMnemonicInt(refreshButtonKey)); |
|
91 |
refreshButton.setToolTipText(getText(refreshButtonKey + ".toolTip")); |
|
92 |
refreshButton.addActionListener(this); |
|
93 |
// create the clear button |
|
94 |
String clearButtonKey = "MBeansTab.clearNotificationsButton"; |
|
95 |
clearButton = new JButton(getText(clearButtonKey)); |
|
96 |
clearButton.setMnemonic(getMnemonicInt(clearButtonKey)); |
|
97 |
clearButton.setToolTipText(getText(clearButtonKey + ".toolTip")); |
|
98 |
clearButton.addActionListener(this); |
|
99 |
// create the subscribe button |
|
100 |
String subscribeButtonKey = "MBeansTab.subscribeNotificationsButton"; |
|
101 |
subscribeButton = new JButton(getText(subscribeButtonKey)); |
|
102 |
subscribeButton.setMnemonic(getMnemonicInt(subscribeButtonKey)); |
|
103 |
subscribeButton.setToolTipText(getText(subscribeButtonKey + ".toolTip")); |
|
104 |
subscribeButton.addActionListener(this); |
|
105 |
// create the unsubscribe button |
|
106 |
String unsubscribeButtonKey = "MBeansTab.unsubscribeNotificationsButton"; |
|
107 |
unsubscribeButton = new JButton(getText(unsubscribeButtonKey)); |
|
108 |
unsubscribeButton.setMnemonic(getMnemonicInt(unsubscribeButtonKey)); |
|
109 |
unsubscribeButton.setToolTipText(getText(unsubscribeButtonKey + ".toolTip")); |
|
110 |
unsubscribeButton.addActionListener(this); |
|
111 |
// create XMBeanAttributes container |
|
112 |
mbeanAttributes = new XMBeanAttributes(mbeansTab); |
|
113 |
// create XMBeanOperations container |
|
114 |
mbeanOperations = new XMBeanOperations(mbeansTab); |
|
115 |
mbeanOperations.addOperationsListener(this); |
|
116 |
// create XMBeanNotifications container |
|
117 |
mbeanNotifications = new XMBeanNotifications(); |
|
118 |
mbeanNotifications.addNotificationsListener(this); |
|
119 |
// create XMBeanInfo container |
|
120 |
mbeanInfo = new XMBeanInfo(); |
|
121 |
} |
|
122 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
123 |
private boolean isSelectedNode(DefaultMutableTreeNode n, DefaultMutableTreeNode cn) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
124 |
return (cn == n); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
125 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
126 |
|
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
127 |
// Call on EDT |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
128 |
private void showErrorDialog(Object message, String title) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
129 |
new ThreadDialog(this, message, title, JOptionPane.ERROR_MESSAGE).run(); |
2 | 130 |
} |
131 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
132 |
public boolean isMBeanNode(DefaultMutableTreeNode node) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
133 |
Object userObject = node.getUserObject(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
134 |
if (userObject instanceof XNodeInfo) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
135 |
XNodeInfo uo = (XNodeInfo) userObject; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
136 |
return uo.getType().equals(Type.MBEAN); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
137 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
138 |
return false; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
139 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
140 |
|
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
141 |
// Call on EDT |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
142 |
public synchronized void displayNode(DefaultMutableTreeNode node) { |
2 | 143 |
clear(); |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
144 |
displayEmptyNode(); |
2 | 145 |
if (node == null) { |
146 |
return; |
|
147 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
148 |
currentNode = node; |
2 | 149 |
Object userObject = node.getUserObject(); |
150 |
if (userObject instanceof XNodeInfo) { |
|
151 |
XNodeInfo uo = (XNodeInfo) userObject; |
|
152 |
switch (uo.getType()) { |
|
153 |
case MBEAN: |
|
154 |
displayMBeanNode(node); |
|
155 |
break; |
|
156 |
case NONMBEAN: |
|
157 |
displayEmptyNode(); |
|
158 |
break; |
|
159 |
case ATTRIBUTES: |
|
160 |
displayMBeanAttributesNode(node); |
|
161 |
break; |
|
162 |
case OPERATIONS: |
|
163 |
displayMBeanOperationsNode(node); |
|
164 |
break; |
|
165 |
case NOTIFICATIONS: |
|
166 |
displayMBeanNotificationsNode(node); |
|
167 |
break; |
|
168 |
case ATTRIBUTE: |
|
169 |
case OPERATION: |
|
170 |
case NOTIFICATION: |
|
171 |
displayMetadataNode(node); |
|
172 |
break; |
|
173 |
default: |
|
174 |
displayEmptyNode(); |
|
175 |
break; |
|
176 |
} |
|
177 |
} else { |
|
178 |
displayEmptyNode(); |
|
179 |
} |
|
180 |
} |
|
181 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
182 |
// Call on EDT |
2 | 183 |
private void displayMBeanNode(final DefaultMutableTreeNode node) { |
184 |
final XNodeInfo uo = (XNodeInfo) node.getUserObject(); |
|
185 |
if (!uo.getType().equals(Type.MBEAN)) { |
|
186 |
return; |
|
187 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
188 |
mbean = (XMBean) uo.getData(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
189 |
SwingWorker<MBeanInfo, Void> sw = new SwingWorker<MBeanInfo, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
190 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
191 |
public MBeanInfo doInBackground() throws InstanceNotFoundException, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
192 |
IntrospectionException, ReflectionException, IOException { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
193 |
return mbean.getMBeanInfo(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
194 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
195 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
196 |
protected void done() { |
2 | 197 |
try { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
198 |
MBeanInfo mbi = get(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
199 |
if (mbi != null) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
200 |
if (!isSelectedNode(node, currentNode)) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
201 |
return; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
202 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
203 |
mbeanInfo.addMBeanInfo(mbean, mbi); |
2 | 204 |
invalidate(); |
205 |
mainPanel.removeAll(); |
|
206 |
mainPanel.add(mbeanInfo, BorderLayout.CENTER); |
|
207 |
southPanel.setVisible(false); |
|
208 |
southPanel.removeAll(); |
|
209 |
validate(); |
|
210 |
repaint(); |
|
211 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
212 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
213 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
214 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
215 |
System.err.println("Couldn't get MBeanInfo for MBean [" + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
216 |
mbean.getObjectName() + "]"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
217 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
218 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
219 |
showErrorDialog(t.toString(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
220 |
Resources.getText("Problem displaying MBean")); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
221 |
} |
2 | 222 |
} |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
223 |
}; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
224 |
sw.execute(); |
2 | 225 |
} |
226 |
||
227 |
// Call on EDT |
|
228 |
private void displayMetadataNode(final DefaultMutableTreeNode node) { |
|
229 |
final XNodeInfo uo = (XNodeInfo) node.getUserObject(); |
|
230 |
final XMBeanInfo mbi = mbeanInfo; |
|
231 |
switch (uo.getType()) { |
|
232 |
case ATTRIBUTE: |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
233 |
SwingWorker<MBeanAttributeInfo, Void> sw = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
234 |
new SwingWorker<MBeanAttributeInfo, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
235 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
236 |
public MBeanAttributeInfo doInBackground() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
237 |
Object attrData = uo.getData(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
238 |
mbean = (XMBean) ((Object[]) attrData)[0]; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
239 |
MBeanAttributeInfo mbai = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
240 |
(MBeanAttributeInfo) ((Object[]) attrData)[1]; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
241 |
mbeanAttributes.loadAttributes(mbean, new MBeanInfo( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
242 |
null, null, new MBeanAttributeInfo[]{mbai}, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
243 |
null, null, null)); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
244 |
return mbai; |
2 | 245 |
} |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
246 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
247 |
protected void done() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
248 |
try { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
249 |
MBeanAttributeInfo mbai = get(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
250 |
if (!isSelectedNode(node, currentNode)) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
251 |
return; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
252 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
253 |
invalidate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
254 |
mainPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
255 |
JPanel attributePanel = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
256 |
new JPanel(new BorderLayout()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
257 |
JPanel attributeBorderPanel = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
258 |
new JPanel(new BorderLayout()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
259 |
attributeBorderPanel.setBorder( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
260 |
BorderFactory.createTitledBorder( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
261 |
Resources.getText("Attribute value"))); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
262 |
JPanel attributeValuePanel = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
263 |
new JPanel(new BorderLayout()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
264 |
attributeValuePanel.setBorder( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
265 |
LineBorder.createGrayLineBorder()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
266 |
attributeValuePanel.add(mbeanAttributes.getTableHeader(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
267 |
BorderLayout.PAGE_START); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
268 |
attributeValuePanel.add(mbeanAttributes, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
269 |
BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
270 |
attributeBorderPanel.add(attributeValuePanel, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
271 |
BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
272 |
JPanel refreshButtonPanel = new JPanel(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
273 |
refreshButtonPanel.add(refreshButton); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
274 |
attributeBorderPanel.add(refreshButtonPanel, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
275 |
BorderLayout.SOUTH); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
276 |
refreshButton.setEnabled(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
277 |
attributePanel.add(attributeBorderPanel, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
278 |
BorderLayout.NORTH); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
279 |
mbi.addMBeanAttributeInfo(mbai); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
280 |
attributePanel.add(mbi, BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
281 |
mainPanel.add(attributePanel, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
282 |
BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
283 |
southPanel.setVisible(false); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
284 |
southPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
285 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
286 |
repaint(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
287 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
288 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
289 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
290 |
System.err.println("Problem displaying MBean " + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
291 |
"attribute for MBean [" + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
292 |
mbean.getObjectName() + "]"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
293 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
294 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
295 |
showErrorDialog(t.toString(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
296 |
Resources.getText("Problem displaying MBean")); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
297 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
298 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
299 |
}; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
300 |
sw.execute(); |
2 | 301 |
break; |
302 |
case OPERATION: |
|
303 |
Object operData = uo.getData(); |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
304 |
mbean = (XMBean) ((Object[]) operData)[0]; |
2 | 305 |
MBeanOperationInfo mboi = |
306 |
(MBeanOperationInfo) ((Object[]) operData)[1]; |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
307 |
mbeanOperations.loadOperations(mbean, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
308 |
new MBeanInfo(null, null, null, null, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
309 |
new MBeanOperationInfo[]{mboi}, null)); |
2 | 310 |
invalidate(); |
311 |
mainPanel.removeAll(); |
|
312 |
JPanel operationPanel = new JPanel(new BorderLayout()); |
|
313 |
JPanel operationBorderPanel = new JPanel(new BorderLayout()); |
|
314 |
operationBorderPanel.setBorder(BorderFactory.createTitledBorder( |
|
315 |
Resources.getText("Operation invocation"))); |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
316 |
operationBorderPanel.add(new JScrollPane(mbeanOperations)); |
2 | 317 |
operationPanel.add(operationBorderPanel, BorderLayout.NORTH); |
318 |
mbi.addMBeanOperationInfo(mboi); |
|
319 |
operationPanel.add(mbi, BorderLayout.CENTER); |
|
320 |
mainPanel.add(operationPanel, BorderLayout.CENTER); |
|
321 |
southPanel.setVisible(false); |
|
322 |
southPanel.removeAll(); |
|
323 |
validate(); |
|
324 |
repaint(); |
|
325 |
break; |
|
326 |
case NOTIFICATION: |
|
327 |
Object notifData = uo.getData(); |
|
328 |
invalidate(); |
|
329 |
mainPanel.removeAll(); |
|
330 |
mbi.addMBeanNotificationInfo((MBeanNotificationInfo) notifData); |
|
331 |
mainPanel.add(mbi, BorderLayout.CENTER); |
|
332 |
southPanel.setVisible(false); |
|
333 |
southPanel.removeAll(); |
|
334 |
validate(); |
|
335 |
repaint(); |
|
336 |
break; |
|
337 |
} |
|
338 |
} |
|
339 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
340 |
// Call on EDT |
2 | 341 |
private void displayMBeanAttributesNode(final DefaultMutableTreeNode node) { |
342 |
final XNodeInfo uo = (XNodeInfo) node.getUserObject(); |
|
343 |
if (!uo.getType().equals(Type.ATTRIBUTES)) { |
|
344 |
return; |
|
345 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
346 |
mbean = (XMBean) uo.getData(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
347 |
SwingWorker<Void, Void> sw = new SwingWorker<Void, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
348 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
349 |
public Void doInBackground() throws InstanceNotFoundException, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
350 |
IntrospectionException, ReflectionException, IOException { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
351 |
mbeanAttributes.loadAttributes(mbean, mbean.getMBeanInfo()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
352 |
return null; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
353 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
354 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
355 |
protected void done() { |
2 | 356 |
try { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
357 |
get(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
358 |
if (!isSelectedNode(node, currentNode)) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
359 |
return; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
360 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
361 |
invalidate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
362 |
mainPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
363 |
JPanel borderPanel = new JPanel(new BorderLayout()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
364 |
borderPanel.setBorder(BorderFactory.createTitledBorder( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
365 |
Resources.getText("Attribute values"))); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
366 |
borderPanel.add(new JScrollPane(mbeanAttributes)); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
367 |
mainPanel.add(borderPanel, BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
368 |
// add the refresh button to the south panel |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
369 |
southPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
370 |
southPanel.add(refreshButton, BorderLayout.SOUTH); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
371 |
southPanel.setVisible(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
372 |
refreshButton.setEnabled(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
373 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
374 |
repaint(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
375 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
376 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
377 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
378 |
System.err.println("Problem displaying MBean " + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
379 |
"attributes for MBean [" + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
380 |
mbean.getObjectName() + "]"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
381 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
382 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
383 |
showErrorDialog(t.toString(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
384 |
Resources.getText("Problem displaying MBean")); |
2 | 385 |
} |
386 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
387 |
}; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
388 |
sw.execute(); |
2 | 389 |
} |
390 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
391 |
// Call on EDT |
2 | 392 |
private void displayMBeanOperationsNode(final DefaultMutableTreeNode node) { |
393 |
final XNodeInfo uo = (XNodeInfo) node.getUserObject(); |
|
394 |
if (!uo.getType().equals(Type.OPERATIONS)) { |
|
395 |
return; |
|
396 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
397 |
mbean = (XMBean) uo.getData(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
398 |
SwingWorker<MBeanInfo, Void> sw = new SwingWorker<MBeanInfo, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
399 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
400 |
public MBeanInfo doInBackground() throws InstanceNotFoundException, |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
401 |
IntrospectionException, ReflectionException, IOException { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
402 |
return mbean.getMBeanInfo(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
403 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
404 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
405 |
protected void done() { |
2 | 406 |
try { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
407 |
MBeanInfo mbi = get(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
408 |
if (mbi != null) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
409 |
if (!isSelectedNode(node, currentNode)) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
410 |
return; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
411 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
412 |
mbeanOperations.loadOperations(mbean, mbi); |
2 | 413 |
invalidate(); |
414 |
mainPanel.removeAll(); |
|
415 |
JPanel borderPanel = new JPanel(new BorderLayout()); |
|
416 |
borderPanel.setBorder(BorderFactory.createTitledBorder( |
|
417 |
Resources.getText("Operation invocation"))); |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
418 |
borderPanel.add(new JScrollPane(mbeanOperations)); |
2 | 419 |
mainPanel.add(borderPanel, BorderLayout.CENTER); |
420 |
southPanel.setVisible(false); |
|
421 |
southPanel.removeAll(); |
|
422 |
validate(); |
|
423 |
repaint(); |
|
424 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
425 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
426 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
427 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
428 |
System.err.println("Problem displaying MBean " + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
429 |
"operations for MBean [" + |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
430 |
mbean.getObjectName() + "]"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
431 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
432 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
433 |
showErrorDialog(t.toString(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
434 |
Resources.getText("Problem displaying MBean")); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
435 |
} |
2 | 436 |
} |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
437 |
}; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
438 |
sw.execute(); |
2 | 439 |
} |
440 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
441 |
// Call on EDT |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
442 |
private void displayMBeanNotificationsNode(DefaultMutableTreeNode node) { |
2 | 443 |
final XNodeInfo uo = (XNodeInfo) node.getUserObject(); |
444 |
if (!uo.getType().equals(Type.NOTIFICATIONS)) { |
|
445 |
return; |
|
446 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
447 |
mbean = (XMBean) uo.getData(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
448 |
mbeanNotifications.loadNotifications(mbean); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
449 |
updateNotifications(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
450 |
invalidate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
451 |
mainPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
452 |
JPanel borderPanel = new JPanel(new BorderLayout()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
453 |
borderPanel.setBorder(BorderFactory.createTitledBorder( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
454 |
Resources.getText("Notification buffer"))); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
455 |
borderPanel.add(new JScrollPane(mbeanNotifications)); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
456 |
mainPanel.add(borderPanel, BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
457 |
// add the subscribe/unsubscribe/clear buttons to the south panel |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
458 |
southPanel.removeAll(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
459 |
southPanel.add(subscribeButton, BorderLayout.WEST); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
460 |
southPanel.add(unsubscribeButton, BorderLayout.CENTER); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
461 |
southPanel.add(clearButton, BorderLayout.EAST); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
462 |
southPanel.setVisible(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
463 |
subscribeButton.setEnabled(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
464 |
unsubscribeButton.setEnabled(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
465 |
clearButton.setEnabled(true); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
466 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
467 |
repaint(); |
2 | 468 |
} |
469 |
||
470 |
// Call on EDT |
|
471 |
private void displayEmptyNode() { |
|
472 |
invalidate(); |
|
473 |
mainPanel.removeAll(); |
|
474 |
southPanel.removeAll(); |
|
475 |
validate(); |
|
476 |
repaint(); |
|
477 |
} |
|
478 |
||
479 |
/** |
|
480 |
* Subscribe button action. |
|
481 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
482 |
private void registerListener() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
483 |
new SwingWorker<Void, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
484 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
485 |
public Void doInBackground() |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
486 |
throws InstanceNotFoundException, IOException { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
487 |
mbeanNotifications.registerListener(currentNode); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
488 |
return null; |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
489 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
490 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
491 |
protected void done() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
492 |
try { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
493 |
get(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
494 |
updateNotifications(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
495 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
496 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
497 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
498 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
499 |
System.err.println("Problem adding listener"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
500 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
501 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
502 |
showErrorDialog(t.getMessage(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
503 |
Resources.getText("Problem adding listener")); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
504 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
505 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
506 |
}.execute(); |
2 | 507 |
} |
508 |
||
509 |
/** |
|
510 |
* Unsubscribe button action. |
|
511 |
*/ |
|
512 |
private void unregisterListener() { |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
513 |
new SwingWorker<Boolean, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
514 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
515 |
public Boolean doInBackground() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
516 |
return mbeanNotifications.unregisterListener(currentNode); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
517 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
518 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
519 |
protected void done() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
520 |
try { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
521 |
if (get()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
522 |
updateNotifications(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
523 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
524 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
525 |
} catch (Exception e) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
526 |
Throwable t = Utils.getActualException(e); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
527 |
if (JConsole.isDebug()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
528 |
System.err.println("Problem removing listener"); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
529 |
t.printStackTrace(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
530 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
531 |
showErrorDialog(t.getMessage(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
532 |
Resources.getText("Problem removing listener")); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
533 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
534 |
} |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
535 |
}.execute(); |
2 | 536 |
} |
537 |
||
538 |
/** |
|
539 |
* Refresh button action. |
|
540 |
*/ |
|
541 |
private void refreshAttributes() { |
|
542 |
mbeanAttributes.refreshAttributes(); |
|
543 |
} |
|
544 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
545 |
// Call on EDT |
2 | 546 |
private void updateNotifications() { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
547 |
if (mbeanNotifications.isListenerRegistered(mbean)) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
548 |
long received = mbeanNotifications.getReceivedNotifications(mbean); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
549 |
updateReceivedNotifications(currentNode, received, false); |
2 | 550 |
} else { |
551 |
clearNotifications(); |
|
552 |
} |
|
553 |
} |
|
554 |
||
555 |
/** |
|
556 |
* Update notification node label in MBean tree: "Notifications[received]". |
|
557 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
558 |
// Call on EDT |
2 | 559 |
private void updateReceivedNotifications( |
560 |
DefaultMutableTreeNode emitter, long received, boolean bold) { |
|
561 |
String text = Resources.getText("Notifications") + "[" + received + "]"; |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
562 |
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) mbeansTab.getTree().getLastSelectedPathComponent(); |
2 | 563 |
if (bold && emitter != selectedNode) { |
564 |
text = "<html><b>" + text + "</b></html>"; |
|
565 |
} |
|
566 |
updateNotificationsNodeLabel(emitter, text); |
|
567 |
} |
|
568 |
||
569 |
/** |
|
570 |
* Update notification node label in MBean tree: "Notifications". |
|
571 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
572 |
// Call on EDT |
2 | 573 |
private void clearNotifications() { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
574 |
updateNotificationsNodeLabel(currentNode, |
2 | 575 |
Resources.getText("Notifications")); |
576 |
} |
|
577 |
||
578 |
/** |
|
579 |
* Update notification node label in MBean tree: "Notifications[0]". |
|
580 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
581 |
// Call on EDT |
2 | 582 |
private void clearNotifications0() { |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
583 |
updateNotificationsNodeLabel(currentNode, |
2 | 584 |
Resources.getText("Notifications") + "[0]"); |
585 |
} |
|
586 |
||
587 |
/** |
|
588 |
* Update the label of the supplied MBean tree node. |
|
589 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
590 |
// Call on EDT |
2 | 591 |
private void updateNotificationsNodeLabel( |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
592 |
DefaultMutableTreeNode node, String label) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
593 |
synchronized (mbeansTab.getTree()) { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
594 |
invalidate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
595 |
XNodeInfo oldUserObject = (XNodeInfo) node.getUserObject(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
596 |
XNodeInfo newUserObject = new XNodeInfo( |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
597 |
oldUserObject.getType(), oldUserObject.getData(), |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
598 |
label, oldUserObject.getToolTipText()); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
599 |
node.setUserObject(newUserObject); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
600 |
DefaultTreeModel model = |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
601 |
(DefaultTreeModel) mbeansTab.getTree().getModel(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
602 |
model.nodeChanged(node); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
603 |
validate(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
604 |
repaint(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
605 |
} |
2 | 606 |
} |
607 |
||
608 |
/** |
|
609 |
* Clear button action. |
|
610 |
*/ |
|
611 |
// Call on EDT |
|
612 |
private void clearCurrentNotifications() { |
|
613 |
mbeanNotifications.clearCurrentNotifications(); |
|
614 |
if (mbeanNotifications.isListenerRegistered(mbean)) { |
|
615 |
// Update notifs in MBean tree "Notifications[0]". |
|
616 |
// |
|
617 |
// Notification buffer has been cleared with a listener been |
|
618 |
// registered so add "[0]" at the end of the node label. |
|
619 |
// |
|
620 |
clearNotifications0(); |
|
621 |
} else { |
|
622 |
// Update notifs in MBean tree "Notifications". |
|
623 |
// |
|
624 |
// Notification buffer has been cleared without a listener been |
|
625 |
// registered so don't add "[0]" at the end of the node label. |
|
626 |
// |
|
627 |
clearNotifications(); |
|
628 |
} |
|
629 |
} |
|
630 |
||
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
631 |
// Call on EDT |
2 | 632 |
private void clear() { |
633 |
mbeanAttributes.stopCellEditing(); |
|
634 |
mbeanAttributes.emptyTable(); |
|
635 |
mbeanAttributes.removeAttributes(); |
|
636 |
mbeanOperations.removeOperations(); |
|
637 |
mbeanNotifications.stopCellEditing(); |
|
638 |
mbeanNotifications.emptyTable(); |
|
639 |
mbeanNotifications.disableNotifications(); |
|
640 |
mbean = null; |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
641 |
currentNode = null; |
2 | 642 |
} |
643 |
||
644 |
/** |
|
645 |
* Notification listener: handles asynchronous reception |
|
646 |
* of MBean operation results and MBean notifications. |
|
647 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
648 |
// Call on EDT |
2 | 649 |
public void handleNotification(Notification e, Object handback) { |
650 |
// Operation result |
|
651 |
if (e.getType().equals(XOperations.OPERATION_INVOCATION_EVENT)) { |
|
652 |
final Object message; |
|
653 |
if (handback == null) { |
|
654 |
JTextArea textArea = new JTextArea("null"); |
|
655 |
textArea.setEditable(false); |
|
656 |
textArea.setEnabled(true); |
|
657 |
textArea.setRows(textArea.getLineCount()); |
|
658 |
message = textArea; |
|
659 |
} else { |
|
660 |
Component comp = mbeansTab.getDataViewer(). |
|
661 |
createOperationViewer(handback, mbean); |
|
662 |
if (comp == null) { |
|
663 |
JTextArea textArea = new JTextArea(handback.toString()); |
|
664 |
textArea.setEditable(false); |
|
665 |
textArea.setEnabled(true); |
|
666 |
textArea.setRows(textArea.getLineCount()); |
|
667 |
JScrollPane scrollPane = new JScrollPane(textArea); |
|
668 |
Dimension d = scrollPane.getPreferredSize(); |
|
669 |
if (d.getWidth() > 400 || d.getHeight() > 250) { |
|
670 |
scrollPane.setPreferredSize(new Dimension(400, 250)); |
|
671 |
} |
|
672 |
message = scrollPane; |
|
673 |
} else { |
|
674 |
if (!(comp instanceof JScrollPane)) { |
|
675 |
comp = new JScrollPane(comp); |
|
676 |
} |
|
677 |
Dimension d = comp.getPreferredSize(); |
|
678 |
if (d.getWidth() > 400 || d.getHeight() > 250) { |
|
679 |
comp.setPreferredSize(new Dimension(400, 250)); |
|
680 |
} |
|
681 |
message = comp; |
|
682 |
} |
|
683 |
} |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
684 |
new ThreadDialog( |
2 | 685 |
(Component) e.getSource(), |
686 |
message, |
|
687 |
Resources.getText("Operation return value"), |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
688 |
JOptionPane.INFORMATION_MESSAGE).run(); |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
689 |
} // Got notification |
2 | 690 |
else if (e.getType().equals( |
691 |
XMBeanNotifications.NOTIFICATION_RECEIVED_EVENT)) { |
|
692 |
DefaultMutableTreeNode emitter = (DefaultMutableTreeNode) handback; |
|
693 |
Long received = (Long) e.getUserData(); |
|
694 |
updateReceivedNotifications(emitter, received.longValue(), true); |
|
695 |
} |
|
696 |
} |
|
697 |
||
698 |
/** |
|
699 |
* Action listener: handles actions in panel buttons |
|
700 |
*/ |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
701 |
// Call on EDT |
2 | 702 |
public void actionPerformed(ActionEvent e) { |
703 |
if (e.getSource() instanceof JButton) { |
|
704 |
JButton button = (JButton) e.getSource(); |
|
705 |
// Refresh button |
|
706 |
if (button == refreshButton) { |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
707 |
new SwingWorker<Void, Void>() { |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
708 |
@Override |
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
709 |
public Void doInBackground() { |
2 | 710 |
refreshAttributes(); |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
711 |
return null; |
2 | 712 |
} |
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
713 |
}.execute(); |
2 | 714 |
return; |
715 |
} |
|
716 |
// Clear button |
|
717 |
if (button == clearButton) { |
|
718 |
clearCurrentNotifications(); |
|
719 |
return; |
|
720 |
} |
|
721 |
// Subscribe button |
|
722 |
if (button == subscribeButton) { |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
723 |
registerListener(); |
2 | 724 |
return; |
725 |
} |
|
726 |
// Unsubscribe button |
|
727 |
if (button == unsubscribeButton) { |
|
55
5ecee29e98d8
6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents:
2
diff
changeset
|
728 |
unregisterListener(); |
2 | 729 |
return; |
730 |
} |
|
731 |
} |
|
732 |
} |
|
733 |
} |