Author: rob.stryker(a)jboss.com
Date: 2010-01-06 15:26:23 -0500 (Wed, 06 Jan 2010)
New Revision: 19666
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
Log:
JBIDE-4889 - committing once more with changes to ESB
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-06
15:12:29 UTC (rev 19665)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ProjectRuntimeClasspathProvider.java 2010-01-06
20:26:23 UTC (rev 19666)
@@ -66,7 +66,7 @@
IClasspathEntry[] entries =
new WebtoolsProjectJBossClasspathContainer(path).getClasspathEntries();
return Arrays.asList(entries);
- } else /*if( isPrimaryFacet(fv.getProjectFacet())) */{
+ } 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);
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-01-06
15:12:29 UTC (rev 19665)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2010-01-06
20:26:23 UTC (rev 19666)
@@ -42,7 +42,6 @@
IProject project;
private IDataModel model;
- private String serverRuntimeId;
public JBossClassPathCommand(IProject project, IDataModel model) {
this.project = project;
@@ -57,30 +56,38 @@
public IStatus executeOverride(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
try {
-
// store runtime name and runtime location to the project
boolean isServerSupplied =
model.getBooleanProperty(IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED);
+ IPath esbContainerPath = null;
if(isServerSupplied){
- serverRuntimeId = getProjectTargetRuntimeID(project);
- String[] segments = new
String[]{JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED,
- serverRuntimeId};
- status = addClassPath(project, segments);
+ String serverRuntimeId = getProjectTargetRuntimeID(project);
+ esbContainerPath = new
Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID)
+ .append(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED)
+ .append(serverRuntimeId);
}else{
String runtimeName = model
.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
String runtimeLocation = model
.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_HOME);
String esbcontentFolder =
model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
- project
- .setPersistentProperty(
+ project.setPersistentProperty(
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
runtimeName);
project.setPersistentProperty(
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
runtimeLocation);
project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER,
esbcontentFolder);
- status = addClassPath(project, new String[]{runtimeName});
+ esbContainerPath = new
Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED)
+ .append(runtimeName );
}
+
+ // Add the esb container
+ status = addClassPath(project, esbContainerPath);
+
+ // Add the regular server container
+// 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);
+
} catch (CoreException e) {
status = StatusUtils.errorStatus(
JBossFacetCoreMessages.Error_Add_Facet_JBossESB, e);
@@ -98,16 +105,18 @@
}
- public IStatus addClassPath(IProject project, String[] segments) {
+ /**
+ * This can add *any* container path
+ * @param project
+ * @param path
+ * @return
+ */
+ public static IStatus addClassPath(IProject project, IPath path) {
IStatus status = Status.OK_STATUS;
try {
IClasspathEntry newClasspath;
IJavaProject javaProject = JavaCore.create(project);
- IPath path = new
Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID);
- for(String segment: segments ){
- path = path.append(segment);
- }
newClasspath = JavaCore.newContainerEntry(path);
IClasspathEntry[] oldClasspathEntries = javaProject
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2010-01-06
15:12:29 UTC (rev 19665)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2010-01-06
20:26:23 UTC (rev 19666)
@@ -20,18 +20,25 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jst.server.core.internal.JavaServerPlugin;
+import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
+import org.eclipse.jst.server.core.internal.RuntimeClasspathProviderWrapper;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.ESBProjectCorePlugin;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.core.facet.JBossClassPathCommand;
import org.jboss.tools.esb.project.ui.ESBSharedImages;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.wizards.pages.ESBProjectFirstPage;
@@ -86,6 +93,16 @@
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IDE.openEditor(page, esbFile);
+ // Add the server runtime as well
+ IFacetedProject fp = ProjectFacetsManager.create(project);
+ IRuntime runtime = fp.getPrimaryRuntime();
+ String name = runtime.getName();
+ org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore.findRuntime(name);
+ RuntimeClasspathProviderWrapper rcpw =
JavaServerPlugin.findRuntimeClasspathProvider(serverRuntime.getRuntimeType());
+ IPath serverContainerPath = new Path(RuntimeClasspathContainer.SERVER_CONTAINER)
+ .append(rcpw.getId()).append(serverRuntime.getId());
+ JBossClassPathCommand.addClassPath(project, serverContainerPath);
+
} catch (CoreException e) {
ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
}
Show replies by date