Author: rob.stryker(a)jboss.com
Date: 2007-08-07 16:41:35 -0400 (Tue, 07 Aug 2007)
New Revision: 2946
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB30SupportVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ProjectRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/ejb3/JBossEJB3LibrariesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
libraries moved to classpath.core
adds more libraries than needed now by default.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/META-INF/MANIFEST.MF
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/META-INF/MANIFEST.MF 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/META-INF/MANIFEST.MF 2007-08-07
20:41:35 UTC (rev 2946)
@@ -5,11 +5,14 @@
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.ide.eclipse.as.classpath.core.ClasspathCorePlugin
Require-Bundle: org.eclipse.core.runtime,
- org.jboss.ide.eclipse.as.core,
org.eclipse.jdt.core,
org.eclipse.wst.server.core,
org.eclipse.core.resources,
- org.eclipse.jdt.launching
+ org.eclipse.jdt.launching,
+ org.eclipse.jst.server.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.jst.common.project.facet.core,
+ org.jboss.ide.eclipse.as.core
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.classpath.core,
org.jboss.ide.eclipse.as.classpath.core.ejb3
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2007-08-07
17:38:23 UTC (rev 2945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2007-08-07
20:41:35 UTC (rev 2946)
@@ -7,4 +7,54 @@
class="org.jboss.ide.eclipse.as.classpath.core.ejb3.EJB3ClasspathContainerInitializer"
id="org.jboss.ide.eclipse.as.classpath.core.ejb3.classpathContainer"/>
</extension>
+
+
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+
+ <adapter>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component.32"
version="3.2"/>
+ <factory
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+ <type
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
+ <adapter>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component.40"
version="4.0"/>
+ <factory
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+ <type
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
+ <adapter>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component.42"
version="4.2"/>
+ <factory
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+ <type
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+ </extension>
+
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer">
+ <classpathContainerInitializer
+
class="org.jboss.ide.eclipse.as.classpath.core.runtime.WebtoolsProjectJBossClasspathContainerInitializer"
+
id="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectInitializer"/>
+ </extension>
+
+
+
+ <extension
point="org.eclipse.jst.server.core.runtimeClasspathProviders">
+ <runtimeClasspathProvider
+ id="org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget"
+ runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32,
org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42"
+
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ClientAllRuntimeClasspathProvider"/>
+ </extension>
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer">
+ <classpathContainerInitializer
+
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$RuntimeClasspathContainerInitializer"
+
id="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer">
+ </classpathContainerInitializer>
+ </extension>
+
</plugin>
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB30SupportVerifier.java
(from rev 2945,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB30SupportVerifier.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB30SupportVerifier.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -0,0 +1,32 @@
+package org.jboss.ide.eclipse.as.classpath.core.ejb3;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.wst.server.core.IRuntime;
+import
org.jboss.ide.eclipse.as.classpath.core.runtime.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
+import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+
+public class EJB30SupportVerifier {
+ public static boolean verify(IRuntime rt) {
+ AbstractJBossServerRuntime ajbsr =
(AbstractJBossServerRuntime)rt.loadAdapter(AbstractJBossServerRuntime.class, null);
+ // i refuse to verify. if they say they support, believe them
+ if( ajbsr == null ) return true;
+
+ // one of ours. verify
+ IPath path = new
Path("org.jboss.ide.eclipse.as.core.runtime.ProjectInitializer");
+ path = path.append(rt.getId()).append("jst.ejb").append("3.0");
+
+ WebtoolsProjectJBossClasspathContainer container =
+ new WebtoolsProjectJBossClasspathContainer(path);
+ IClasspathEntry[] entries = container.getClasspathEntries();
+ if( entries.length == 0 ) return false;
+ IPath p;
+ for( int i = 0; i < entries.length; i++ ) {
+ p = entries[i].getPath();
+ if( !p.toFile().exists())
+ return false;
+ }
+ return true;
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -32,8 +31,6 @@
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.internal.core.ClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
(from rev 2945,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -0,0 +1,284 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.classpath.core.runtime;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+
+
+public class WebtoolsProjectJBossClasspathContainerInitializer extends
+ ClasspathContainerInitializer {
+
+ private static final IProjectFacet JST_JAVA_FACET =
ProjectFacetsManager.getProjectFacet("jst.java");
+ private static final IProjectFacet WEB_FACET =
ProjectFacetsManager.getProjectFacet("jst.web");
+ private static final IProjectFacet EJB_FACET =
ProjectFacetsManager.getProjectFacet("jst.ejb");
+ private static final IProjectFacet EAR_FACET =
ProjectFacetsManager.getProjectFacet("jst.ear");
+ private static final IProjectFacet UTILITY_FACET =
ProjectFacetsManager.getProjectFacet("jst.utility");
+ private static final IProjectFacet CONNECTOR_FACET =
ProjectFacetsManager.getProjectFacet("jst.connector");
+ private static final IProjectFacet APP_CLIENT_FACET =
ProjectFacetsManager.getProjectFacet("jst.appclient");
+
+
+ public WebtoolsProjectJBossClasspathContainerInitializer() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void initialize(IPath containerPath, IJavaProject project)
+ throws CoreException {
+ WebtoolsProjectJBossClasspathContainer container = new
WebtoolsProjectJBossClasspathContainer(containerPath);
+
+ JavaCore.setClasspathContainer(containerPath,
+ new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
+ }
+
+ public IClasspathEntry[] getEntries(IPath path) {
+ return new WebtoolsProjectJBossClasspathContainer(path).getClasspathEntries();
+ }
+
+
+
+
+ public static class WebtoolsProjectJBossClasspathContainer implements
IClasspathContainer {
+ private IPath path;
+ private IClasspathEntry[] entries = null;
+
+ public WebtoolsProjectJBossClasspathContainer(IPath path) {
+ this.path = path;
+ }
+
+ public String getDescription() {
+ if( path.segmentCount() < 4 ) return "JBoss Runtimes";
+ return "JBoss Runtimes (" + path.segment(2) + " : " +
path.segment(3) + ")";
+ }
+
+ public int getKind() {
+ return IClasspathContainer.K_APPLICATION;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+
+
+ public IClasspathEntry[] getClasspathEntries() {
+ if( entries == null ) {
+ loadClasspathEntries();
+ if( entries == null )
+ return new IClasspathEntry[0];
+ }
+ return entries;
+ }
+
+ private void loadClasspathEntries() {
+ if( path.segmentCount() < 4 ) return;
+ String runtimeId = path.segment(1);
+ String facetId = path.segment(2);
+ String facetVersion = path.segment(3);
+
+
+ if( runtimeId == null ) return;
+
+ IRuntime runtime = ServerCore.findRuntime(runtimeId);
+ if( runtime == null ) return;
+
+ Object serverRuntime = runtime.loadAdapter(AbstractJBossServerRuntime.class, null);
+
+ if( serverRuntime == null ) return;
+ AbstractJBossServerRuntime jbRuntime = (AbstractJBossServerRuntime)serverRuntime;
+
+ String serverHome = runtime.getLocation().toOSString();
+ String configName = jbRuntime.getJBossConfiguration();
+
+ String jbossVersion = jbRuntime.getId();
+
+ entries = loadClasspathEntries2(runtimeId, facetId, facetVersion,
+ serverHome, configName, jbossVersion, jbRuntime);
+ }
+
+ protected IClasspathEntry[] loadClasspathEntries2(String runtimeId, String facetId,
+ String facetVersion, String serverHome, String configName, String jbVersion,
+ AbstractJBossServerRuntime jbsRuntime) {
+ if( facetId.equals(JST_JAVA_FACET.getId())) {
+ return loadJREClasspathEntries(jbsRuntime);
+ } else if( jbVersion.equals("4.2")) {
+ return loadClasspathEntries42(facetId, facetVersion, serverHome, configName);
+ } else if( jbVersion.equals("4.0"))
+ return loadClasspathEntries40(facetId, facetVersion, serverHome, configName);
+ if( jbVersion.equals("3.2"))
+ return loadClasspathEntries32( facetId, facetVersion, serverHome, configName);
+ return loadClasspathEntriesDefault(facetId, facetVersion, serverHome, configName);
+ }
+
+ protected boolean isEjb30(String facetId, String facetVersion) {
+ if( facetId.equals(EJB_FACET.getId()) && facetVersion.equals("3.0"))
+ return true;
+ return false;
+ }
+
+ protected IClasspathEntry getEntry(IPath path) {
+ return JavaRuntime.newArchiveRuntimeClasspathEntry(path).getClasspathEntry();
+ }
+ protected IClasspathEntry[] getEntries(IPath folder) {
+ String[] files = folder.toFile().list();
+ ArrayList list = new ArrayList();
+ for( int i = 0; i < files.length; i++ ) {
+ if( files[i].endsWith(".jar")) {
+ list.add(getEntry(folder.append(files[i])));
+ }
+ }
+ return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
+ }
+ protected IClasspathEntry[] loadJREClasspathEntries(AbstractJBossServerRuntime
jbsRuntime) {
+ IVMInstall vmInstall = jbsRuntime.getVM();
+ if (vmInstall != null) {
+ String name = vmInstall.getName();
+ String typeId = vmInstall.getVMInstallType().getId();
+ return new IClasspathEntry[] { JavaCore.newContainerEntry(new
Path(JavaRuntime.JRE_CONTAINER).append(typeId).append(name)) };
+ }
+ return null;
+ }
+
+ protected IClasspathEntry[] loadClasspathEntries42(String facetId, String facetVersion,
String serverHome, String configName) {
+ IPath homePath = new Path(serverHome);
+ IPath configPath = homePath.append("server").append(configName);
+ ArrayList list = new ArrayList();
+ if (facetId.equals(WEB_FACET.getId())) {
+ IPath jsfDir =
configPath.append("deploy").append("jboss-web.deployer").append("jsf-libs");
+ list.add(getEntry(configPath.append("lib").append("jsp-api.jar")));
+ list.add(getEntry(homePath.append("client").append("servlet-api.jar")));
+ list.add(getEntry(jsfDir.append("jsf-api.jar")));
+ list.add(getEntry(jsfDir.append("jsf-impl.jar")));
+ } else if( facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion)) {
+ list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
+ } else if( isEjb30(facetId, facetVersion)) {
+ // path roots
+ IPath deploy = configPath.append("deploy");
+ IPath deployer = deploy.append("ejb3.deployer");
+ IPath aopDeployer = deploy.append("jboss-aop-jdk50.deployer");
+ IPath client = homePath.append("client");
+
+ list.add(getEntry(configPath.append("lib").append("jboss-ejb3x.jar")));
+ list.add(getEntry(deployer.append("jboss-ejb3.jar")));
+ list.add(getEntry(deployer.append("jboss-annotations-ejb3.jar")));
+
+ // aop
+ list.add(getEntry(aopDeployer.append("jboss-aop-jdk50.jar")));
+ list.add(getEntry(aopDeployer.append("jboss-aspect-library-jdk50.jar")));
+
+ // hibernate
+ list.add(getEntry(homePath.append("client").append("hibernate-client.jar")));
+
+ // persistence jar
+ list.add(getEntry(client.append("ejb3-persistence.jar")));
+
+ } else if( facetId.equals(EAR_FACET.getId())) {
+ list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
+ } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
+ list.add(getEntry(homePath.append("client").append("jbossall-client.jar")));
+ }
+ return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
+ }
+
+ protected IClasspathEntry[] loadClasspathEntries40(String facetId, String facetVersion,
String serverHome, String configName) {
+ IPath homePath = new Path(serverHome);
+ IPath configPath = homePath.append("server").append(configName);
+ ArrayList list = new ArrayList();
+ if (facetId.equals(WEB_FACET.getId())) {
+ IPath jsfDir =
configPath.append("deploy").append("jbossweb-tomcat55.sar").append("jsf-libs");
+ list.add(getEntry(configPath.append("lib").append("javax.servlet.jsp.jar")));
+ list.add(getEntry(homePath.append("client").append("javax.servlet.jar")));
+ list.addAll(Arrays.asList(getEntries(jsfDir)));
+ } else if( facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion)) {
+ list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
+ } else if( isEjb30(facetId, facetVersion)) {
+ // path roots
+ IPath deploy = configPath.append("deploy");
+ IPath deployer = deploy.append("ejb3.deployer");
+ IPath aopDeployer = deploy.append("jboss-aop-jdk50.deployer");
+
+ // ejb3
+ list.add(getEntry(deployer.append("jboss-ejb3x.jar")));
+ list.add(getEntry(deployer.append("jboss-ejb3.jar")));
+ list.add(getEntry(deployer.append("jboss-annotations-ejb3.jar")));
+
+ // aop
+ list.add(getEntry(aopDeployer.append("jboss-aop-jdk50.jar")));
+ list.add(getEntry(aopDeployer.append("jboss-aspect-library-jdk50.jar")));
+
+ // hibernate
+ list.add(getEntry(homePath.append("client").append("hibernate-client.jar")));
+
+ } else if( facetId.equals(EAR_FACET.getId())) {
+ list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
+ } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
+ list.add(JavaRuntime.newArchiveRuntimeClasspathEntry(homePath.append("client").append("jbossall-client.jar")).getClasspathEntry());
+ }
+ return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
+ }
+
+
+ protected IClasspathEntry[] loadClasspathEntries32(String facetId, String facetVersion,
String serverHome, String configName) {
+ IPath homePath = new Path(serverHome);
+ IPath configPath = homePath.append("server").append(configName);
+ ArrayList list = new ArrayList();
+ if (facetId.equals(WEB_FACET.getId())) {
+ IPath p =
configPath.append("deploy").append("jbossweb-tomcat50.sar");
+ list.add(getEntry(p.append("jsp-api.jar")));
+ list.add(getEntry(p.append("servlet-api.jar")));
+ } else if( (facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion))
+ || facetId.equals(EAR_FACET.getId()) ) {
+ list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
+ } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
+ list.add(getEntry(homePath.append("client").append("jbossall-client.jar")));
+ }
+ return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
+ }
+ protected IClasspathEntry[] loadClasspathEntriesDefault(String facetId, String
facetVersion, String serverHome, String configName) {
+ return new IClasspathEntry[0];
+ }
+
+ protected IClasspathEntry[] pathsAsEntries(IPath[] paths) {
+ IClasspathEntry[] entries = new IClasspathEntry[paths.length];
+ for( int i = 0; i < paths.length; i++ )
+ entries[i] = getEntry(paths[i]);
+ return entries;
+ }
+
+ }
+
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/ejb3/JBossEJB3LibrariesPage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/ejb3/JBossEJB3LibrariesPage.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/ejb3/JBossEJB3LibrariesPage.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -25,9 +25,9 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
+import org.jboss.ide.eclipse.as.classpath.core.ejb3.EJB30SupportVerifier;
import org.jboss.ide.eclipse.as.classpath.core.ejb3.EJB3ClasspathContainer;
import org.jboss.ide.eclipse.as.classpath.ui.ClasspathUIPlugin;
-import org.jboss.ide.eclipse.as.core.runtime.EJB30SupportVerifier;
import org.jboss.ide.eclipse.as.core.server.JBossServer;
public class JBossEJB3LibrariesPage extends JBossSelectionPage implements
IClasspathContainerPage
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2007-08-07 17:38:23 UTC (rev
2945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2007-08-07 20:41:35 UTC (rev
2946)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="jbosscore"/>
- <classpathentry exported="true" kind="lib"
path="getopt.jar"/>
<classpathentry exported="true" kind="lib"
path="dom4j-1.6.1.jar"/>
<classpathentry exported="true" kind="lib"
path="jaxen-1.1-beta-6.jar"/>
+ <classpathentry exported="true" kind="lib"
path="getopt.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/org.eclipse.jdt.core.prefs 2007-08-07
20:41:35 UTC (rev 2946)
@@ -1,12 +1,7 @@
-#Wed Aug 30 12:03:28 EDT 2006
+#Tue Aug 07 15:28:54 EDT 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-08-07
17:38:23 UTC (rev 2945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-08-07
20:41:35 UTC (rev 2946)
@@ -28,7 +28,6 @@
org.jboss.ide.eclipse.as.core.packages.types,
org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.runtime,
- org.jboss.ide.eclipse.as.core.runtime.internal,
org.jboss.ide.eclipse.as.core.runtime.server,
org.jboss.ide.eclipse.as.core.runtime.server.polling,
org.jboss.ide.eclipse.as.core.server,
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -1,30 +0,0 @@
-package org.jboss.ide.eclipse.as.core.runtime;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.wst.server.core.IRuntime;
-import
org.jboss.ide.eclipse.as.core.runtime.internal.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
-
-public class EJB30SupportVerifier {
- public static boolean verify(IRuntime rt) {
- AbstractJBossServerRuntime ajbsr =
(AbstractJBossServerRuntime)rt.loadAdapter(AbstractJBossServerRuntime.class, null);
- // i refuse to verify. if they say they support, believe them
- if( ajbsr == null ) return true;
-
- // one of ours. verify
- IPath path = new
Path("junk").append(rt.getId()).append("jst.ejb").append("3.0");
- WebtoolsProjectJBossClasspathContainer container =
- new WebtoolsProjectJBossClasspathContainer(path);
- IClasspathEntry[] entries = container.getClasspathEntries();
- if( entries.length == 0 ) return false;
- IPath p;
- for( int i = 0; i < entries.length; i++ ) {
- p = entries[i].getPath();
- if( !p.toFile().exists())
- return false;
- }
- return true;
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ClientAllRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ClientAllRuntimeClasspathProvider.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ClientAllRuntimeClasspathProvider.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -1,27 +0,0 @@
-package org.jboss.ide.eclipse.as.core.runtime.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
-
-public class ClientAllRuntimeClasspathProvider extends RuntimeClasspathProviderDelegate
{
-
- public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime)
{
- AbstractJBossServerRuntime rt = ((AbstractJBossServerRuntime)
(runtime.loadAdapter(AbstractJBossServerRuntime.class, new NullProgressMonitor())));
- String id = rt == null ? "" : rt.getId();
- IPath loc = runtime.getLocation();
- if( id.indexOf("4.2") > -1 ) {
- return new IClasspathEntry[] {
JavaCore.newLibraryEntry(loc.append("client").append("jbossall-client.jar"),
null, null) };
- } else if( id.indexOf("4.0") > -1 ) {
- return new IClasspathEntry[] {
JavaCore.newLibraryEntry(loc.append("client").append("jbossall-client.jar"),
null, null) };
- } else if( id.indexOf("3.2") > -1 ) {
- return new IClasspathEntry[] {
JavaCore.newLibraryEntry(loc.append("client").append("jbossall-client.jar"),
null, null) };
- }
- return null;
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ProjectRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ProjectRuntimeClasspathProvider.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/ProjectRuntimeClasspathProvider.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -1,89 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.runtime.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.common.project.facet.core.IClasspathProvider;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import
org.jboss.ide.eclipse.as.core.runtime.internal.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
-
-public class ProjectRuntimeClasspathProvider implements IClasspathProvider {
- private IRuntimeComponent rc;
-
- public ProjectRuntimeClasspathProvider() {
-
- }
-
- public ProjectRuntimeClasspathProvider(final IRuntimeComponent rc) {
- this.rc = rc;
- }
-
- public List getClasspathEntries(final IProjectFacetVersion fv) {
- IProjectFacet pf = fv.getProjectFacet();
- if (pf == null)
- return null;
-
-
- // initializer/runtimeId/facetId/facetVersion
- IPath path = new
Path("org.jboss.ide.eclipse.as.core.runtime.ProjectInitializer");
- path = path.append(rc.getProperty("id"));
- path = path.append(fv.getProjectFacet().getId());
- path = path.append(fv.getVersionString());
-
- WebtoolsProjectJBossClasspathContainer temp = new
WebtoolsProjectJBossClasspathContainer(path);
- // If we're a java runtime, just return that.
- if( temp.getClasspathEntries().length == 1 &&
fv.getProjectFacet().getId().equals("jst.java")) {
- return Arrays.asList(temp.getClasspathEntries());
- }
-
- // Otherwise just return the path to it, unless its empty in which case dont even
include it
- if( temp.getClasspathEntries().length != 0 ) {
- IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
- return Collections.singletonList(cpentry);
- }
- return new ArrayList();
- }
-
- public static final class Factory implements IAdapterFactory {
- private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class };
-
- public Object getAdapter(final Object adaptable, final Class adapterType) {
- IRuntimeComponent rc = (IRuntimeComponent) adaptable;
- return new ProjectRuntimeClasspathProvider(rc);
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-08-07
17:38:23 UTC (rev 2945)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/internal/WebtoolsProjectJBossClasspathContainerInitializer.java 2007-08-07
20:41:35 UTC (rev 2946)
@@ -1,282 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.runtime.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ClasspathContainerInitializer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
-
-
-public class WebtoolsProjectJBossClasspathContainerInitializer extends
- ClasspathContainerInitializer {
-
- private static final IProjectFacet JST_JAVA_FACET =
ProjectFacetsManager.getProjectFacet("jst.java");
- private static final IProjectFacet WEB_FACET =
ProjectFacetsManager.getProjectFacet("jst.web");
- private static final IProjectFacet EJB_FACET =
ProjectFacetsManager.getProjectFacet("jst.ejb");
- private static final IProjectFacet EAR_FACET =
ProjectFacetsManager.getProjectFacet("jst.ear");
- private static final IProjectFacet UTILITY_FACET =
ProjectFacetsManager.getProjectFacet("jst.utility");
- private static final IProjectFacet CONNECTOR_FACET =
ProjectFacetsManager.getProjectFacet("jst.connector");
- private static final IProjectFacet APP_CLIENT_FACET =
ProjectFacetsManager.getProjectFacet("jst.appclient");
-
-
- public WebtoolsProjectJBossClasspathContainerInitializer() {
- // TODO Auto-generated constructor stub
- }
-
- public void initialize(IPath containerPath, IJavaProject project)
- throws CoreException {
- WebtoolsProjectJBossClasspathContainer container = new
WebtoolsProjectJBossClasspathContainer(containerPath);
-
- JavaCore.setClasspathContainer(containerPath,
- new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
- }
-
-
-
-
-
-
- public static class WebtoolsProjectJBossClasspathContainer implements
IClasspathContainer {
- private IPath path;
- private IClasspathEntry[] entries = null;
-
- public WebtoolsProjectJBossClasspathContainer(IPath path) {
- this.path = path;
- }
-
- public String getDescription() {
- if( path.segmentCount() < 4 ) return "JBoss Runtimes";
- return "JBoss Runtimes (" + path.segment(2) + " : " +
path.segment(3) + ")";
- }
-
- public int getKind() {
- return IClasspathContainer.K_APPLICATION;
- }
-
- public IPath getPath() {
- return path;
- }
-
-
-
- public IClasspathEntry[] getClasspathEntries() {
- if( entries == null ) {
- loadClasspathEntries();
- if( entries == null )
- return new IClasspathEntry[0];
- }
- return entries;
- }
-
- private void loadClasspathEntries() {
- if( path.segmentCount() < 4 ) return;
- String runtimeId = path.segment(1);
- String facetId = path.segment(2);
- String facetVersion = path.segment(3);
-
-
- if( runtimeId == null ) return;
-
- IRuntime runtime = ServerCore.findRuntime(runtimeId);
- if( runtime == null ) return;
-
- Object serverRuntime = runtime.loadAdapter(AbstractJBossServerRuntime.class, null);
-
- if( serverRuntime == null ) return;
- AbstractJBossServerRuntime jbRuntime = (AbstractJBossServerRuntime)serverRuntime;
-
- String serverHome = runtime.getLocation().toOSString();
- String configName = jbRuntime.getJBossConfiguration();
-
- String jbossVersion = jbRuntime.getId();
-
- entries = loadClasspathEntries2(runtimeId, facetId, facetVersion,
- serverHome, configName, jbossVersion, jbRuntime);
- }
-
- protected IClasspathEntry[] loadClasspathEntries2(String runtimeId, String facetId,
- String facetVersion, String serverHome, String configName, String jbVersion,
- AbstractJBossServerRuntime jbsRuntime) {
- if( facetId.equals(JST_JAVA_FACET.getId())) {
- return loadJREClasspathEntries(jbsRuntime);
- } else if( jbVersion.equals("4.2")) {
- return loadClasspathEntries42(facetId, facetVersion, serverHome, configName);
- } else if( jbVersion.equals("4.0"))
- return loadClasspathEntries40(facetId, facetVersion, serverHome, configName);
- if( jbVersion.equals("3.2"))
- return loadClasspathEntries32( facetId, facetVersion, serverHome, configName);
- return loadClasspathEntriesDefault(facetId, facetVersion, serverHome, configName);
- }
-
- protected boolean isEjb30(String facetId, String facetVersion) {
- if( facetId.equals(EJB_FACET.getId()) && facetVersion.equals("3.0"))
- return true;
- return false;
- }
-
- protected IClasspathEntry getEntry(IPath path) {
- return JavaRuntime.newArchiveRuntimeClasspathEntry(path).getClasspathEntry();
- }
- protected IClasspathEntry[] getEntries(IPath folder) {
- String[] files = folder.toFile().list();
- ArrayList list = new ArrayList();
- for( int i = 0; i < files.length; i++ ) {
- if( files[i].endsWith(".jar")) {
- list.add(getEntry(folder.append(files[i])));
- }
- }
- return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
- }
- protected IClasspathEntry[] loadJREClasspathEntries(AbstractJBossServerRuntime
jbsRuntime) {
- IVMInstall vmInstall = jbsRuntime.getVM();
- if (vmInstall != null) {
- String name = vmInstall.getName();
- String typeId = vmInstall.getVMInstallType().getId();
- return new IClasspathEntry[] { JavaCore.newContainerEntry(new
Path(JavaRuntime.JRE_CONTAINER).append(typeId).append(name)) };
- }
- return null;
- }
-
- protected IClasspathEntry[] loadClasspathEntries42(String facetId, String facetVersion,
String serverHome, String configName) {
- IPath homePath = new Path(serverHome);
- IPath configPath = homePath.append("server").append(configName);
- ArrayList list = new ArrayList();
- if (facetId.equals(WEB_FACET.getId())) {
- IPath jsfDir =
configPath.append("deploy").append("jboss-web.deployer").append("jsf-libs");
- list.add(getEntry(configPath.append("lib").append("jsp-api.jar")));
- list.add(getEntry(homePath.append("client").append("servlet-api.jar")));
- list.add(getEntry(jsfDir.append("jsf-api.jar")));
- list.add(getEntry(jsfDir.append("jsf-impl.jar")));
- } else if( facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion)) {
- list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
- } else if( isEjb30(facetId, facetVersion)) {
- // path roots
- IPath deploy = configPath.append("deploy");
- IPath deployer = deploy.append("ejb3.deployer");
- IPath aopDeployer = deploy.append("jboss-aop-jdk50.deployer");
- IPath client = homePath.append("client");
-
- list.add(getEntry(configPath.append("lib").append("jboss-ejb3x.jar")));
- list.add(getEntry(deployer.append("jboss-ejb3.jar")));
- list.add(getEntry(deployer.append("jboss-annotations-ejb3.jar")));
-
- // aop
- list.add(getEntry(aopDeployer.append("jboss-aop-jdk50.jar")));
- list.add(getEntry(aopDeployer.append("jboss-aspect-library-jdk50.jar")));
-
- // hibernate
- list.add(getEntry(homePath.append("client").append("hibernate-client.jar")));
-
- // persistence jar
- list.add(getEntry(client.append("ejb3-persistence.jar")));
-
- } else if( facetId.equals(EAR_FACET.getId())) {
- list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
- } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
- list.add(getEntry(homePath.append("client").append("jbossall-client.jar")));
- }
- return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
- }
-
- protected IClasspathEntry[] loadClasspathEntries40(String facetId, String facetVersion,
String serverHome, String configName) {
- IPath homePath = new Path(serverHome);
- IPath configPath = homePath.append("server").append(configName);
- ArrayList list = new ArrayList();
- if (facetId.equals(WEB_FACET.getId())) {
- IPath jsfDir =
configPath.append("deploy").append("jbossweb-tomcat55.sar").append("jsf-libs");
- list.add(getEntry(configPath.append("lib").append("javax.servlet.jsp.jar")));
- list.add(getEntry(homePath.append("client").append("javax.servlet.jar")));
- list.addAll(Arrays.asList(getEntries(jsfDir)));
- } else if( facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion)) {
- list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
- } else if( isEjb30(facetId, facetVersion)) {
- // path roots
- IPath deploy = configPath.append("deploy");
- IPath deployer = deploy.append("ejb3.deployer");
- IPath aopDeployer = deploy.append("jboss-aop-jdk50.deployer");
-
- // ejb3
- list.add(getEntry(deployer.append("jboss-ejb3x.jar")));
- list.add(getEntry(deployer.append("jboss-ejb3.jar")));
- list.add(getEntry(deployer.append("jboss-annotations-ejb3.jar")));
-
- // aop
- list.add(getEntry(aopDeployer.append("jboss-aop-jdk50.jar")));
- list.add(getEntry(aopDeployer.append("jboss-aspect-library-jdk50.jar")));
-
- // hibernate
- list.add(getEntry(homePath.append("client").append("hibernate-client.jar")));
-
- } else if( facetId.equals(EAR_FACET.getId())) {
- list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
- } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
- list.add(JavaRuntime.newArchiveRuntimeClasspathEntry(homePath.append("client").append("jbossall-client.jar")).getClasspathEntry());
- }
- return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
- }
-
-
- protected IClasspathEntry[] loadClasspathEntries32(String facetId, String facetVersion,
String serverHome, String configName) {
- IPath homePath = new Path(serverHome);
- IPath configPath = homePath.append("server").append(configName);
- ArrayList list = new ArrayList();
- if (facetId.equals(WEB_FACET.getId())) {
- IPath p =
configPath.append("deploy").append("jbossweb-tomcat50.sar");
- list.add(getEntry(p.append("jsp-api.jar")));
- list.add(getEntry(p.append("servlet-api.jar")));
- } else if( (facetId.equals(EJB_FACET.getId()) && !isEjb30(facetId,
facetVersion))
- || facetId.equals(EAR_FACET.getId()) ) {
- list.add(getEntry(homePath.append("client").append("jboss-j2ee.jar")));
- } else if( facetId.equals(APP_CLIENT_FACET.getId())) {
- list.add(getEntry(homePath.append("client").append("jbossall-client.jar")));
- }
- return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
- }
- protected IClasspathEntry[] loadClasspathEntriesDefault(String facetId, String
facetVersion, String serverHome, String configName) {
- return new IClasspathEntry[0];
- }
-
- protected IClasspathEntry[] pathsAsEntries(IPath[] paths) {
- IClasspathEntry[] entries = new IClasspathEntry[paths.length];
- for( int i = 0; i < paths.length; i++ )
- entries[i] = getEntry(paths[i]);
- return entries;
- }
-
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-08-07 17:38:23 UTC (rev
2945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-08-07 20:41:35 UTC (rev
2946)
@@ -338,53 +338,10 @@
<facet id="jst.ear" version="1.2,1.3,1.4"/>
<facet id="jst.appclient" version="1.2,1.3,1.4"/>
</supported>
-
- <adapter>
- <runtime-component
- id="org.jboss.ide.eclipse.as.runtime.component.32"
- version="3.2"/>
- <factory
-
class="org.jboss.ide.eclipse.as.core.runtime.internal.ProjectRuntimeClasspathProvider$Factory"/>
- <type
-
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
- </adapter>
-
- <adapter>
- <runtime-component
- id="org.jboss.ide.eclipse.as.runtime.component.40"
- version="4.0"/>
- <factory
-
class="org.jboss.ide.eclipse.as.core.runtime.internal.ProjectRuntimeClasspathProvider$Factory"/>
- <type
-
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
- </adapter>
-
- <adapter>
- <runtime-component
- id="org.jboss.ide.eclipse.as.runtime.component.42"
- version="4.2"/>
- <factory
-
class="org.jboss.ide.eclipse.as.core.runtime.internal.ProjectRuntimeClasspathProvider$Factory"/>
- <type
-
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
- </adapter>
</extension>
<extension
- point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
-
class="org.jboss.ide.eclipse.as.core.runtime.internal.WebtoolsProjectJBossClasspathContainerInitializer"
- id="org.jboss.ide.eclipse.as.core.runtime.ProjectInitializer"/>
- </extension>
-
- <extension
point="org.eclipse.jst.server.core.runtimeClasspathProviders">
- <runtimeClasspathProvider
- id="org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget"
- runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32,
org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42"
-
class="org.jboss.ide.eclipse.as.core.runtime.internal.ClientAllRuntimeClasspathProvider"/>
- </extension>
- <extension
point="org.eclipse.wst.server.core.moduleTypes">
<moduleType
id="jboss.package"