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 250982 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java (-31 / +42 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Intel Corporation - initial API and implementation
9
 *     Intel Corporation - initial API and implementation
10
 *     IBM Corporation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.managedbuilder.ui.wizards;
12
package org.eclipse.cdt.managedbuilder.ui.wizards;
12
13
Lines 26-31 Link Here
26
import org.eclipse.cdt.ui.newui.UIMessages;
27
import org.eclipse.cdt.ui.newui.UIMessages;
27
import org.eclipse.core.resources.IProject;
28
import org.eclipse.core.resources.IProject;
28
import org.eclipse.core.runtime.CoreException;
29
import org.eclipse.core.runtime.CoreException;
30
import org.eclipse.core.runtime.IProgressMonitor;
29
import org.eclipse.jface.wizard.IWizard;
31
import org.eclipse.jface.wizard.IWizard;
30
import org.eclipse.swt.widgets.Composite;
32
import org.eclipse.swt.widgets.Composite;
31
33
Lines 48-87 Link Here
48
	/**
50
	/**
49
	 * Note that configurations parameter is ignored
51
	 * Note that configurations parameter is ignored
50
	 */
52
	 */
51
	public void createProject(IProject project, boolean defaults, boolean onFinish)  throws CoreException {
53
	@Override
52
		ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
54
	public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)  throws CoreException {
53
		ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
55
		try {
54
		ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
56
			monitor.beginTask("", 100);//$NON-NLS-1$
55
		ManagedProject mProj = new ManagedProject(des);
57
		
56
		info.setManagedProject(mProj);
58
			ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
57
59
			ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
58
		cfgs = CfgHolder.unique(fConfigPage.getCfgItems(defaults));
60
			ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
59
		cfgs = CfgHolder.reorder(cfgs);
61
			ManagedProject mProj = new ManagedProject(des);
60
			
62
			info.setManagedProject(mProj);
61
		for (int i=0; i<cfgs.length; i++) {
63
			monitor.worked(20);
62
			String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId();  //$NON-NLS-1$
64
			cfgs = CfgHolder.unique(fConfigPage.getCfgItems(defaults));
63
			Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
65
			cfgs = CfgHolder.reorder(cfgs);
64
			IBuilder bld = cfg.getEditableBuilder();
66
			int work = 50/cfgs.length;
65
			if (bld != null) {
67
			for (int i=0; i<cfgs.length; i++) {
66
				if(bld.isInternalBuilder()){
68
				String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId();  //$NON-NLS-1$
67
					IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
69
				Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
68
					IBuilder prefBuilder = prefCfg.getBuilder();
70
				IBuilder bld = cfg.getEditableBuilder();
69
					cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
71
				if (bld != null) {
70
					bld = cfg.getEditableBuilder();
72
					if(bld.isInternalBuilder()){
71
					bld.setBuildPath(null);
73
						IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
74
						IBuilder prefBuilder = prefCfg.getBuilder();
75
						cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
76
						bld = cfg.getEditableBuilder();
77
						bld.setBuildPath(null);
78
					}
79
					bld.setManagedBuildOn(false);
80
				} else {
81
					System.out.println(UIMessages.getString("StdProjectTypeHandler.3")); //$NON-NLS-1$
72
				}
82
				}
73
				bld.setManagedBuildOn(false);
83
				cfg.setArtifactName(removeSpaces(project.getName()));
74
			} else {
84
				CConfigurationData data = cfg.getConfigurationData();
75
				System.out.println(UIMessages.getString("StdProjectTypeHandler.3")); //$NON-NLS-1$
85
				des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
86
				monitor.worked(work);
76
			}
87
			}
77
			cfg.setArtifactName(removeSpaces(project.getName()));
88
			mngr.setProjectDescription(project, des);
78
			CConfigurationData data = cfg.getConfigurationData();
89
			
79
			des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
90
			doTemplatesPostProcess(project);
91
			doCustom(project);
92
			monitor.worked(30);
93
		} finally {
94
			monitor.done();
80
		}
95
		}
81
		mngr.setProjectDescription(project, des);
82
		
83
		doTemplatesPostProcess(project);
84
		doCustom(project);
85
	}
96
	}
