Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 147727
Collapse All | Expand All

(-)src/org/eclipse/ui/internal/ide/messages.properties (-1 lines)
Lines 393-399 Link Here
393
# --- New Project ---
393
# --- New Project ---
394
WizardNewProjectCreationPage_description = Create a new project
394
WizardNewProjectCreationPage_description = Create a new project
395
WizardNewProjectCreationPage_locationError = Invalid project contents directory
395
WizardNewProjectCreationPage_locationError = Invalid project contents directory
396
WizardNewProjectCreationPage_defaultLocationError = Project contents cannot be inside workspace directory
397
WizardNewProjectCreationPage_projectNameEmpty = Project name must be specified
396
WizardNewProjectCreationPage_projectNameEmpty = Project name must be specified
398
WizardNewProjectCreationPage_projectLocationEmpty = Project contents directory must be specified
397
WizardNewProjectCreationPage_projectLocationEmpty = Project contents directory must be specified
399
WizardNewProjectCreationPage_projectExistsMessage = A project with that name already exists in the workspace.
398
WizardNewProjectCreationPage_projectExistsMessage = A project with that name already exists in the workspace.
(-)src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java (-1 lines)
Lines 378-384 Link Here
378
	// --- New Project ---
378
	// --- New Project ---
379
	public static String WizardNewProjectCreationPage_description;
379
	public static String WizardNewProjectCreationPage_description;
380
	public static String WizardNewProjectCreationPage_locationError;
380
	public static String WizardNewProjectCreationPage_locationError;
381
	public static String WizardNewProjectCreationPage_defaultLocationError;
382
	public static String WizardNewProjectCreationPage_projectNameEmpty;
381
	public static String WizardNewProjectCreationPage_projectNameEmpty;
383
	public static String WizardNewProjectCreationPage_projectLocationEmpty;
382
	public static String WizardNewProjectCreationPage_projectLocationEmpty;
384
	public static String WizardNewProjectCreationPage_projectExistsMessage;
383
	public static String WizardNewProjectCreationPage_projectExistsMessage;
(-)src/org/eclipse/ui/internal/ide/dialogs/ProjectContentsLocationArea.java (-15 / +13 lines)
Lines 13-24 Link Here
13
13
14
import java.net.URI;
14
import java.net.URI;
15
import java.net.URISyntaxException;
15
import java.net.URISyntaxException;
16
17
import org.eclipse.core.filesystem.IFileInfo;
16
import org.eclipse.core.filesystem.IFileInfo;
18
import org.eclipse.core.filesystem.URIUtil;
17
import org.eclipse.core.filesystem.URIUtil;
19
import org.eclipse.core.resources.IProject;
18
import org.eclipse.core.resources.IProject;
19
import org.eclipse.core.resources.ResourcesPlugin;
20
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.IPath;
22
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Path;
22
import org.eclipse.core.runtime.Path;
24
import org.eclipse.core.runtime.Platform;
23
import org.eclipse.core.runtime.Platform;
Lines 382-401 Link Here
382
			return IDEWorkbenchMessages.ProjectLocationSelectionDialog_locationError;
381
			return IDEWorkbenchMessages.ProjectLocationSelectionDialog_locationError;
383
		}
382
		}
384
383
385
		if (existingProject == null) {
384
		//create a dummy project for the purpose of validation if necessary
386
			IPath projectPath = new Path(locationFieldContents);
385
		IProject project = existingProject;
387
			if (Platform.getLocation().isPrefixOf(projectPath)) {
386
		if (project == null) {
388
				return IDEWorkbenchMessages.WizardNewProjectCreationPage_defaultLocationError;
387
			String name = new Path(locationFieldContents).lastSegment();
389
			}
388
			project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
390
389
		}
391
		} else {
390
		IStatus locationStatus = project.getWorkspace()
392
			IStatus locationStatus = existingProject.getWorkspace()
391
				.validateProjectLocationURI(project, newPath);
393
					.validateProjectLocationURI(existingProject, newPath);
394
395
			if (!locationStatus.isOK()) {
396
				return locationStatus.getMessage();
397
			}
398
392
393
		if (!locationStatus.isOK()) {
394
			return locationStatus.getMessage();
395
		}
396
		if (existingProject != null) {
399
			URI projectPath = existingProject.getLocationURI();
397
			URI projectPath = existingProject.getLocationURI();
400
			if (projectPath != null && URIUtil.equals(projectPath, newPath)) {
398
			if (projectPath != null && URIUtil.equals(projectPath, newPath)) {
401
				return IDEWorkbenchMessages.ProjectLocationSelectionDialog_locationError;
399
				return IDEWorkbenchMessages.ProjectLocationSelectionDialog_locationError;
(-)src/org/eclipse/ui/internal/ide/dialogs/WizardNewProjectNameAndLocationPage.java (-6 lines)
Lines 430-441 Link Here
430
            setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_locationError);
430
            setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_locationError);
431
            return false;
431
            return false;
432
        }
432
        }
433
        if (!useDefaults
434
                && Platform.getLocation().isPrefixOf(
435
                        new Path(locationFieldContents))) {
436
            setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_defaultLocationError);
437
            return false;
438
        }
439
433
440
        if (getProjectHandle().exists()) {
434
        if (getProjectHandle().exists()) {
441
            setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);
435
            setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);

Return to bug 147727