From be7e1b0a6bf76fd9703b67e9d00d63e940a7ee61 Mon Sep 17 00:00:00 2001 From: Edward Mann Date: Sun, 6 Jan 2008 20:40:23 +0000 Subject: [PATCH] Fix for bug #1839622 RSE Path error. You can now create a PHP Project and use RSE as the source. --- .../wizards/NewProjectCreationWizard.java | 25 ++++++++----------- 1 files changed, 11 insertions(+), 14 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java index 176d442..559b7bc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/NewProjectCreationWizard.java @@ -1,6 +1,7 @@ package net.sourceforge.phpeclipse.wizards; import java.lang.reflect.InvocationTargetException; +import java.net.URI; import net.sourceforge.phpdt.core.JavaCore; import net.sourceforge.phpdt.ui.actions.OpenPHPPerspectiveAction; @@ -9,12 +10,11 @@ import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExecutableExtension; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.ui.INewWizard; @@ -66,15 +66,15 @@ public class NewProjectCreationWizard extends BasicNewResourceWizard implements remainingWorkUnits); IWorkspace workspace = PHPeclipsePlugin.getWorkspace(); - newProject = projectPage.getProjectHandle(); - + String projectName = projectPage.getProjectHandle().getName(); + newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IProjectDescription description = workspace - .newProjectDescription(newProject.getName()); - IPath path = Platform.getLocation(); - IPath customPath = projectPage.getLocationPath(); - if (!path.equals(customPath)) { - path = customPath; - description.setLocation(path); + .newProjectDescription(projectName); + + URI uriPath = (!projectPage.useDefaults()) ? projectPage + .getLocationURI() : null; + if (uriPath != null) { + description.setLocationURI(uriPath); } try { @@ -90,11 +90,8 @@ public class NewProjectCreationWizard extends BasicNewResourceWizard implements JavaCore.addPHPNature(newProject, new SubProgressMonitor( monitor, remainingWorkUnits)); - // patch #1692034 - set the coding of this PHPeclipse - // project to UTF-8 by default for all operating systems: - newProject.setDefaultCharset("UTF-8", monitor); - } catch (CoreException e) { + System.out.println(e); throw new InvocationTargetException(e); } finally { monitor.done(); -- 1.7.1