KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > apisupport > beanbrowser > CookieClassList


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.apisupport.beanbrowser;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.List JavaDoc;
24 import org.openide.ErrorManager;
25
26 /**
27  * See enhancement #11911.
28  * @author Jesse Glick
29  */

30 public final class CookieClassList {
31
32     // XXX does this need to be complete? Or are only Node.Cookie subtypes required?
33
private static final String JavaDoc[] CLASS_NAMES = {
34         "javax.jmi.reflect.RefObject", // NOI18N
35
"org.apache.tools.ant.module.api.AntProjectCookie", // NOI18N
36
"org.apache.tools.ant.module.api.ElementCookie", // NOI18N
37
"org.apache.tools.ant.module.api.IntrospectionCookie", // NOI18N
38
"org.netbeans.api.project.Project", // NOI18N
39
"org.netbeans.api.project.ProjectInformation", // NOI18N
40
"org.netbeans.api.project.Sources", // NOI18N
41
"org.netbeans.modules.xml.core.cookies.CookieManagerCookie", // NOI18N
42
"org.netbeans.modules.xml.tax.cookies.TreeDocumentCookie", // NOI18N
43
"org.netbeans.modules.xml.tax.cookies.TreeEditorCookie", // NOI18N
44
"org.netbeans.spi.java.classpath.ClassPathProvider", // NOI18N
45
"org.netbeans.spi.java.queries.AccessibilityQueryImplementation", // NOI18N
46
"org.netbeans.spi.java.queries.JavadocForBinaryQueryImplementation", // NOI18N
47
"org.netbeans.spi.java.queries.MultipleRootsUnitTestForSourceQueryImplementation", // NOI18N
48
"org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation", // NOI18N
49
"org.netbeans.spi.java.queries.SourceLevelQueryImplementation", // NOI18N
50
"org.netbeans.spi.java.queries.UnitTestForSourceQueryImplementation", // NOI18N
51
"org.netbeans.spi.project.ActionProvider", // NOI18N
52
"org.netbeans.spi.project.AuxiliaryConfiguration", // NOI18N
53
"org.netbeans.spi.project.CacheDirectoryProvider", // NOI18N
54
"org.netbeans.spi.project.SubprojectProvider", // NOI18N
55
"org.netbeans.spi.project.ant.AntArtifactProvider", // NOI18N
56
"org.netbeans.spi.project.support.ant.ProjectXmlSavedHook", // NOI18N
57
"org.netbeans.spi.project.ui.CustomizerProvider", // NOI18N
58
"org.netbeans.spi.project.ui.LogicalViewProvider", // NOI18N
59
"org.netbeans.spi.project.ui.PrivilegedTemplates", // NOI18N
60
"org.netbeans.spi.project.ui.ProjectOpenedHook", // NOI18N
61
"org.netbeans.spi.project.ui.RecommendedTemplates", // NOI18N
62
"org.netbeans.spi.queries.FileBuiltQueryImplementation", // NOI18N
63
"org.netbeans.spi.queries.SharabilityQueryImplementation", // NOI18N
64
"org.openide.cookies.CloseCookie", // NOI18N
65
"org.openide.cookies.EditCookie", // NOI18N
66
"org.openide.cookies.EditorCookie", // NOI18N
67
"org.openide.cookies.EditorCookie$Observable", // NOI18N
68
"org.openide.cookies.InstanceCookie", // NOI18N
69
"org.openide.cookies.InstanceCookie$Of", // NOI18N
70
"org.openide.cookies.LineCookie", // NOI18N
71
"org.openide.cookies.OpenCookie", // NOI18N
72
"org.openide.cookies.PrintCookie", // NOI18N
73
"org.openide.cookies.SaveCookie", // NOI18N
74
"org.openide.cookies.SourceCookie", // NOI18N
75
"org.openide.cookies.SourceCookie$Editor", // NOI18N
76
"org.openide.cookies.ViewCookie", // NOI18N
77
"org.openide.loaders.DataFolder", // NOI18N
78
"org.openide.loaders.DataObject", // NOI18N
79
"org.openide.loaders.XMLDataObject$Processor", // NOI18N
80
"org.openide.nodes.Index", // NOI18N
81
"org.openide.src.ClassElement", // NOI18N
82
"org.openide.src.ConstructorElement", // NOI18N
83
"org.openide.src.FieldElement", // NOI18N
84
"org.openide.src.InitializerElement", // NOI18N
85
"org.openide.src.MethodElement", // NOI18N
86
"org.openide.src.SourceElement", // NOI18N
87
"org.openidex.search.SearchInfo", // NOI18N
88
};
89     
90     private static Class JavaDoc[] clazzes;
91     
92     public static synchronized Class JavaDoc[] getCookieClasses() {
93         if (clazzes == null) {
94             List JavaDoc/*<Class>*/ _clazzes = new ArrayList JavaDoc();
95             ClassLoader JavaDoc l = Thread.currentThread().getContextClassLoader();
96             for (int i = 0; i < CLASS_NAMES.length; i++) {
97                 try {
98                     _clazzes.add(Class.forName(CLASS_NAMES[i], true, l));
99                 } catch (ClassNotFoundException JavaDoc e) {
100                     // ignore, module not available or whatever
101
}
102             }
103             clazzes = (Class JavaDoc[]) _clazzes.toArray(new Class JavaDoc[_clazzes.size()]);
104         }
105         return clazzes;
106     }
107     
108 }
109
Popular Tags