86
	public boolean canCreateWithoutToolchain() { return true; } 
97
	public boolean canCreateWithoutToolchain() { return true; } 
87
	
98
	
(-)src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java (-48 / +58 lines)
Lines 54-59 Link Here
54
import org.eclipse.cdt.ui.wizards.IWizardItemsListListener;
54
import org.eclipse.cdt.ui.wizards.IWizardItemsListListener;
55
import org.eclipse.core.resources.IProject;
55
import org.eclipse.core.resources.IProject;
56
import org.eclipse.core.runtime.CoreException;
56
import org.eclipse.core.runtime.CoreException;
57
import org.eclipse.core.runtime.IProgressMonitor;
57
import org.eclipse.core.runtime.IStatus;
58
import org.eclipse.core.runtime.IStatus;
58
import org.eclipse.core.runtime.Status;
59
import org.eclipse.core.runtime.Status;
59
import org.eclipse.jface.operation.IRunnableWithProgress;
60
import org.eclipse.jface.operation.IRunnableWithProgress;
Lines 496-549 Link Here
496
		full_tcs.put(tc.getUniqueRealName(), tc);
497
		full_tcs.put(tc.getUniqueRealName(), tc);
497
	}
498
	}
498
		
499
		
499
	public void createProject(IProject project, boolean defaults, boolean onFinish) throws CoreException {
500
	public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
500
		ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
501
		try {
501
		ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
502
			monitor.beginTask("", 100); //$NON-NLS-1$
502
		ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
503
			ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
503
504
			ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
504
		cfgs = fConfigPage.getCfgItems(false);
505
			ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
505
		if (cfgs == null || cfgs.length == 0) 
506
			monitor.worked(10);
506
			cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
507
			cfgs = fConfigPage.getCfgItems(false);
507
		
508
			if (cfgs == null || cfgs.length == 0) 
508
		if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) {
509
				cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
509
			throw new CoreException(new Status(IStatus.ERROR, 
510
			
510
					ManagedBuilderUIPlugin.getUniqueIdentifier(),
511
			if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) {
511
					Messages.getString("CWizardHandler.6"))); //$NON-NLS-1$
512
				throw new CoreException(new Status(IStatus.ERROR, 
512
		}
513
						ManagedBuilderUIPlugin.getUniqueIdentifier(),
513
		Configuration cf = (Configuration)cfgs[0].getConfiguration();
514
						Messages.getString("CWizardHandler.6"))); //$NON-NLS-1$
514
		ManagedProject mProj = new ManagedProject(project, cf.getProjectType());
515
			}
515
		info.setManagedProject(mProj);
516
			Configuration cf = (Configuration)cfgs[0].getConfiguration();
516
517
			ManagedProject mProj = new ManagedProject(project, cf.getProjectType());
517
		cfgs = CfgHolder.unique(cfgs);
518
			info.setManagedProject(mProj);
518
		cfgs = CfgHolder.reorder(cfgs);
519
			monitor.worked(10);
519
		
520
			cfgs = CfgHolder.unique(cfgs);
520
		ICConfigurationDescription cfgDebug = null;
521
			cfgs = CfgHolder.reorder(cfgs);
521
		ICConfigurationDescription cfgFirst = null;
522
			
522
		
523
			ICConfigurationDescription cfgDebug = null;
