KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > registry > nodes > WebServicesRootNode


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
20 package org.netbeans.modules.websvc.registry.nodes;
21
22 import org.openide.actions.*;
23 import org.openide.nodes.*;
24 import org.openide.util.HelpCtx;
25 import org.openide.util.NbBundle;
26 import org.openide.util.Utilities;
27 import org.openide.util.actions.SystemAction;
28
29 import org.netbeans.modules.websvc.registry.actions.*;
30 import org.netbeans.modules.websvc.registry.model.WebServiceGroup;
31 import org.netbeans.modules.websvc.registry.model.WebServiceListModel;
32 import java.awt.Image JavaDoc;
33 import javax.swing.ImageIcon JavaDoc;
34 import javax.swing.Action JavaDoc;
35
36 /**
37  * The top level node representing Web Services in the Server Navigator
38  * @author octav, Winston Prakash
39  */

40 public class WebServicesRootNode extends AbstractNode implements WebServiceGroupCookie , org.netbeans.modules.websvc.registry.netbeans.WebServicesRootNodeInterface{
41     
42     public WebServicesRootNode() {
43         super(Children.LEAF);// will calculate the children later.
44
setName("default");
45         setDisplayName(NbBundle.getMessage(WebServicesRootNode.class, "Web_Services"));
46         setShortDescription(NbBundle.getMessage(WebServicesRootNode.class, "Web_Services"));
47         setIconBaseWithExtension("org/netbeans/modules/websvc/registry/resources/webservicegroup.png");
48         getCookieSet().add(this);
49     }
50
51     public WebServiceGroup getWebServiceGroup(){
52         return WebServiceListModel.getInstance().getWebServiceGroup("default");
53     }
54     
55
56     
57     public Action[] getActions(boolean context) {
58         return new SystemAction[] {
59             SystemAction.get(AddWebServiceAction.class),
60             SystemAction.get(AddWebServiceGroupAction.class),
61         };
62     }
63     
64     public Action getPreferredAction() {
65         return SystemAction.get(AddWebServiceAction.class);
66     }
67
68     public HelpCtx getHelpCtx() {
69         return new HelpCtx("server_nav_web_svcs_node");
70     }
71     
72
73 }
74
Popular Tags