diff --git a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/CreateRemoteProjectActionDelegate.java b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/CreateRemoteProjectActionDelegate.java index 7425261b86b..545faa14113 100644 --- a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/CreateRemoteProjectActionDelegate.java +++ b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/CreateRemoteProjectActionDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -23,6 +23,7 @@ * Martin Oberhuber (Wind River) - [188360] renamed from plugin org.eclipse.rse.eclipse.filesystem * Remy Chi Jian Suen (IBM) - [192906][efs] No Error when trying to Create Remote Project when project with name exists * Martin Oberhuber (Wind River) - [182350] Support creating remote project on Windows Drive + * Remy Chi Jian Suen (IBM) - [202098][efs][nls] Improve error message when creating a remote project with existing name ********************************************************************************/ package org.eclipse.rse.internal.efs.ui; @@ -48,6 +49,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.osgi.util.NLS; import org.eclipse.rse.internal.efs.Activator; import org.eclipse.rse.internal.efs.RSEFileSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; @@ -185,14 +187,12 @@ public class CreateRemoteProjectActionDelegate implements IActionDelegate { IProject editProject = root.getProject(projectName); try { - //FIXME re-enable for 3.0 -- just allowing editProject.create() throw for now to avoid NLS change - //Should apply the patch from bug 192906 to Messages.java and messages.properties -// if (editProject.exists()) -// { -// throw new CoreException(new Status(IStatus.ERROR, -// Activator.getDefault().getBundle().getSymbolicName(), -// NLS.bind(Messages.CreateRemoteProjectActionDelegate_PROJECT_EXISTS, directoryName))); -// } + if (editProject.exists()) + { + throw new CoreException(new Status(IStatus.ERROR, + Activator.getDefault().getBundle().getSymbolicName(), + NLS.bind(Messages.CreateRemoteProjectActionDelegate_PROJECT_EXISTS, projectName))); + } IProjectDescription description = root.getWorkspace().newProjectDescription(projectName); String hostNameOrAddr = directory.getParentRemoteFileSubSystem().getHost().getHostName(); diff --git a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/Messages.java b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/Messages.java index bf61c8d54b4..579e38bd3ca 100644 --- a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/Messages.java +++ b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [188360] renamed from plugin org.eclipse.rse.eclipse.filesystem + * Remy Chi Jian Suen (IBM) - [202098][efs][nls] Improve error message when creating a remote project with existing name *******************************************************************************/ package org.eclipse.rse.internal.efs.ui; @@ -16,6 +17,7 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.rse.internal.efs.ui.messages"; //$NON-NLS-1$ public static String CreateRemoteProjectActionDelegate_CREATING_TITLE; + public static String CreateRemoteProjectActionDelegate_PROJECT_EXISTS; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/messages.properties b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/messages.properties index d4a77ad6f3d..5493bfdd9c5 100644 --- a/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/messages.properties +++ b/rse/plugins/org.eclipse.rse.efs.ui/src/org/eclipse/rse/internal/efs/ui/messages.properties @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (c) 2007 IBM Corporation and others. All rights reserved. +# Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. # This program and the accompanying materials are made available under the terms # of the Eclipse Public License v1.0 which accompanies this distribution, and is # available at http://www.eclipse.org/legal/epl-v10.html @@ -7,9 +7,11 @@ # Contributors: # David Dykstal (IBM) - initial contribution # Martin Oberhuber (Wind River) - [188360] renamed from plugin org.eclipse.rse.eclipse.filesystem +# Remy Chi Jian Suen (IBM) - [202098][efs][nls] Improve error message when creating a remote project with existing name ################################################################################ # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 CreateRemoteProjectActionDelegate_CREATING_TITLE=Creating Remote Project +CreateRemoteProjectActionDelegate_PROJECT_EXISTS = A project named {0} already exists.