523
		for(int i = 0; i < cfgs.length; i++){
524
			ICConfigurationDescription cfgFirst = null;
524
			cf = (Configuration)cfgs[i].getConfiguration();
525
			
525
			String id = ManagedBuildManager.calculateChildId(cf.getId(), null);
526
			int work = 50/cfgs.length;
526
			Configuration config = new Configuration(mProj, cf, id, false, true);
527
			
527
			CConfigurationData data = config.getConfigurationData();
528
			for(int i = 0; i < cfgs.length; i++){
528
			ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
529
				cf = (Configuration)cfgs[i].getConfiguration();
529
			config.setConfigurationDescription(cfgDes);
530
				String id = ManagedBuildManager.calculateChildId(cf.getId(), null);
530
			config.exportArtifactInfo();
531
				Configuration config = new Configuration(mProj, cf, id, false, true);
531
532
				CConfigurationData data = config.getConfigurationData();
532
			IBuilder bld = config.getEditableBuilder();
533
				ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
533
			if (bld != null) { 	bld.setManagedBuildOn(true); }
534
				config.setConfigurationDescription(cfgDes);
534
			
535
				config.exportArtifactInfo();
535
			config.setName(cfgs[i].getName());
536
	
536
			config.setArtifactName(removeSpaces(project.getName()));
537
				IBuilder bld = config.getEditableBuilder();
537
			
538
				if (bld != null) { 	bld.setManagedBuildOn(true); }
538
			IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
539
				
539
			if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))
540
				config.setName(cfgs[i].getName());
540
				cfgDebug = cfgDes;
541
				config.setArtifactName(removeSpaces(project.getName()));
541
			if (cfgFirst == null) // select at least first configuration 
542
				
542
				cfgFirst = cfgDes; 
543
				IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
543
		}
544
				if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))
544
		mngr.setProjectDescription(project, des);
545
					cfgDebug = cfgDes;
545
		doTemplatesPostProcess(project);
546
				if (cfgFirst == null) // select at least first configuration 
546
		doCustom(project);
547
					cfgFirst = cfgDes; 
548
				monitor.worked(work);
549
			}
550
			mngr.setProjectDescription(project, des);
551
			doTemplatesPostProcess(project);
552
			doCustom(project);
553
			monitor.worked(30);
554
		} finally {
555
			monitor.done();
556
		}
547
	}
557
	}
548
	
558
	
549
	protected void doTemplatesPostProcess(IProject prj) {
559
	protected void doTemplatesPostProcess(IProject prj) {
(-)src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java (-12 / +55 lines)
Lines 30-35 Link Here
30
import org.eclipse.core.runtime.IExecutableExtension;
30
import org.eclipse.core.runtime.IExecutableExtension;
31
import org.eclipse.core.runtime.IProgressMonitor;
31
import org.eclipse.core.runtime.IProgressMonitor;
32
import org.eclipse.core.runtime.NullProgressMonitor;
32
import org.eclipse.core.runtime.NullProgressMonitor;
33
import org.eclipse.core.runtime.SubProgressMonitor;
33
import org.eclipse.jface.dialogs.MessageDialog;
34
import org.eclipse.jface.dialogs.MessageDialog;
34
import org.eclipse.jface.operation.IRunnableWithProgress;
35
import org.eclipse.jface.operation.IRunnableWithProgress;
35
import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
36
import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
Lines 222-244 Link Here
222
		final boolean defaults = _defaults;
223
		final boolean defaults = _defaults;
223
		return new IRunnableWithProgress() {
224
		return new IRunnableWithProgress() {
224
			public void run(IProgressMonitor imonitor) throws InvocationTargetException, InterruptedException {
225
			public void run(IProgressMonitor imonitor) throws InvocationTargetException, InterruptedException {
226
				final Exception except[] = new Exception[1];
225
				getShell().getDisplay().syncExec(new Runnable() {
227
				getShell().getDisplay().syncExec(new Runnable() {
226
					public void run() { 
228
					public void run() {
229
						IRunnableWithProgress op= new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() {
230
							public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
231
								final IProgressMonitor fMonitor;
232
								if (monitor == null) {
233
									fMonitor= new NullProgressMonitor();
234
								} else {
235
									fMonitor = monitor;
236
								}
237
								fMonitor.beginTask(CUIPlugin.getResourceString("CProjectWizard.op_description"), 100); //$NON-NLS-1$
238
								fMonitor.worked(10);
239
								try {							
240
									newProject = createIProject(lastProjectName, lastProjectLocation, new SubProgressMonitor(fMonitor, 40));
241
									if (newProject != null) 
242
										fMainPage.h_selected.createProject(newProject, defaults, onFinish, new SubProgressMonitor(fMonitor, 40));
243
									fMonitor.worked(10);
244
								} catch (CoreException e) {	CUIPlugin.log(e); }
245
								finally {
246
									fMonitor.done();
247
								}
248
							}
249
						});
227
						try {
250
						try {
228
							newProject = createIProject(lastProjectName, lastProjectLocation);
251
							getContainer().run(false, true, op);
229
							if (newProject != null) 
252
						} catch (InvocationTargetException e) {
230
								fMainPage.h_selected.createProject(newProject, defaults, onFinish);
253
							except[0] = e;
231
						} catch (CoreException e) {	CUIPlugin.log(e); }
254
						} catch (InterruptedException e) {
255
							except[0] = e;
256
						}
232
					}
257
					}
233
				});
258
				});
259
				if (except[0] != null) {
260
					if (except[0] instanceof InvocationTargetException) {
261
						throw (InvocationTargetException)except[0];
262
					}
263
					if (except[0] instanceof InterruptedException) {
264
						throw (InterruptedException)except[0];
265
					}
266
					throw new InvocationTargetException(except[0]);
267
				}					
234
			}
268
			}
235
		};
269
		};
