Author: rob.stryker(a)jboss.com
Date: 2010-01-05 18:15:33 -0500 (Tue, 05 Jan 2010)
New Revision: 19655
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
Log:
JBIDE-4889
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java 2010-01-05
20:53:24 UTC (rev 19654)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java 2010-01-05
23:15:33 UTC (rev 19655)
@@ -28,6 +28,7 @@
import org.eclipse.jdt.core.IJavaProject;
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.eclipse.wst.server.core.IRuntime;
@@ -56,7 +57,7 @@
}
public List getClasspathEntries(final IProjectFacetVersion fv) {
- IPath path;
+ IPath path = null;
if( fv.getProjectFacet().getId().equals(ClasspathConstants.FACET_JST_JAVA) ) {
path = new Path(CONTAINER_ID);
path = path.append(rc.getProperty("id")); //$NON-NLS-1$
@@ -65,16 +66,29 @@
IClasspathEntry[] entries =
new WebtoolsProjectJBossClasspathContainer(path).getClasspathEntries();
return Arrays.asList(entries);
- } else {
+ } else if( isPrimaryFacet(fv.getProjectFacet())){
String id = rc.getProperty("id"); //$NON-NLS-1$
IPath containerPath = new
Path("org.eclipse.jst.server.core.container").append("org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget");
//$NON-NLS-1$ //$NON-NLS-2$
path = containerPath.append(id);
}
-
- IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
- return Collections.singletonList(cpentry);
+ if( path != null ) {
+ IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
+ return Collections.singletonList(cpentry);
+ }
+ return Collections.emptyList();
}
+ // Bad name, I know, but checks if this is
+ // an ear, war, ejb, or other top level facet
+ protected boolean isPrimaryFacet(IProjectFacet facet) {
+ WebtoolsProjectJBossClasspathContainerInitializer del = new
WebtoolsProjectJBossClasspathContainerInitializer();
+ return facet.equals(del.WEB_FACET)
+ || facet.equals(del.EJB_FACET)
+ || facet.equals(del.EAR_FACET)
+ || facet.equals(del.CONNECTOR_FACET)
+ || facet.equals(del.APP_CLIENT_FACET);
+ }
+
public static final class Factory implements IAdapterFactory {
private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class };
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2010-01-05
20:53:24 UTC (rev 19654)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/WebtoolsProjectJBossClasspathContainerInitializer.java 2010-01-05
23:15:33 UTC (rev 19655)
@@ -48,13 +48,13 @@
public class WebtoolsProjectJBossClasspathContainerInitializer extends
ClasspathContainerInitializer implements ClasspathConstants {
- private static final IProjectFacet JST_JAVA_FACET =
ProjectFacetsManager.getProjectFacet(FACET_JST_JAVA);
- private static final IProjectFacet WEB_FACET =
ProjectFacetsManager.getProjectFacet(FACET_WEB);
- private static final IProjectFacet EJB_FACET =
ProjectFacetsManager.getProjectFacet(FACET_EJB);
- private static final IProjectFacet EAR_FACET =
ProjectFacetsManager.getProjectFacet(FACET_EAR);
- private static final IProjectFacet UTILITY_FACET =
ProjectFacetsManager.getProjectFacet(FACET_UTILITY);
- private static final IProjectFacet CONNECTOR_FACET =
ProjectFacetsManager.getProjectFacet(FACET_CONNECTOR);
- private static final IProjectFacet APP_CLIENT_FACET =
ProjectFacetsManager.getProjectFacet(FACET_APP_CLIENT);
+ public static final IProjectFacet JST_JAVA_FACET =
ProjectFacetsManager.getProjectFacet(FACET_JST_JAVA);
+ public static final IProjectFacet WEB_FACET =
ProjectFacetsManager.getProjectFacet(FACET_WEB);
+ public static final IProjectFacet EJB_FACET =
ProjectFacetsManager.getProjectFacet(FACET_EJB);
+ public static final IProjectFacet EAR_FACET =
ProjectFacetsManager.getProjectFacet(FACET_EAR);
+ public static final IProjectFacet UTILITY_FACET =
ProjectFacetsManager.getProjectFacet(FACET_UTILITY);
+ public static final IProjectFacet CONNECTOR_FACET =
ProjectFacetsManager.getProjectFacet(FACET_CONNECTOR);
+ public static final IProjectFacet APP_CLIENT_FACET =
ProjectFacetsManager.getProjectFacet(FACET_APP_CLIENT);
public WebtoolsProjectJBossClasspathContainerInitializer() {
Show replies by date