1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

handle execeptions in runnable when creating project

This commit is contained in:
David Inglis 2002-08-13 13:17:21 +00:00
parent adb8d76574
commit 4415f739fb
4 changed files with 25 additions and 31 deletions

View file

@ -56,14 +56,11 @@ public abstract class CCProjectWizard extends CProjectWizard {
}
protected void doRun(IProgressMonitor monitor) {
protected void doRun(IProgressMonitor monitor) throws CoreException {
super.doRun(monitor);
// Add C++ Nature.
if (newProject != null) {
try {
CCProjectNature.addCCNature(newProject, monitor);
} catch (CoreException e) {
}
CCProjectNature.addCCNature(newProject, monitor);
}
}
}

View file

@ -5,15 +5,14 @@ package org.eclipse.cdt.ui.wizards;
* All Rights Reserved.
*/
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.internal.ui.CPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.internal.ui.CPlugin;
/**
*/
@ -37,7 +36,7 @@ public class StdCCWizard extends StdMakeProjectWizard {
fTabFolderPage.setTitle(CPlugin.getResourceString(SETTINGS_TITLE));
fTabFolderPage.setDescription(CPlugin.getResourceString(SETTINGS_DESC));
}
protected void doRun(IProgressMonitor monitor) {
protected void doRun(IProgressMonitor monitor) throws CoreException {
super.doRun(monitor);
// Add C++ Nature.
if (newProject != null) {
@ -45,10 +44,7 @@ public class StdCCWizard extends StdMakeProjectWizard {
monitor = new NullProgressMonitor();
}
monitor.beginTask("Standard C++ Make", 1);
try {
CCProjectNature.addCCNature(newProject, new SubProgressMonitor(monitor, 1));
} catch (CoreException e) {
}
CCProjectNature.addCCNature(newProject, new SubProgressMonitor(monitor, 1));
}
}
}

View file

@ -5,9 +5,8 @@ package org.eclipse.cdt.ui.wizards;
* All Rights Reserved.
*/
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.cdt.internal.ui.CPlugin;
import org.eclipse.swt.widgets.TabFolder;
/**
*/

View file

@ -5,6 +5,9 @@ package org.eclipse.cdt.ui.wizards;
* All Rights Reserved.
*/
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.ui.CPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@ -14,9 +17,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.ui.CPlugin;
/**
*/
@ -70,26 +70,28 @@ public abstract class StdMakeProjectWizard extends CProjectWizard {
protected void doRunEpilogue(IProgressMonitor monitor) {
}
protected void doRun(IProgressMonitor monitor) {
protected void doRun(IProgressMonitor monitor) throws CoreException {
super.doRun(monitor);
if (newProject != null) {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
monitor.beginTask("Standard Make", 3);
try {
// Update the referenced project if provided.
if (referenceBlock != null) {
referenceBlock.doRun(newProject, new SubProgressMonitor(monitor, 1));
}
// Update the settings.
if (settingsBlock != null) {
settingsBlock.doRun(newProject, new SubProgressMonitor(monitor, 1));
}
// Set the Default C Builder.
CProjectNature.addCBuildSpec(newProject, new SubProgressMonitor(monitor, 1));
} catch (CoreException e) {
// Update the referenced project if provided.
if (referenceBlock != null) {
referenceBlock.doRun(newProject, new SubProgressMonitor(monitor, 1));
}
// Update the settings.
if (settingsBlock != null) {
settingsBlock.doRun(newProject, new SubProgressMonitor(monitor, 1));
}
// Set the Default C Builder.
CProjectNature.addCBuildSpec(newProject, new SubProgressMonitor(monitor, 1));
}
}
public String getProjectID() {
return CCorePlugin.getDefault().PLUGIN_ID + ".make";
}
}