236
	}
270
	}
237
271
238
	/**
272
	/**
273
	 * @param monitor 
239
	 * 
274
	 * 
240
	 */	
275
	 */	
241
	public IProject createIProject(final String name, final URI location) throws CoreException{
276
	public IProject createIProject(final String name, final URI location, IProgressMonitor monitor) throws CoreException{
277
		
278
		monitor.beginTask("createIProject", 100);
279
		
242
		if (newProject != null)	return newProject;
280
		if (newProject != null)	return newProject;
243
		
281
		
244
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
282
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
Lines 252-277 Link Here
252
			IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
290
			IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
253
			if(location != null)
291
			if(location != null)
254
				description.setLocationURI(location);
292
				description.setLocationURI(location);
255
			newProject = CCorePlugin.getDefault().createCDTProject(description, newProjectHandle, new NullProgressMonitor());
293
			newProject = CCorePlugin.getDefault().createCDTProject(description, newProjectHandle, new SubProgressMonitor(monitor,25));
256
		} else {
294
		} else {
257
			IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
295
			IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
258
				public void run(IProgressMonitor monitor) throws CoreException {
296
				public void run(IProgressMonitor monitor) throws CoreException {
259
					newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, monitor);
297
					newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, monitor);
260
				}
298
				}
261
			};
299
			};
262
			NullProgressMonitor monitor = new NullProgressMonitor();
300
//			NullProgressMonitor monitor = new NullProgressMonitor();
263
			workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, monitor);
301
			workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, new SubProgressMonitor(monitor,25));
264
			newProject = newProjectHandle;
302
			newProject = newProjectHandle;
265
		}
303
		}
266
        
304
        
267
		// Open the project if we have to
305
		// Open the project if we have to
268
		if (!newProject.isOpen()) {
306
		if (!newProject.isOpen()) {
269
			newProject.open(new NullProgressMonitor());
307
			newProject.open(new SubProgressMonitor(monitor,25));
270
		}
308
		}
271
		return continueCreation(newProject);	
309
		
310
		IProject proj = continueCreation(newProject, new SubProgressMonitor(monitor,25));
311
		
312
		monitor.done();
313
		
314
		return proj;	
272
	}
315
	}
273
	
316
	
274
	protected abstract IProject continueCreation(IProject prj); 
317
	protected abstract IProject continueCreation(IProject prj, IProgressMonitor monitor); 
