KickJava   Java API By Example, From Geeks To Geeks.

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


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.HelpCtx;
32 import org.openide.util.NbBundle;
33 import org.openide.util.Utilities;
34 import org.openide.windows.TopComponent;
35
36 /**
37  *
38  * @author Jeri Lockhart
39  */

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

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

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

69     public String JavaDoc preferredID() {
70         return PREFERRED_ID;
71     }
72
73
74     /**
75      *
76      *
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 Utilities.loadImage(SchemaDataObject.SCHEMA_ICON_BASE_WITH_EXT);
89     }
90
91
92     /**
93      *
94      *
95      */

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

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

115     public org.netbeans.core.spi.multiview.MultiViewElement createElement() {
116         return new SchemaABEViewMultiViewElement(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