1 19 20 package org.netbeans.modules.websvc.core.dev.wizard; 21 22 import java.util.Map ; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.modules.j2ee.api.ejbjar.EjbJar; 25 import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment; 26 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform; 27 import org.netbeans.modules.web.api.webmodule.WebModule; 28 import org.netbeans.modules.websvc.jaxws.api.JAXWSSupport; 29 import org.openide.WizardDescriptor; 30 31 35 public class ProjectInfo { 36 37 private Project project; 38 private int projectType; 39 40 public static final int JSE_PROJECT_TYPE = 0; 41 public static final int WEB_PROJECT_TYPE = 1; 42 public static final int EJB_PROJECT_TYPE = 2; 43 44 private boolean jwsdpSupported = false; 45 private boolean jsr109Supported = false; 46 private boolean jsr109oldSupported = false; 47 48 49 50 public ProjectInfo(Project project) { 51 this.project=project; 52 JAXWSSupport wss = JAXWSSupport.getJAXWSSupport(project.getProjectDirectory()); 53 if (wss != null) { 54 Map properties = wss.getAntProjectHelper().getStandardPropertyEvaluator().getProperties(); 55 String serverInstance = (String )properties.get("j2ee.server.instance"); if (serverInstance != null) { 57 J2eePlatform j2eePlatform = Deployment.getDefault().getJ2eePlatform(serverInstance); 58 if (j2eePlatform != null) { 59 jwsdpSupported = j2eePlatform.isToolSupported(J2eePlatform.TOOL_JWSDP); 60 jsr109Supported = j2eePlatform.isToolSupported(J2eePlatform.TOOL_JSR109); 61 jsr109oldSupported = j2eePlatform.isToolSupported(J2eePlatform.TOOL_WSCOMPILE); 62 } 63 } 64 } 65 66 WebModule wm = WebModule.getWebModule(project.getProjectDirectory()); 67 EjbJar em = EjbJar.getEjbJar(project.getProjectDirectory()); 68 if (em != null) 69 projectType = EJB_PROJECT_TYPE; 70 else if (wm != null) 71 projectType = WEB_PROJECT_TYPE; 72 else 73 projectType = JSE_PROJECT_TYPE; 74 } 75 76 public int getProjectType() { 77 return projectType; 78 } 79 80 public Project getProject() { 81 return project; 82 } 83 84 public boolean isJwsdpSupported() { 85 return jwsdpSupported; 86 } 87 public boolean isJsr109Supported() { 88 return jsr109Supported; 89 } 90 public boolean isJsr109oldSupported() { 91 return jsr109oldSupported; 92 } 93 } 94 95 | Popular Tags |