KickJava   Java API By Example, From Geeks To Geeks.

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


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 /*
21  * WSDLDesignMultiViewDesc.java
22  *
23  * Created on 2006/08/15, 20:42
24  *
25  * To change this template, choose Tools | Template Manager
26  * and open the template in the editor.
27  */

28
29 package org.netbeans.modules.xml.wsdl.ui.netbeans.module;
30
31 import java.io.IOException JavaDoc;
32 import java.io.ObjectInput JavaDoc;
33 import java.io.ObjectOutput JavaDoc;
34 import java.io.Serializable JavaDoc;
35 import org.openide.util.HelpCtx;
36 import org.openide.util.NbBundle;
37 import org.openide.util.Utilities;
38 import org.openide.windows.TopComponent;
39 import org.netbeans.core.spi.multiview.MultiViewDescription;
40 import org.netbeans.core.spi.multiview.MultiViewElement;
41
42 /**
43  *
44  * @author radval
45  */

46 public class WSDLDesignMultiViewDesc extends Object JavaDoc
47     implements MultiViewDescription, Serializable JavaDoc {
48     
49     
50     /**
51      *
52      */

53     private static final long serialVersionUID = 2580263536201519563L;
54     public static final String JavaDoc PREFERRED_ID = "wsdl-designview";
55     private WSDLDataObject wsdlDataObject;
56     
57     /**
58      *
59      *
60      */

61     public WSDLDesignMultiViewDesc() {
62         super();
63     }
64
65
66     /**
67      *
68      *
69      */

70     public WSDLDesignMultiViewDesc(WSDLDataObject wsdlDataObject) {
71         this.wsdlDataObject = wsdlDataObject;
72     }
73
74
75     /**
76      *
77      *
78      */

79     public String JavaDoc preferredID() {
80         return PREFERRED_ID;
81     }
82
83
84     /**
85      *
86      *
87      */

88     public int getPersistenceType() {
89         return TopComponent.PERSISTENCE_ALWAYS;
90     }
91
92
93     /**
94      *
95      *
96      */

97     public java.awt.Image JavaDoc getIcon() {
98         return Utilities.loadImage(WSDLDataObject.WSDL_ICON_BASE_WITH_EXT);
99     }
100
101
102     public HelpCtx getHelpCtx() {
103             return new HelpCtx(WSDLDesignMultiViewDesc.class);
104     }
105
106
107     /**
108      *
109      *
110      */

111     public String JavaDoc getDisplayName() {
112         return NbBundle.getMessage(WSDLTreeViewMultiViewDesc.class,
113             "LBL_graphDesignView_name");
114     }
115
116
117     /**
118      *
119      *
120      */

121     public MultiViewElement createElement() {
122             return new WSDLDesignMultiViewElement(wsdlDataObject);
123     }
124
125
126     /**
127      *
128      *
129      */

130     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
131         out.writeObject(wsdlDataObject);
132     }
133
134
135     /**
136      *
137      *
138      */

139     public void readExternal(ObjectInput JavaDoc in)
140         throws IOException JavaDoc, ClassNotFoundException JavaDoc
141     {
142         Object JavaDoc firstObject = in.readObject();
143         if (firstObject instanceof WSDLDataObject)
144             wsdlDataObject = (WSDLDataObject) firstObject;
145     }
146 }
147
Popular Tags