Add error message to new project wizard if project already exists

Change-Id: Ifeeaf25954261ff2ba1287103f6ca2f8186aeee8
This commit is contained in:
Kevin O'Connor
2014-09-08 14:51:37 -04:00
parent e60baf41a9
commit 887a4e94f3

View File

@@ -21,6 +21,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
@@ -79,8 +81,14 @@ public class ProjectCreationUtils {
} catch (CoreException e) {
WPILibCore.logError("Can't create new project.", e);
}
}else {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "Error! A project of the same name already exists in the Workspace");
}
});
}
return newProject;
}