KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > design > multiview > DesignMultiViewDesc


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.websvc.design.multiview;
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 import org.netbeans.core.spi.multiview.MultiViewDescription;
27 import org.netbeans.core.spi.multiview.MultiViewElement;
28 import org.openide.util.HelpCtx;
29 import org.openide.util.NbBundle;
30 import org.openide.windows.TopComponent;
31
32 /**
33  *
34  * @author Ajit Bhate
35  */

36 public class DesignMultiViewDesc extends Object JavaDoc
37         implements MultiViewDescription, Serializable JavaDoc {
38     
39     private static final long serialVersionUID = -3221821700664562837L;
40     /**
41      *
42      */

43     public static final String JavaDoc PREFERRED_ID = "webservice-designview";
44     private MultiViewSupport mvSupport;
45     
46     /**
47      *
48      *
49      */

50     public DesignMultiViewDesc() {
51         super();
52     }
53     
54     
55     /**
56      *
57      *
58      * @param mvSupport
59      */

60     public DesignMultiViewDesc(MultiViewSupport mvSupport) {
61         this.mvSupport = mvSupport;
62     }
63     
64     
65     /**
66      *
67      * @return
68      */

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

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

87     public java.awt.Image JavaDoc getIcon() {
88         return MultiViewSupport.SERVICE_BADGE;
89     }
90     
91     
92     /**
93      *
94      * @return
95      */

96     public HelpCtx getHelpCtx() {
97         return new HelpCtx(DesignMultiViewDesc.class);
98     }
99     
100     
101     /**
102      *
103      *
104      */

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

115     public MultiViewElement createElement() {
116         return new DesignMultiViewElement(mvSupport);
117     }
118     
119     
120     /**
121      *
122      *
123      * @param out
124      * @throws java.io.IOException
125      */

126     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
127     out.writeObject(mvSupport);
128     }
129     
130     
131     /**
132      *
133      *
134      * @param in
135      * @throws java.io.IOException
136      * @throws java.lang.ClassNotFoundException
137      */

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