KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > ui > netbeans > module > WSDLTreeViewMultiViewDesc


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.wsdl.ui.netbeans.module;
21
22 import java.io.IOException JavaDoc;
23 import java.io.ObjectInput JavaDoc;
24 import java.io.ObjectOutput JavaDoc;
25 import java.io.Serializable JavaDoc;
26
27 import org.netbeans.core.spi.multiview.MultiViewDescription;
28 import org.netbeans.core.spi.multiview.MultiViewElement;
29 import org.openide.util.HelpCtx;
30 import org.openide.util.NbBundle;
31 import org.openide.util.Utilities;
32 import org.openide.windows.TopComponent;
33
34 /**
35  *
36  * @author Jeri Lockhart
37  */

38 public class WSDLTreeViewMultiViewDesc extends Object JavaDoc
39     implements MultiViewDescription, Serializable JavaDoc {
40     
41     
42     /**
43      *
44      */

45     private static final long serialVersionUID = 2580263536201519563L;
46     public static final String JavaDoc PREFERRED_ID = "wsdl-treeview";
47     private WSDLDataObject wsdlDataObject;
48     
49     /**
50      *
51      *
52      */

53     public WSDLTreeViewMultiViewDesc() {
54         super();
55     }
56
57
58     /**
59      *
60      *
61      */

62     public WSDLTreeViewMultiViewDesc(WSDLDataObject wsdlDataObject) {
63         this.wsdlDataObject = wsdlDataObject;
64     }
65
66
67     /**
68      *
69      *
70      */

71     public String JavaDoc preferredID() {
72         return PREFERRED_ID;
73     }
74
75
76     /**
77      *
78      *
79      */

80     public int getPersistenceType() {
81         return TopComponent.PERSISTENCE_NEVER;
82     }
83
84
85     /**
86      *
87      *
88      */

89     public java.awt.Image JavaDoc getIcon() {
90         return Utilities.loadImage(WSDLDataObject.WSDL_ICON_BASE_WITH_EXT);
91     }
92
93
94         public HelpCtx getHelpCtx() {
95             return new HelpCtx(WSDLTreeViewMultiViewDesc.class);
96         }
97
98
99     /**
100      *
101      *
102      */

103     public String JavaDoc getDisplayName() {
104         return NbBundle.getMessage(WSDLTreeViewMultiViewDesc.class,
105             "LBL_designView_name");
106     }
107
108
109     /**
110      *
111      *
112      */

113     public MultiViewElement createElement() {
114             return new WSDLTreeViewMultiViewElement(wsdlDataObject);
115     }
116
117
118     /**
119      *
120      *
121      */

122     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
123         out.writeObject(wsdlDataObject);
124     }
125
126
127     /**
128      *
129      *
130      */

131     public void readExternal(ObjectInput JavaDoc in)
132         throws IOException JavaDoc, ClassNotFoundException JavaDoc
133     {
134         Object JavaDoc firstObject = in.readObject();
135         if (firstObject instanceof WSDLDataObject)
136             wsdlDataObject = (WSDLDataObject) firstObject;
137     }
138 }
139
Popular Tags