1 19 20 package org.netbeans.modules.j2ee.oc4j.ide; 21 22 import java.io.File ; 23 import java.util.HashSet ; 24 import java.util.Set ; 25 import org.netbeans.modules.j2ee.deployment.common.api.J2eeLibraryTypeProvider; 26 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule; 27 import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl; 28 import org.netbeans.modules.j2ee.oc4j.OC4JDeploymentManager; 29 import org.netbeans.modules.j2ee.oc4j.util.OC4JPluginProperties; 30 import org.netbeans.spi.project.libraries.LibraryImplementation; 31 import org.openide.util.NbBundle; 32 import org.openide.util.Utilities; 33 34 38 public class OC4JJ2eePlatformImpl extends J2eePlatformImpl { 39 40 private OC4JDeploymentManager dm; 41 private LibraryImplementation[] libraries; 42 private OC4JPluginProperties properties; 43 44 public OC4JJ2eePlatformImpl(OC4JDeploymentManager dm) { 45 this.dm = dm; 46 this.properties = dm.getProperties(); 47 initLibraries(); 48 } 49 50 public boolean isToolSupported(String toolName) { 51 if ("oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider".equals(toolName)) { 52 return true; 53 } 54 return false; 55 } 56 57 58 public File [] getToolClasspathEntries(String toolName) { 59 return new File [0]; 60 } 61 62 public Set getSupportedSpecVersions() { 63 Set <String > result = new HashSet <String >(); 64 result.add(J2eeModule.JAVA_EE_5); 65 return result; 66 } 67 68 public java.util.Set getSupportedModuleTypes() { 69 Set <Object > result = new HashSet <Object >(); 70 result.add(J2eeModule.EAR); 71 result.add(J2eeModule.WAR); 72 result.add(J2eeModule.EJB); 73 return result; 74 } 75 76 public java.io.File [] getPlatformRoots() { 77 return new File [0]; 78 } 79 80 public LibraryImplementation[] getLibraries() { 81 return libraries; 82 } 83 84 public java.awt.Image getIcon() { 85 return Utilities.loadImage("org/netbeans/modules/j2ee/myserver/resources/server.gif"); 87 } 88 89 public String getDisplayName() { 90 return NbBundle.getMessage(OC4JJ2eePlatformImpl.class, "MSG_OC4JServerPlatform"); 91 } 92 93 public Set getSupportedJavaPlatformVersions() { 94 return null; 95 } 96 97 public org.netbeans.api.java.platform.JavaPlatform getJavaPlatform() { 98 return null; 99 } 100 101 public void notifyLibrariesChanged() { 102 initLibraries(); 103 firePropertyChange(PROP_LIBRARIES, null, libraries.clone()); 104 } 105 106 private void initLibraries() { 107 LibraryImplementation lib = new J2eeLibraryTypeProvider().createLibrary(); 109 lib.setName(NbBundle.getMessage(OC4JJ2eePlatformImpl.class, "TITLE_OC4J_LIBRARY")); 110 lib.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, properties.getClasses()); 111 libraries = new LibraryImplementation[] {lib}; 112 } 113 } | Popular Tags |