mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
handle execeptions in runnable when creating project
This commit is contained in:
parent
adb8d76574
commit
4415f739fb
4 changed files with 25 additions and 31 deletions
|
@ -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);
|
super.doRun(monitor);
|
||||||
// Add C++ Nature.
|
// Add C++ Nature.
|
||||||
if (newProject != null) {
|
if (newProject != null) {
|
||||||
try {
|
CCProjectNature.addCCNature(newProject, monitor);
|
||||||
CCProjectNature.addCCNature(newProject, monitor);
|
|
||||||
} catch (CoreException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,14 @@ package org.eclipse.cdt.ui.wizards;
|
||||||
* All Rights Reserved.
|
* 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.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
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.setTitle(CPlugin.getResourceString(SETTINGS_TITLE));
|
||||||
fTabFolderPage.setDescription(CPlugin.getResourceString(SETTINGS_DESC));
|
fTabFolderPage.setDescription(CPlugin.getResourceString(SETTINGS_DESC));
|
||||||
}
|
}
|
||||||
protected void doRun(IProgressMonitor monitor) {
|
protected void doRun(IProgressMonitor monitor) throws CoreException {
|
||||||
super.doRun(monitor);
|
super.doRun(monitor);
|
||||||
// Add C++ Nature.
|
// Add C++ Nature.
|
||||||
if (newProject != null) {
|
if (newProject != null) {
|
||||||
|
@ -45,10 +44,7 @@ public class StdCCWizard extends StdMakeProjectWizard {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
monitor.beginTask("Standard C++ Make", 1);
|
monitor.beginTask("Standard C++ Make", 1);
|
||||||
try {
|
CCProjectNature.addCCNature(newProject, new SubProgressMonitor(monitor, 1));
|
||||||
CCProjectNature.addCCNature(newProject, new SubProgressMonitor(monitor, 1));
|
|
||||||
} catch (CoreException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,8 @@ package org.eclipse.cdt.ui.wizards;
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.CPlugin;
|
import org.eclipse.cdt.internal.ui.CPlugin;
|
||||||
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,6 +5,9 @@ package org.eclipse.cdt.ui.wizards;
|
||||||
* All Rights Reserved.
|
* 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.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
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.TabFolder;
|
||||||
import org.eclipse.swt.widgets.TabItem;
|
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 doRunEpilogue(IProgressMonitor monitor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doRun(IProgressMonitor monitor) {
|
protected void doRun(IProgressMonitor monitor) throws CoreException {
|
||||||
super.doRun(monitor);
|
super.doRun(monitor);
|
||||||
if (newProject != null) {
|
if (newProject != null) {
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
monitor.beginTask("Standard Make", 3);
|
monitor.beginTask("Standard Make", 3);
|
||||||
try {
|
// Update the referenced project if provided.
|
||||||
// Update the referenced project if provided.
|
if (referenceBlock != null) {
|
||||||
if (referenceBlock != null) {
|
referenceBlock.doRun(newProject, new SubProgressMonitor(monitor, 1));
|
||||||
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 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";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue