KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > bridge > apis > AppserverMgmtLeafNode


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.sun.bridge.apis;
20
21 import javax.swing.Action JavaDoc;
22 import org.openide.actions.PropertiesAction;
23 import org.openide.nodes.Children;
24 import org.openide.util.actions.SystemAction;
25
26 /**
27  * The parent class for all appserver plugin management leaf nodes. All leaf
28  * nodes for the NetBeans runtime tab J2EE plugin must extend this class for
29  * effectively communicating via AMX API.
30  */

31 public abstract class AppserverMgmtLeafNode extends AppserverMgmtActiveNode {
32   
33     /**
34      * Abstract constructor for an AppserverLeafNode called by subclass.
35      *
36      * @param nodeType The type of leaf node to construct (e.g. JVM, etc.)
37      */

38     public AppserverMgmtLeafNode(String JavaDoc nodeType) {
39         super(Children.LEAF, nodeType);
40     }
41     
42     /**
43      * Abstract constructor for an AppserverLeafNode called by subclass.
44      *
45      * @param nodeType The type of leaf node to construct (e.g. JVM, etc.)
46      */

47     public AppserverMgmtLeafNode(Controller controller, String JavaDoc nodeType) {
48         super(Children.LEAF, controller, nodeType);
49     }
50     
51     
52     /**
53      * Abstract constructor for an AppserverLeafNode called by subclass.
54      *
55      * @param nodeType The type of leaf node to construct (e.g. JVM, etc.)
56      */

57     public AppserverMgmtLeafNode(final AppserverMgmtController controller,
58             final String JavaDoc nodeType) {
59         super(Children.LEAF, controller, nodeType);
60     }
61     
62   
63     /**
64      * Return the actions associated with the menu drop down seen when
65      * a user right-clicks on a node in the plugin.
66      *
67      * @param boolean true/false
68      * @return An array of Action objects.
69      */

70     public Action JavaDoc[] getActions(boolean flag) {
71         return new SystemAction[] {
72             SystemAction.get(PropertiesAction.class)
73         };
74     }
75     
76     /**
77      * Return the default action for the node
78      * a user double-clicks on a node in the plugin.
79      */

80     public javax.swing.Action JavaDoc getPreferredAction(){
81         return SystemAction.get(PropertiesAction.class);
82     }
83 }
84
Popular Tags