KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > schema > ui > nodes > categorized > AdvancedNewTypesFactory


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  * AdvancedNewTypesFactory.java
22  *
23  * Created on May 2, 2006, 5:08 PM
24  *
25  */

26
27 package org.netbeans.modules.xml.schema.ui.nodes.categorized;
28
29 import org.netbeans.modules.xml.schema.model.All;
30 import org.netbeans.modules.xml.schema.model.Annotation;
31 import org.netbeans.modules.xml.schema.model.AnyAttribute;
32 import org.netbeans.modules.xml.schema.model.AnyElement;
33 import org.netbeans.modules.xml.schema.model.AppInfo;
34 import org.netbeans.modules.xml.schema.model.AttributeGroupReference;
35 import org.netbeans.modules.xml.schema.model.AttributeReference;
36 import org.netbeans.modules.xml.schema.model.Choice;
37 import org.netbeans.modules.xml.schema.model.Documentation;
38 import org.netbeans.modules.xml.schema.model.ElementReference;
39 import org.netbeans.modules.xml.schema.model.Enumeration;
40 import org.netbeans.modules.xml.schema.model.Field;
41 import org.netbeans.modules.xml.schema.model.GlobalAttribute;
42 import org.netbeans.modules.xml.schema.model.GlobalAttributeGroup;
43 import org.netbeans.modules.xml.schema.model.GlobalComplexType;
44 import org.netbeans.modules.xml.schema.model.GlobalElement;
45 import org.netbeans.modules.xml.schema.model.GlobalGroup;
46 import org.netbeans.modules.xml.schema.model.GlobalSimpleType;
47 import org.netbeans.modules.xml.schema.model.GroupReference;
48 import org.netbeans.modules.xml.schema.model.Import;
49 import org.netbeans.modules.xml.schema.model.Include;
50 import org.netbeans.modules.xml.schema.model.Key;
51 import org.netbeans.modules.xml.schema.model.KeyRef;
52 import org.netbeans.modules.xml.schema.model.LocalAttribute;
53 import org.netbeans.modules.xml.schema.model.LocalComplexType;
54 import org.netbeans.modules.xml.schema.model.LocalElement;
55 import org.netbeans.modules.xml.schema.model.LocalSimpleType;
56 import org.netbeans.modules.xml.schema.model.Redefine;
57 import org.netbeans.modules.xml.schema.model.Schema;
58 import org.netbeans.modules.xml.schema.model.Selector;
59 import org.netbeans.modules.xml.schema.model.Sequence;
60 import org.netbeans.modules.xml.schema.model.Unique;
61 import org.netbeans.modules.xml.schema.ui.nodes.NewTypesFactory;
62
63 /**
64  *
65  * @author Ajit Bhate
66  */

