KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > genericserver > ide > GSJ2eePlatformFactory


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.j2ee.genericserver.ide;
21
22 import java.io.File JavaDoc;
23 import java.util.HashSet JavaDoc;
24 import java.util.Set JavaDoc;
25 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
26 import org.netbeans.api.java.platform.JavaPlatform;
27 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
28 import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformFactory;
29 import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl;
30 import org.netbeans.spi.project.libraries.LibraryImplementation;
31 import org.openide.util.Utilities;
32
33 /**
34  *
35  * @author Martin Adamek
36  */

37 public class GSJ2eePlatformFactory extends J2eePlatformFactory {
38     
39     public J2eePlatformImpl getJ2eePlatformImpl(DeploymentManager JavaDoc dm) {
40         return new J2eePlatformImplImpl();
41     }
42     
43     private class J2eePlatformImplImpl extends J2eePlatformImpl {
44         
45         public boolean isToolSupported(String JavaDoc toolName) {
46             return false;
47         }
48         
49         public File JavaDoc[] getToolClasspathEntries(String JavaDoc toolName) {
50             return new File JavaDoc[0];
51         }
52         
53         public Set JavaDoc getSupportedSpecVersions() {
54             Set JavaDoc result = new HashSet JavaDoc();
55             result.add(J2eeModule.J2EE_14);
56             return result;
57         }
58         
59         public java.util.Set JavaDoc getSupportedModuleTypes() {
60             Set JavaDoc result = new HashSet JavaDoc();
61 // result.add(J2eeModule.EAR);
62
// result.add(J2eeModule.WAR);
63
result.add(J2eeModule.EJB);
64 // result.add(J2eeModule.CONN);
65
// result.add(J2eeModule.CLIENT);
66
return result;
67         }
68         
69         public Set JavaDoc/*<String>*/ getSupportedJavaPlatformVersions() {
70             Set JavaDoc versions = new HashSet JavaDoc();
71             versions.add("1.4"); // NOI18N
72
versions.add("1.5"); // NOI18N
73
versions.add("1.6"); // NOI18N
74
return versions;
75         }
76         
77         public JavaPlatform getJavaPlatform() {
78             return null;
79         }
80         
81         public java.io.File JavaDoc[] getPlatformRoots() {
82             return new File JavaDoc[0];
83         }
84         
85         public LibraryImplementation[] getLibraries() {
86             return new LibraryImplementation[0];
87         }
88         
89         public java.awt.Image JavaDoc getIcon() {
90             return Utilities.loadImage("org/netbeans/modules/j2ee/genericserver/resources/GSInstanceIcon.gif"); // NOI18N
91
}
92         
93         public String JavaDoc getDisplayName() {
94             return "Generic Server Platform";
95         }
96         
97     }
98     
99 }
100
Popular Tags