KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > schema > core > multiview > SchemaColumnViewMultiViewDesc


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.schema.core.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.modules.xml.schema.core.SchemaDataLoader;
28 import org.netbeans.modules.xml.schema.core.SchemaDataObject;
29 import org.openide.loaders.DataObject;
30 import org.openide.util.HelpCtx;
31 import org.openide.util.NbBundle;
32 import org.openide.util.Utilities;
33 import org.openide.windows.TopComponent;
34
35 /**
36  *
37  * @author Jeri Lockhart
38  */

39 public class SchemaColumnViewMultiViewDesc extends Object JavaDoc
40     implements MultiViewDescription, Serializable JavaDoc {
41     
42     private static final long serialVersionUID = -3221821700664562837L;
43     public static final String JavaDoc PREFERRED_ID = "xml-schema-columnview";
44     private SchemaDataObject schemaDataObject;
45     
46     /**
47      *
48      *
49      */

50     public SchemaColumnViewMultiViewDesc() {
51         super();
52     }
53
54
55     /**
56      *
57      *
58      */

59     public SchemaColumnViewMultiViewDesc(SchemaDataObject schemaDataObject) {
60         this.schemaDataObject = schemaDataObject;
61     }
62
63
64     /**
65      *
66      *
67      */

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

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

86     public java.awt.Image JavaDoc getIcon() {
87         return Utilities.loadImage(SchemaDataObject.SCHEMA_ICON_BASE_WITH_EXT);
88     }
89
90
91     /**
92      *
93      *
94      */

95     public org.openide.util.HelpCtx getHelpCtx() {
96             //return HelpCtx.DEFAULT_HELP;
97
return new HelpCtx(SchemaColumnViewMultiViewDesc.class);
98     }
99
100
101     /**
102      *
103      *
104      */

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

115     public org.netbeans.core.spi.multiview.MultiViewElement createElement() {
116         return new SchemaColumnViewMultiViewElement(schemaDataObject);
117     }
118
119
120     /**
121      *
122      *
123      */

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

133     public void readExternal(ObjectInput JavaDoc in)
134         throws IOException JavaDoc, ClassNotFoundException JavaDoc
135     {
136         Object JavaDoc firstObject = in.readObject();
137         if (firstObject instanceof SchemaDataObject)
138             schemaDataObject = (SchemaDataObject) firstObject;
139     }
140 }
141
Popular Tags