blob: bc75c8a38e72f969a6f9169927f3f7691c62606d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*******************************************************************************
* Copyright (c) 2007, 2010 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Intel Corporation - initial API and implementation
* IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.ui.wizards;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.ui.newui.Messages;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
* The wizard to create new MBS C Project.
*/
public class CProjectWizard extends CDTCommonProjectWizard {
public CProjectWizard() {
super(Messages.NewModelProjectWizard_4, Messages.NewModelProjectWizard_5);
}
@Override
public String[] getNatures() {
return new String[] { CProjectNature.C_NATURE_ID };
}
@Override
protected IProject continueCreation(IProject prj) {
if (continueCreationMonitor == null) {
continueCreationMonitor = new NullProgressMonitor();
}
try {
continueCreationMonitor.beginTask(Messages.CProjectWizard_0, 1);
CProjectNature.addCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));
} catch (CoreException e) {
} finally {
continueCreationMonitor.done();
}
return prj;
}
@Override
public String[] getContentTypeIDs() {
return new String[] { CCorePlugin.CONTENT_TYPE_CSOURCE, CCorePlugin.CONTENT_TYPE_CHEADER };
}
}
|