275
	public abstract String[] getNatures();
318
	public abstract String[] getNatures();
276
	
319
	
277
	@Override
320
	@Override
(-)src/org/eclipse/cdt/ui/wizards/CWizardHandler.java (-4 / +8 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Intel Corporation - initial API and implementation
9
 *     Intel Corporation - initial API and implementation
10
 *     IBM Corporation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.ui.wizards;
12
package org.eclipse.cdt.ui.wizards;
12
13
Lines 14-19 Link Here
14
15
15
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.jface.wizard.IWizardPage;
19
import org.eclipse.jface.wizard.IWizardPage;
18
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.graphics.Image;
21
import org.eclipse.swt.graphics.Image;
Lines 137-145 Link Here
137
	 * 
139
	 * 
138
	 * @param proj - simple project to be used as base
140
	 * @param proj - simple project to be used as base
139
	 * @param defaults - true if called from 1st Wizard page
141
	 * @param defaults - true if called from 1st Wizard page
142
	 * @param monitor - progress monitor to track the creation process
140
	 * @throws CoreException
143
	 * @throws CoreException
141
	 */
144
	 */
142
	public void createProject(IProject proj, boolean defaults)
145
	public void createProject(IProject proj, boolean defaults, IProgressMonitor monitor)
143
			throws CoreException {}
146
			throws CoreException {}
144
147
145
	/**
148
	/**
Lines 148-160 Link Here
148
	 * @param proj - simple project to be used as base
151
	 * @param proj - simple project to be used as base
149
	 * @param defaults - true if called from 1st Wizard page
152
	 * @param defaults - true if called from 1st Wizard page
150
	 * @param onFinish - true when the project creation is performed on finish. false -otherwise
153
	 * @param onFinish - true when the project creation is performed on finish. false -otherwise
151
	 * false means that the project created is actually a temporary one that can be removed in case cancell is pressed
154
	 * false means that the project created is actually a temporary one that can be removed in case cancel is pressed
155
	 * @param monitor - progress monitor to track the creation process
152
	 * 
156
	 * 
153
	 * @throws CoreException
157
	 * @throws CoreException
154
	 */
158
	 */
155
	public void createProject(IProject proj, boolean defaults, boolean onFinish)
159
	public void createProject(IProject proj, boolean defaults, boolean onFinish, IProgressMonitor monitor)
156
			throws CoreException {
160
			throws CoreException {
157
		createProject(proj, defaults);
161
		createProject(proj, defaults, monitor);
158
	}
162
	}
159
	/**
163
	/**
160
	 * 
164
	 * 
(-)src/org/eclipse/cdt/ui/wizards/CCProjectWizard.java (-5 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 Intel Corporation and others.
2
 * Copyright (c) 2007, 2008 Intel Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-18 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Intel Corporation - initial API and implementation
9
 *     Intel Corporation - initial API and implementation
10
 *     IBM Corporation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.ui.wizards;
12
package org.eclipse.cdt.ui.wizards;
12
13
13
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.NullProgressMonitor;
16
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.core.runtime.SubProgressMonitor;
16
18
17
import org.eclipse.cdt.core.CCProjectNature;
19
import org.eclipse.cdt.core.CCProjectNature;
18
import org.eclipse.cdt.core.CProjectNature;
20
import org.eclipse.cdt.core.CProjectNature;
Lines 30-40 Link Here
30
	}
32
	}
31
	
33
	
32
	@Override
34
	@Override
33
	protected IProject continueCreation(IProject prj) {
35
	protected IProject continueCreation(IProject prj, IProgressMonitor monitor) {
34
		try {
36
		try {
35
			CProjectNature.addCNature(prj, new NullProgressMonitor());
37
			monitor.beginTask(UIMessages.getString("CCProjectWizard.0"), 2); //$NON-NLS-1$
36
			CCProjectNature.addCCNature(prj, new NullProgressMonitor());
38
			CProjectNature.addCNature(prj, new SubProgressMonitor(monitor, 1));
39
			CCProjectNature.addCCNature(prj, new SubProgressMonitor(monitor, 1));
37
		} catch (CoreException e) {}
40
		} catch (CoreException e) {}
41
		finally {monitor.done();}
38
		return prj;
42
		return prj;
39
	}
43
	}
40
44
(-)src/org/eclipse/cdt/ui/wizards/CProjectWizard.java (-4 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 Intel Corporation and others.
2
 * Copyright (c) 2007, 2008 Intel Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-18 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Intel Corporation - initial API and implementation
9
 *     Intel Corporation - initial API and implementation
10
 *     IBM Corporation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.ui.wizards;
12
package org.eclipse.cdt.ui.wizards;
12
13
13
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.NullProgressMonitor;
16
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.core.runtime.SubProgressMonitor;
16
18
17
import org.eclipse.cdt.core.CProjectNature;
19
import org.eclipse.cdt.core.CProjectNature;
18
import org.eclipse.cdt.ui.newui.UIMessages;
20
import org.eclipse.cdt.ui.newui.UIMessages;
Lines 30-39 Link Here
30
	}
32
	}
31
33
32
	@Override
34
	@Override
33
	protected IProject continueCreation(IProject prj) {
35
	protected IProject continueCreation(IProject prj, IProgressMonitor monitor) {
34
		try {
36
		try {
35
			CProjectNature.addCNature(prj, new NullProgressMonitor());
37
			monitor.beginTask(UIMessages.getString("CProjectWizard.0"), 1); //$NON-NLS-1$
38
			CProjectNature.addCNature(prj, new SubProgressMonitor(monitor, 1));
36
		} catch (CoreException e) {}
39
		} catch (CoreException e) {}
40
		finally {monitor.done();}
37
		return prj;
41
		return prj;
38
	}
42
	}
39
43
(-)src/org/eclipse/cdt/ui/wizards/CDTProjectWizard.java (-2 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007 Intel Corporation and others.
2
 * Copyright (c) 2007, 2008 Intel Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-16 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Intel Corporation - initial API and implementation
9
 *     Intel Corporation - initial API and implementation
10
 *     IBM Corporation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.ui.wizards;
12
package org.eclipse.cdt.ui.wizards;
12
13
13
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.runtime.IProgressMonitor;
14
16
15
import org.eclipse.cdt.ui.newui.UIMessages;
17
import org.eclipse.cdt.ui.newui.UIMessages;
16
18
Lines 26-32 Link Here
26
	}
28
	}
27
29
28
	@Override
30
	@Override
29
	protected IProject continueCreation(IProject prj) {
31
	protected IProject continueCreation(IProject prj, IProgressMonitor monitor) {
30
		return prj;
32
		return prj;
31
	}
33
	}
32
34
(-)src/org/eclipse/cdt/ui/newui/PluginResources.properties (+2 lines)
Lines 526-531 Link Here
526
NewCfgDialog.5=Import predefined
526
NewCfgDialog.5=Import predefined
527
CDTMainWizardPage.0=Project name cannot contain '\#' symbol
527
CDTMainWizardPage.0=Project name cannot contain '\#' symbol
528
CDTMainWizardPage.1=Project category is selected. Expand the category and select a concrete project type.
528
CDTMainWizardPage.1=Project category is selected. Expand the category and select a concrete project type.
529
CProjectWizard.0=Add C Project Nature
530
CCProjectWizard.0=Add CC Project Nature
529
WorkingSetConfigAction.0=Symbols '
531
WorkingSetConfigAction.0=Symbols '
530
WorkingSetConfigAction.1=Choose active configs for Working Sets
532
WorkingSetConfigAction.1=Choose active configs for Working Sets
531
WorkingSetConfigAction.10=-- CURRENT --
533
WorkingSetConfigAction.10=-- CURRENT --

Return to bug 250982