/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
@SuppressWarnings("serial")
implements ActionListener, NotificationListener {
// Node being currently displayed
// MBean being currently displayed
// XMBeanAttributes container
// XMBeanOperations container
// XMBeanNotifications container
// XMBeanInfo container
// Refresh JButton (mbean attributes case)
// Subscribe/Unsubscribe/Clear JButton (mbean notifications case)
// Reference to MBeans tab
setupScreen();
}
public void dispose() {
clear();
}
private void setupScreen() {
setLayout(new BorderLayout());
// add main panel to XSheet
// add south panel to XSheet
southPanel = new JPanel();
// create the refresh button
refreshButton.addActionListener(this);
// create the clear button
clearButton.addActionListener(this);
// create the subscribe button
subscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON));
subscribeButton.addActionListener(this);
// create the unsubscribe button
unsubscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON));
// create XMBeanAttributes container
// create XMBeanOperations container
// create XMBeanNotifications container
mbeanNotifications = new XMBeanNotifications();
// create XMBeanInfo container
mbeanInfo = new XMBeanInfo();
}
return (cn == n);
}
// Call on EDT
}
if (userObject instanceof XNodeInfo) {
}
return false;
}
// Call on EDT
clear();
return;
}
currentNode = node;
if (userObject instanceof XNodeInfo) {
case MBEAN:
break;
case NONMBEAN:
break;
case ATTRIBUTES:
break;
case OPERATIONS:
break;
case NOTIFICATIONS:
break;
case ATTRIBUTE:
case OPERATION:
case NOTIFICATION:
break;
default:
break;
}
} else {
}
}
// Call on EDT
return;
}
return mbean.getMBeanInfo();
}
protected void done() {
try {
return;
}
invalidate();
southPanel.setVisible(false);
validate();
repaint();
}
} catch (Exception e) {
t.printStackTrace();
}
showErrorDialog(t.toString(),
}
}
};
}
// Call on EDT
case ATTRIBUTE:
public MBeanAttributeInfo doInBackground() {
return mbai;
}
protected void done() {
try {
return;
}
invalidate();
new JPanel(new BorderLayout());
new JPanel(new BorderLayout());
new JPanel(new BorderLayout());
refreshButton.setEnabled(true);
southPanel.setVisible(false);
validate();
repaint();
} catch (Exception e) {
"attribute for MBean [" +
t.printStackTrace();
}
showErrorDialog(t.toString(),
}
}
};
break;
case OPERATION:
invalidate();
southPanel.setVisible(false);
validate();
repaint();
break;
case NOTIFICATION:
invalidate();
southPanel.setVisible(false);
validate();
repaint();
break;
}
}
// Call on EDT
return;
}
return mbi;
}
protected void done() {
try {
return;
}
invalidate();
// add the refresh button to the south panel
southPanel.setVisible(true);
refreshButton.setEnabled(true);
validate();
repaint();
}
} catch (Exception e) {
"attributes for MBean [" +
t.printStackTrace();
}
showErrorDialog(t.toString(),
}
}
};
}
// Call on EDT
return;
}
return mbean.getMBeanInfo();
}
protected void done() {
try {
return;
}
invalidate();
southPanel.setVisible(false);
validate();
repaint();
}
} catch (Exception e) {
"operations for MBean [" +
t.printStackTrace();
}
showErrorDialog(t.toString(),
}
}
};
}
// Call on EDT
return;
}
invalidate();
// add the subscribe/unsubscribe/clear buttons to the south panel
southPanel.setVisible(true);
subscribeButton.setEnabled(true);
unsubscribeButton.setEnabled(true);
clearButton.setEnabled(true);
validate();
repaint();
}
// Call on EDT
private void displayEmptyNode() {
invalidate();
validate();
repaint();
}
/**
* Subscribe button action.
*/
private void registerListener() {
public Void doInBackground()
throws InstanceNotFoundException, IOException {
return null;
}
protected void done() {
try {
get();
validate();
} catch (Exception e) {
t.printStackTrace();
}
}
}
}.execute();
}
/**
* Unsubscribe button action.
*/
private void unregisterListener() {
public Boolean doInBackground() {
}
protected void done() {
try {
if (get()) {
validate();
}
} catch (Exception e) {
t.printStackTrace();
}
}
}
}.execute();
}
/**
* Refresh button action.
*/
private void refreshAttributes() {
}
// Call on EDT
private void updateNotifications() {
} else {
}
}
/**
* Update notification node label in MBean tree: "Notifications[received]".
*/
// Call on EDT
private void updateReceivedNotifications(
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) mbeansTab.getTree().getLastSelectedPathComponent();
}
}
/**
* Update notification node label in MBean tree: "Notifications".
*/
// Call on EDT
private void clearNotifications() {
}
/**
* Update notification node label in MBean tree: "Notifications[0]".
*/
// Call on EDT
private void clearNotifications0() {
}
/**
* Update the label of the supplied MBean tree node.
*/
// Call on EDT
private void updateNotificationsNodeLabel(
invalidate();
validate();
repaint();
}
}
/**
* Clear button action.
*/
// Call on EDT
private void clearCurrentNotifications() {
// Update notifs in MBean tree "Notifications[0]".
//
// Notification buffer has been cleared with a listener been
// registered so add "[0]" at the end of the node label.
//
} else {
// Update notifs in MBean tree "Notifications".
//
// Notification buffer has been cleared without a listener been
// registered so don't add "[0]" at the end of the node label.
//
}
}
// Call on EDT
private void clear() {
currentNode = null;
}
/**
* Notification listener: handles asynchronous reception
* of MBean operation results and MBean notifications.
*/
// Call on EDT
// Operation result
textArea.setEditable(false);
textArea.setEnabled(true);
} else {
textArea.setEditable(false);
textArea.setEnabled(true);
}
} else {
if (!(comp instanceof JScrollPane)) {
}
}
}
}
new ThreadDialog(
} // Got notification
}
}
/**
* Action listener: handles actions in panel buttons
*/
// Call on EDT
// Refresh button
if (button == refreshButton) {
return;
}
// Clear button
if (button == clearButton) {
return;
}
// Subscribe button
if (button == subscribeButton) {
return;
}
// Unsubscribe button
if (button == unsubscribeButton) {
return;
}
}
}
}