67 public class AdvancedNewTypesFactory extends NewTypesFactory {
68     /**
69      * Creates a new instance of AdvancedNewTypesFactory
70      */

71     public AdvancedNewTypesFactory() {
72     }
73     
74     public void visit(All all) {
75         addChildType(LocalElement.class);
76         addChildType(ElementReference.class);
77         super.visit(all);
78     }
79     
80     public void visit(Sequence s) {
81         addChildType(LocalElement.class);
82         addChildType(ElementReference.class);
83         addChildType(AnyElement.class);
84         addChildType(GroupReference.class);
85         addChildType(Choice.class);
86         addChildType(Sequence.class);
87         super.visit(s);
88     }
89     
90     public void visit(Choice choice) {
91         addChildType(LocalElement.class);
92         addChildType(ElementReference.class);
93         addChildType(AnyElement.class);
94         addChildType(GroupReference.class);
95         addChildType(Choice.class);
96         addChildType(Sequence.class);
97         super.visit(choice);
98     }
99     
100     public void visit(GlobalComplexType gct) {
101         addChildType(LocalElement.class);
102         addChildType(ElementReference.class);
103         addChildType(AnyElement.class);
104         addChildType(LocalAttribute.class);
105         addChildType(AttributeReference.class);
106         addChildType(AttributeGroupReference.class);
107         addChildType(AnyAttribute.class);
108         addChildType(GroupReference.class);
109         addChildType(All.class);
110         addChildType(Choice.class);
111         addChildType(Sequence.class);
112         super.visit(gct);
113     }
114     
115     public void visit(LocalComplexType type) {
116         addChildType(LocalElement.class);
117         addChildType(ElementReference.class);
118         addChildType(AnyElement.class);
119         addChildType(LocalAttribute.class);
120         addChildType(AttributeReference.class);
121         addChildType(AttributeGroupReference.class);
122         addChildType(AnyAttribute.class);
123         addChildType(GroupReference.class);
124         addChildType(All.class);
125         addChildType(Choice.class);
126         addChildType(Sequence.class);
127         super.visit(type);
128     }
129     
130     public void visit(GlobalAttributeGroup gag) {
131         addChildType(LocalAttribute.class);
132         addChildType(AttributeReference.class);
133         addChildType(AttributeGroupReference.class);
134         addChildType(AnyAttribute.class);
135         super.visit(gag);
136     }
137     
138     public void visit(GlobalSimpleType gst) {
139         addChildType(Enumeration.class);
140         super.visit(gst);
141     }
142     
143     public void visit(LocalSimpleType gst) {
144         addChildType(Enumeration.class);
145         super.visit(gst);
146     }
147     
148     public void visit(GlobalElement ge) {
149         addChildType(LocalElement.class);
150         addChildType(ElementReference.class);
151         addChildType(AnyElement.class);
152         addChildType(LocalAttribute.class);
153         addChildType(AttributeReference.class);
154         addChildType(AttributeGroupReference.class);
155         addChildType(AnyAttribute.class);
156         addChildType(LocalComplexType.class);
157         addChildType(LocalSimpleType.class);
158         addChildType(GroupReference.class);
159         addChildType(All.class);
160         addChildType(Choice.class);
161         addChildType(Sequence.class);
162         addChildType(Key.class);
163         addChildType(KeyRef.class);
164         addChildType(Unique.class);
165         super.visit(ge);
166     }
167     
168     public void visit(LocalElement le) {
169         addChildType(LocalElement.class);
170         addChildType(ElementReference.class);
171         addChildType(AnyElement.class);
172         addChildType(LocalAttribute.class);
173         addChildType(AttributeReference.class);
174         addChildType(AttributeGroupReference.class);
175         addChildType(AnyAttribute.class);
176         addChildType(LocalComplexType.class);
177         addChildType(LocalSimpleType.class);
178         addChildType(GroupReference.class);
179         addChildType(All.class);
180         addChildType(Choice.class);
181         addChildType(Sequence.class);
182         addChildType(Key.class);
183         addChildType(KeyRef.class);
184         addChildType(Unique.class);
185         super.visit(le);
186     }
187     
188     public void visit(GlobalGroup gd) {
189         addChildType(All.class);
190         addChildType(Sequence.class);
191         addChildType(Choice.class);
192         super.visit(gd);
193     }
194     
195     public void visit(Schema s) {
196         addChildType(GlobalComplexType.class);
197         addChildType(GlobalSimpleType.class);
198         addChildType(GlobalElement.class);
199         addChildType(GlobalAttribute.class);
200         addChildType(GlobalAttributeGroup.class);
201         addChildType(GlobalGroup.class);
202         addChildType(Import.class);
203         addChildType(Include.class);
204         addChildType(Redefine.class);
205         super.visit(s);
206     }
207     
208     public void visit(Redefine rd) {
209         addChildType(GlobalComplexType.class);
210         addChildType(GlobalSimpleType.class);
211         addChildType(GlobalAttributeGroup.class);
212         addChildType(GlobalGroup.class);
213         super.visit(rd);
214     }
215     
216     public void visit(Key key) {
217         addChildType(Selector.class);
218         addChildType(Field.class);
219         super.visit(key);
220     }
221     
222     public void visit(Unique u) {
223         addChildType(Selector.class);
224         addChildType(Field.class);
225         super.visit(u);
226     }
227     
228     public void visit(KeyRef kr) {
229         addChildType(Selector.class);
230         addChildType(Field.class);
231         super.visit(kr);
232     }
233
234     public void visit(Annotation ann) {
235         addChildType(Documentation.class);
236         addChildType(AppInfo.class);
237         super.visit(ann);
238     }
239     
240 }
241
Popular Tags