Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-04 18:33:09 -0400
committerAndrew Gvozdev2012-05-04 18:35:17 -0400
commitd2c19fcd47de828faef36593bce200b1226eb8af (patch)
treec390dd0d3a1df34187ebb66b40c44c175e30e224 /build/org.eclipse.cdt.managedbuilder.ui
parenta5fd3894d10a265185f60c0555fc36d619cdbaca (diff)
downloadorg.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.tar.gz
org.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.tar.xz
org.eclipse.cdt-d2c19fcd47de828faef36593bce200b1226eb8af.zip
bug 376592: [sd90] Extend BuildDefinitions to allow defining language settings providers
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java174
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java265
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java97
7 files changed, 296 insertions, 260 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index aa14d2bdc2..cbb257072d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -577,8 +577,13 @@
>
<enabledWhen>
<adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
+ <and>
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
+ <or>
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable="/>
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable=true"/>
+ </or>
+ </and>
</adapt>
</enabledWhen>
</page>
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
index 5986337af0..69436a7ed9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
@@ -223,6 +223,7 @@ public class Messages extends NLS {
public static String PropertyPageDefsTab_9;
public static String PropertyPageDefsTab_showIncludeFileTab;
public static String PropertyPageDefsTab_showProvidersTab;
+ public static String PropertyPageDefsTab_showScannerDiscoveryTab;
public static String RefreshPolicyExceptionDialog_addDialogLabel;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
index a39e524536..59bc380dca 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
@@ -274,7 +274,8 @@ PropertyPageDefsTab_7=Show disc. page names if they are unique. Else show profil
PropertyPageDefsTab_8=Always show names + profile IDs
PropertyPageDefsTab_9=Always show profile IDs only
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
-PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tabs
+PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tab and enable language settings providers
+PropertyPageDefsTab_showScannerDiscoveryTab=Display "Scanner Discovery" tab
ProjectConvert_convertersList=Converters List
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
index 9c6bb0af7e..c54c02609f 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
@@ -11,8 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.preferences;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
@@ -34,109 +34,116 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
private static final int SPACING = 5; // for radio buttons layout
- private Button show_tree;
- private Button show_inc_files;
- private Button show_mng;
- private Button show_tool;
- private Button show_exp;
- private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
- private Button show_tipbox;
+ private Button show_tree;
+ private Button show_inc_files;
+ private Button show_mng;
+ private Button show_tool;
+ private Button show_exp;
+ private Button show_sd;
+ private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
+ private Button show_tipbox;
- private Button b_0;
- private Button b_1;
- private Button b_2;
- private Button b_3;
+ private Button b_0;
+ private Button b_1;
+ private Button b_2;
+ private Button b_3;
- private Button s_0;
- private Button s_1;
- private Button s_2;
+ private Button s_0;
+ private Button s_1;
+ private Button s_2;
@Override
public void createControls(Composite parent) {
super.createControls(parent);
usercomp.setLayout(new GridLayout(1, false));
- show_mng = new Button(usercomp, SWT.CHECK);
- show_mng.setText(Messages.PropertyPageDefsTab_0);
- show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_mng = new Button(usercomp, SWT.CHECK);
+ show_mng.setText(Messages.PropertyPageDefsTab_0);
+ show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- show_inc_files = new Button(usercomp, SWT.CHECK);
- show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
- show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_inc_files = new Button(usercomp, SWT.CHECK);
+ show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
+ show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tree = new Button(usercomp, SWT.CHECK);
- show_tree.setText(Messages.PropertyPageDefsTab_1);
- show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_tree.setText(Messages.PropertyPageDefsTab_1);
+ show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tool = new Button(usercomp, SWT.CHECK);
- show_tool.setText(Messages.PropertyPageDefsTab_4);
- show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ show_tool.setText(Messages.PropertyPageDefsTab_4);
+ show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_exp = new Button(usercomp, SWT.CHECK);
- show_exp.setText(Messages.PropertyPageDefsTab_10);
- show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- show_providers_tab = new Button(usercomp, SWT.CHECK);
- show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
- show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- show_tipbox = new Button(usercomp, SWT.CHECK);
- show_tipbox.setText(Messages.PropertyPageDefsTab_16);
- show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Group saveGrp = new Group(usercomp, SWT.NONE);
- saveGrp.setText(Messages.PropertyPageDefsTab_11);
- saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- FillLayout fl = new FillLayout(SWT.VERTICAL);
- fl.spacing = SPACING;
- fl.marginHeight = SPACING;
- fl.marginWidth = SPACING;
- saveGrp.setLayout(fl);
-
- s_0 = new Button(saveGrp, SWT.RADIO);
- s_0.setText(Messages.PropertyPageDefsTab_13);
- s_1 = new Button(saveGrp, SWT.RADIO);
- s_1.setText(Messages.PropertyPageDefsTab_12);
- s_2 = new Button(saveGrp, SWT.RADIO);
- s_2.setText(Messages.PropertyPageDefsTab_14);
-
- Group discGrp = new Group(usercomp, SWT.NONE);
- discGrp.setText(Messages.PropertyPageDefsTab_5);
- discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fl = new FillLayout(SWT.VERTICAL);
- fl.spacing = SPACING;
- fl.marginHeight = SPACING;
- fl.marginWidth = SPACING;
- discGrp.setLayout(fl);
-
- b_0 = new Button(discGrp, SWT.RADIO);
- b_0.setText(Messages.PropertyPageDefsTab_6);
- b_1 = new Button(discGrp, SWT.RADIO);
- b_1.setText(Messages.PropertyPageDefsTab_7);
- b_2 = new Button(discGrp, SWT.RADIO);
- b_2.setText(Messages.PropertyPageDefsTab_8);
- b_3 = new Button(discGrp, SWT.RADIO);
- b_3.setText(Messages.PropertyPageDefsTab_9);
-
- show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
- show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
+ show_exp.setText(Messages.PropertyPageDefsTab_10);
+ show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_sd = new Button(usercomp, SWT.CHECK);
+ show_sd.setText(Messages.PropertyPageDefsTab_showScannerDiscoveryTab);
+ show_sd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_providers_tab = new Button(usercomp, SWT.CHECK);
+ show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
+ show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ show_tipbox = new Button(usercomp, SWT.CHECK);
+ show_tipbox.setText(Messages.PropertyPageDefsTab_16);
+ show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Group saveGrp = new Group(usercomp, SWT.NONE);
+ saveGrp.setText(Messages.PropertyPageDefsTab_11);
+ saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ FillLayout fl = new FillLayout(SWT.VERTICAL);
+ fl.spacing = SPACING;
+ fl.marginHeight = SPACING;
+ fl.marginWidth = SPACING;
+ saveGrp.setLayout(fl);
+
+ s_0 = new Button(saveGrp, SWT.RADIO);
+ s_0.setText(Messages.PropertyPageDefsTab_13);
+ s_1 = new Button(saveGrp, SWT.RADIO);
+ s_1.setText(Messages.PropertyPageDefsTab_12);
+ s_2 = new Button(saveGrp, SWT.RADIO);
+ s_2.setText(Messages.PropertyPageDefsTab_14);
+
+ Group discGrp = new Group(usercomp, SWT.NONE);
+ discGrp.setText(Messages.PropertyPageDefsTab_5);
+ discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fl = new FillLayout(SWT.VERTICAL);
+ fl.spacing = SPACING;
+ fl.marginHeight = SPACING;
+ fl.marginWidth = SPACING;
+ discGrp.setLayout(fl);
+
+ b_0 = new Button(discGrp, SWT.RADIO);
+ b_0.setText(Messages.PropertyPageDefsTab_6);
+ b_1 = new Button(discGrp, SWT.RADIO);
+ b_1.setText(Messages.PropertyPageDefsTab_7);
+ b_2 = new Button(discGrp, SWT.RADIO);
+ b_2.setText(Messages.PropertyPageDefsTab_8);
+ b_3 = new Button(discGrp, SWT.RADIO);
+ b_3.setText(Messages.PropertyPageDefsTab_9);
+
+ show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
+ show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
- show_providers_tab.setSelection(!CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS));
+ // ensure default is "true" for scanner discovery tab
+ show_sd.setSelection(!CDTPrefUtil.getStr(CDTPrefUtil.KEY_SHOW_SD).equals(Boolean.FALSE.toString()));
+ show_providers_tab.setSelection(ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null));
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
- case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
- case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
+ case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
}
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_POSSAVE)) {
- case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
- case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
- default: s_0.setSelection(true); break;
+ case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
+ case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
+ default: s_0.setSelection(true); break;
}
}
@@ -147,7 +154,9 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
- CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS, !show_providers_tab.getSelection());
+ // ensure default is "true" for scanner discovery tab
+ CDTPrefUtil.setStr(CDTPrefUtil.KEY_SHOW_SD, Boolean.toString(show_sd.getSelection()));
+ ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(null, show_providers_tab.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
int x = 0;
if (b_1.getSelection()) x = 1;
@@ -168,7 +177,8 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
show_mng.setSelection(true);
show_tool.setSelection(true);
show_exp.setSelection(false);
- show_providers_tab.setSelection(false);
+ show_sd.setSelection(true);
+ show_providers_tab.setSelection(true);
show_tipbox.setSelection(false);
b_0.setSelection(true);
b_1.setSelection(false);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
index 73be50d9ad..8d204ec1f7 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java
@@ -41,8 +41,9 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
-import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.ui.templateengine.IWizardDataPage;
import org.eclipse.cdt.ui.templateengine.Template;
@@ -73,10 +74,10 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
/**
* This object is created per each Project type
- *
+ *
* It is responsible for:
* - corresponding line in left pane of 1st wizard page
- * - whole view of right pane, including
+ * - whole view of right pane, including
*
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -84,16 +85,17 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
public class MBSWizardHandler extends CWizardHandler {
public static final String ARTIFACT = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$
public static final String EMPTY_STR = ""; //$NON-NLS-1$
-
+
private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
- private static final String tooltip =
- Messages.CWizardHandler_1 +
- Messages.CWizardHandler_2 +
- Messages.CWizardHandler_3 +
- Messages.CWizardHandler_4 +
- Messages.CWizardHandler_5;
-
+
+ private static final String tooltip =
+ Messages.CWizardHandler_1 +
+ Messages.CWizardHandler_2 +
+ Messages.CWizardHandler_3 +
+ Messages.CWizardHandler_4 +
+ Messages.CWizardHandler_5;
+
protected SortedMap<String, IToolChain> full_tcs = new TreeMap<String, IToolChain>();
private String propertyId = null;
private IProjectType pt = null;
@@ -102,16 +104,16 @@ public class MBSWizardHandler extends CWizardHandler {
private IToolChain[] savedToolChains = null;
private IWizard wizard;
private IWizardPage startingPage;
-// private EntryDescriptor entryDescriptor = null;
+ // private EntryDescriptor entryDescriptor = null;
private EntryInfo entryInfo;
protected CfgHolder[] cfgs = null;
protected IWizardPage[] customPages;
-
+
/**
* Current list of preferred toolchains
*/
private List<String> preferredTCs = new ArrayList<String>();
-
+
protected static final class EntryInfo {
private SortedMap<String, IToolChain> tcs;
private EntryDescriptor entryDescriptor;
@@ -124,12 +126,12 @@ public class MBSWizardHandler extends CWizardHandler {
private IWizardPage predatingPage;
private IWizardPage followingPage;
private IWizard wizard;
-
+
public EntryInfo(EntryDescriptor dr, SortedMap<String, IToolChain> _tcs){
entryDescriptor = dr;
tcs = _tcs;
}
-
+
/**
* @since 5.1
*/
@@ -137,7 +139,7 @@ public class MBSWizardHandler extends CWizardHandler {
this(dr, _tcs);
wizard = w;
}
-
+
public boolean isValid(){
initialize();
return isValid;
@@ -147,7 +149,7 @@ public class MBSWizardHandler extends CWizardHandler {
initialize();
return template;
}
-
+
public EntryDescriptor getDescriptor(){
return entryDescriptor;
}
@@ -155,19 +157,19 @@ public class MBSWizardHandler extends CWizardHandler {
private void initialize(){
if(initialized)
return;
-
+
do {
if(entryDescriptor == null)
break;
String path[] = entryDescriptor.getPathArray();
if(path == null || path.length == 0)
break;
-
+
projectTypeId = path[0];
- if(!entryDescriptor.isDefaultForCategory() &&
+ if(!entryDescriptor.isDefaultForCategory() &&
path.length > 1 && (!path[0].equals(ManagedBuildWizard.OTHERS_LABEL))){
- templateId = path[path.length - 1];
- Template templates[] = null;
+ templateId = path[path.length - 1];
+ Template templates[] = null;
if(wizard instanceof ICDTCommonProjectWizard) {
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)wizard;
String[] langIDs = wz.getLanguageIDs();
@@ -175,42 +177,42 @@ public class MBSWizardHandler extends CWizardHandler {
List<Template> lstTemplates = new ArrayList<Template>();
for (String id : langIDs) {
lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
- getTemplates(projectTypeId, null, id)));
- }
+ getTemplates(projectTypeId, null, id)));
+ }
templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
}
- }
+ }
if(null == templates) {
- templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
+ templates = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
}
if((null == templates) || (templates.length == 0))
break;
-
+
for (Template t : templates) {
if(t.getTemplateId().equals(templateId)){
template = t;
break;
}
}
-
+
if(template == null)
break;
}
-
+
isValid = true;
} while(false);
initialized = true;
}
-
+
public Template getInitializedTemplate(IWizardPage predatingPage, IWizardPage followingPage, Map<String, String> map){
getNextPage(predatingPage, followingPage);
-
+
Template template = getTemplate();
-
+
if(template != null){
Map<String, String> valueStore = template.getValueStore();
-// valueStore.clear();
+ // valueStore.clear();
for (IWizardPage page : templatePages) {
if (page instanceof UIWizardPage)
valueStore.putAll(((UIWizardPage)page).getPageData());
@@ -223,11 +225,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
return template;
}
-
+
public IWizardPage getNextPage(IWizardPage predatingPage, IWizardPage followingPage) {
initialize();
- if(this.templatePages == null
- || this.predatingPage != predatingPage
+ if(this.templatePages == null
+ || this.predatingPage != predatingPage
|| this.followingPage != followingPage){
this.predatingPage = predatingPage;
this.followingPage = followingPage;
@@ -238,12 +240,12 @@ public class MBSWizardHandler extends CWizardHandler {
followingPage.setPreviousPage(predatingPage);
}
}
-
+
if(templatePages.length != 0)
return templatePages[0];
return followingPage;
}
-
+
private boolean canFinish(IWizardPage predatingPage, IWizardPage followingPage){
getNextPage(predatingPage, followingPage);
for(int i = 0; i < templatePages.length; i++){
@@ -252,50 +254,50 @@ public class MBSWizardHandler extends CWizardHandler {
}
return true;
}
-
+
/**
- * Filters toolchains
- *
+ * Filters toolchains
+ *
* @return - set of compatible toolchain's IDs
*/
protected Set<String> tc_filter() {
Set<String> full = tcs.keySet();
- if (entryDescriptor == null)
+ if (entryDescriptor == null)
return full;
Set<String> out = new LinkedHashSet<String>(full.size());
for (String s : full)
- if (isToolChainAcceptable(s))
+ if (isToolChainAcceptable(s))
out.add(s);
return out;
}
/**
* Checks whether given toolchain can be displayed
- *
+ *
* @param tcId - toolchain _NAME_ to check
* @return - true if toolchain can be displayed
*/
public boolean isToolChainAcceptable(String tcId) {
- if (template == null || template.getTemplateInfo() == null)
+ if (template == null || template.getTemplateInfo() == null)
return true;
-
+
String[] toolChainIds = template.getTemplateInfo().getToolChainIds();
- if (toolChainIds == null || toolChainIds.length == 0)
+ if (toolChainIds == null || toolChainIds.length == 0)
return true;
-
+
Object ob = tcs.get(tcId);
if (ob == null)
return true; // sic ! This can occur with Other Toolchain only
if (!(ob instanceof IToolChain))
return false;
-
+
String id1 = ((IToolChain)ob).getId();
IToolChain sup = ((IToolChain)ob).getSuperClass();
String id2 = sup == null ? null : sup.getId();
-
+
for (String id : toolChainIds) {
if ((id != null && id.equals(id1)) ||
- (id != null && id.equals(id2)))
+ (id != null && id.equals(id2)))
return true;
}
return false;
@@ -305,20 +307,20 @@ public class MBSWizardHandler extends CWizardHandler {
return tc_filter().size();
}
}
-
+
public MBSWizardHandler(IProjectType _pt, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, _pt.getName());
+ super(p, Messages.CWizardHandler_0, _pt.getName());
pt = _pt;
setWizard(w);
}
public MBSWizardHandler(String name, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, name);
+ super(p, Messages.CWizardHandler_0, name);
setWizard(w);
}
public MBSWizardHandler(IBuildPropertyValue val, Composite p, IWizard w) {
- super(p, Messages.CWizardHandler_0, val.getName());
+ super(p, Messages.CWizardHandler_0, val.getName());
propertyId = val.getId();
setWizard(w);
}
@@ -330,16 +332,16 @@ public class MBSWizardHandler extends CWizardHandler {
startingPage = w.getStartingPage();
}
}
-
+
protected IWizardPage getStartingPage(){
return startingPage;
}
-
+
public Map<String, String> getMainPageData() {
WizardNewProjectCreationPage page = (WizardNewProjectCreationPage)getStartingPage();
Map<String, String> data = new HashMap<String, String>();
String projName = page.getProjectName();
- projName = projName != null ? projName.trim() : EMPTY_STR;
+ projName = projName != null ? projName.trim() : EMPTY_STR;
data.put("projectName", projName); //$NON-NLS-1$
data.put("baseName", getBaseName(projName)); //$NON-NLS-1$
data.put("baseNameUpper", getBaseName(projName).toUpperCase() ); //$NON-NLS-1$
@@ -350,7 +352,7 @@ public class MBSWizardHandler extends CWizardHandler {
data.put("location", location); //getProjectLocation().toPortableString()); //$NON-NLS-1$
return data;
}
-
+
private String getBaseName(String name) {
String baseName = name;
int dot = baseName.lastIndexOf('.');
@@ -363,11 +365,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
return baseName;
}
-
+
@Override
public void handleSelection() {
List<String> preferred = CDTPrefUtil.getPreferredTCs();
-
+
if (table == null) {
table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
table.getAccessible().addAccessibleListener(
@@ -400,7 +402,7 @@ public class MBSWizardHandler extends CWizardHandler {
counter++;
}
if (counter > 0) table.select(position);
- }
+ }
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -421,11 +423,11 @@ public class MBSWizardHandler extends CWizardHandler {
if (listener != null)
listener.toolChainListChanged(table.getSelectionCount());
}
-
+
private void loadCustomPages() {
- if (! (getWizard() instanceof ICDTCommonProjectWizard))
- return; // not probable
-
+ if (! (getWizard() instanceof ICDTCommonProjectWizard))
+ return; // not probable
+
ICDTCommonProjectWizard wz = (ICDTCommonProjectWizard)getWizard();
MBSCustomPageManager.init();
MBSCustomPageManager.addStockPage(getStartingPage(), CDTMainWizardPage.PAGE_ID);
@@ -438,9 +440,9 @@ public class MBSWizardHandler extends CWizardHandler {
customPages = MBSCustomPageManager.getCustomPages();
- if (customPages == null)
+ if (customPages == null)
customPages = new IWizardPage[0];
-
+
for (IWizardPage customPage : customPages)
customPage.setWizard(wz);
setCustomPagesFilter(wz);
@@ -463,13 +465,13 @@ public class MBSWizardHandler extends CWizardHandler {
boolean ptIsNull = (getProjectType() == null);
if (!ptIsNull)
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
getProjectType().getId()
- );
+ );
IToolChain[] tcs = getSelectedToolChains();
- ArrayList<IToolChain> x = new ArrayList<IToolChain>();
+ ArrayList<IToolChain> x = new ArrayList<IToolChain>();
TreeSet<String> y = new TreeSet<String>();
if (tcs!=null) {
int n = tcs.length;
@@ -477,7 +479,7 @@ public class MBSWizardHandler extends CWizardHandler {
if (tcs[i] == null) // --- NO TOOLCHAIN ---
continue; // has no custom pages.
x.add(tcs[i]);
-
+
IConfiguration cfg = tcs[i].getParent();
if (cfg == null)
continue;
@@ -487,24 +489,24 @@ public class MBSWizardHandler extends CWizardHandler {
}
}
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.TOOLCHAIN,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.TOOLCHAIN,
x);
-
+
if (ptIsNull) {
if (y.size() > 0)
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
y);
else
MBSCustomPageManager.addPageProperty(
- MBSCustomPageManager.PAGE_ID,
- MBSCustomPageManager.PROJECT_TYPE,
+ MBSCustomPageManager.PAGE_ID,
+ MBSCustomPageManager.PROJECT_TYPE,
null);
}
}
-
+
@Override
public void handleUnSelection() {
if (table != null) {
@@ -517,16 +519,16 @@ public class MBSWizardHandler extends CWizardHandler {
if (tc.isAbstract() || tc.isSystemObject()) return;
IConfiguration[] cfgs = null;
// New style managed project type. Configurations are referenced via propertyId.
- if (propertyId != null) {
+ if (propertyId != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, ARTIFACT, propertyId);
- // Old style managewd project type. Configs are obtained via projectType
+ // Old style managewd project type. Configs are obtained via projectType
} else if (pt != null) {
cfgs = ManagedBuildManager.getExtensionConfigurations(tc, pt);
- }
+ }
if (cfgs == null || cfgs.length == 0) return;
full_tcs.put(tc.getUniqueRealName(), tc);
}
-
+
@Override
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
@@ -544,20 +546,20 @@ public class MBSWizardHandler extends CWizardHandler {
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
setProjectDescription(proj, true, true, monitor);
}
-
+
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
monitor.worked(10);
cfgs = getCfgItems(false);
- if (cfgs == null || cfgs.length == 0)
+ if (cfgs == null || cfgs.length == 0)
cfgs = CDTConfigWizardPage.getDefaultCfgs(this);
-
+
if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) {
- throw new CoreException(new Status(IStatus.ERROR,
+ throw new CoreException(new Status(IStatus.ERROR,
ManagedBuilderUIPlugin.getUniqueIdentifier(),
- Messages.CWizardHandler_6));
+ Messages.CWizardHandler_6));
}
Configuration cf = (Configuration)cfgs[0].getConfiguration();
ManagedProject mProj = new ManagedProject(project, cf.getProjectType());
@@ -565,12 +567,12 @@ public class MBSWizardHandler extends CWizardHandler {
monitor.worked(10);
cfgs = CfgHolder.unique(cfgs);
cfgs = CfgHolder.reorder(cfgs);
-
+
ICConfigurationDescription cfgDebug = null;
ICConfigurationDescription cfgFirst = null;
-
+
int work = 50/cfgs.length;
-
+
for (CfgHolder cfg : cfgs) {
cf = (Configuration)cfg.getConfiguration();
String id = ManagedBuildManager.calculateChildId(cf.getId(), null);
@@ -582,32 +584,36 @@ public class MBSWizardHandler extends CWizardHandler {
IBuilder bld = config.getEditableBuilder();
if (bld != null) { bld.setManagedBuildOn(true); }
-
+
config.setName(cfg.getName());
config.setArtifactName(mProj.getDefaultArtifactName());
-
+
IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY);
if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId()))
cfgDebug = cfgDes;
- if (cfgFirst == null) // select at least first configuration
- cfgFirst = cfgDes;
+ if (cfgFirst == null) // select at least first configuration
+ cfgFirst = cfgDes;
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
+
monitor.worked(work);
}
mngr.setProjectDescription(project, des);
}
-
+
+
@Override
protected void doTemplatesPostProcess(IProject prj) {
if(entryInfo == null)
return;
-
+
Template template = entryInfo.getInitializedTemplate(getStartingPage(), getConfigPage(), getMainPageData());
if(template == null)
return;
List<IConfiguration> configs = new ArrayList<IConfiguration>();
for (CfgHolder cfg : cfgs) {
- configs.add((IConfiguration)cfg.getConfiguration());
+ configs.add(cfg.getConfiguration());
}
template.getTemplateInfo().setConfigurations(configs);
@@ -616,19 +622,19 @@ public class MBSWizardHandler extends CWizardHandler {
TemplateEngineUIUtil.showError(statuses[0].getMessage(), statuses[0].getException());
}
}
-
+
protected CDTConfigWizardPage getConfigPage() {
if (fConfigPage == null) {
fConfigPage = new CDTConfigWizardPage(this);
}
return fConfigPage;
}
-
+
@Override
public IWizardPage getSpecificPage() {
return entryInfo.getNextPage(getStartingPage(), getConfigPage());
}
-
+
/**
* Mark preferred toolchains with specific images
*/
@@ -647,11 +653,11 @@ public class MBSWizardHandler extends CWizardHandler {
}
}
}
-
+
public List<String> getPreferredTCNames() {
return preferredTCs;
}
-
+
@Override
public String getHeader() { return head; }
public boolean isDummy() { return false; }
@@ -659,11 +665,11 @@ public class MBSWizardHandler extends CWizardHandler {
public boolean supportsPreferred() { return true; }
@Override
- public boolean isChanged() {
+ public boolean isChanged() {
if (savedToolChains == null)
return true;
IToolChain[] tcs = getSelectedToolChains();
- if (savedToolChains.length != tcs.length)
+ if (savedToolChains.length != tcs.length)
return true;
for (IToolChain savedToolChain : savedToolChains) {
boolean found = false;
@@ -678,12 +684,12 @@ public class MBSWizardHandler extends CWizardHandler {
}
return false;
}
-
+
@Override
public void saveState() {
savedToolChains = getSelectedToolChains();
}
-
+
// Methods specific for MBSWizardHandler
public IToolChain[] getSelectedToolChains() {
@@ -699,7 +705,7 @@ public class MBSWizardHandler extends CWizardHandler {
public int getToolChainsCount() {
if (entryInfo == null)
return full_tcs.size();
- else
+ else
return entryInfo.tc_filter().size();
}
public String getPropertyId() {
@@ -716,13 +722,13 @@ public class MBSWizardHandler extends CWizardHandler {
return fConfigPage.getCfgItems(defaults);
}
@Override
- public String getErrorMessage() {
+ public String getErrorMessage() {
TableItem[] tis = table.getSelection();
if (tis == null || tis.length == 0)
- return Messages.MBSWizardHandler_0;
+ return Messages.MBSWizardHandler_0;
return null;
}
-
+
@Override
protected void doCustom(IProject newProject) {
IRunnableWithProgress[] operations = MBSCustomPageManager.getOperations();
@@ -736,7 +742,7 @@ public class MBSWizardHandler extends CWizardHandler {
ManagedBuilderUIPlugin.log(e);
}
}
-
+
@Override
public void postProcess(IProject newProject, boolean created) {
deleteExtraConfigs(newProject);
@@ -747,17 +753,17 @@ public class MBSWizardHandler extends CWizardHandler {
doCustom(newProject);
}
}
-
+
/**
- * Deletes configurations
- *
+ * Deletes configurations
+ *
* @param newProject - affected project
*/
private void deleteExtraConfigs(IProject newProject) {
- if (isChanged()) return; // no need to delete
+ if (isChanged()) return; // no need to delete
if (listener != null && listener.isCurrent()) return; // nothing to delete
if (fConfigPage == null || !fConfigPage.pagesLoaded) return;
-
+
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(newProject, true);
if (prjd == null) return;
ICConfigurationDescription[] all = prjd.getConfigurations();
@@ -781,19 +787,19 @@ public class MBSWizardHandler extends CWizardHandler {
CoreModel.getDefault().setProjectDescription(newProject, prjd);
} catch (CoreException e) {}
}
-
+
@Override
- public boolean isApplicable(EntryDescriptor data) {
+ public boolean isApplicable(EntryDescriptor data) {
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
return info.isValid() && (info.getToolChainsCount() > 0);
}
-
+
@Override
public void initialize(EntryDescriptor data) throws CoreException {
EntryInfo info = new EntryInfo(data, full_tcs, wizard);
if(!info.isValid())
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderUIPlugin.getUniqueIdentifier(), "inappropriate descriptor")); //$NON-NLS-1$
-
+
entryInfo = info;
}
@@ -819,20 +825,19 @@ public class MBSWizardHandler extends CWizardHandler {
public boolean canFinish() {
if(entryInfo == null)
return false;
-
+
if (!getConfigPage().isCustomPageComplete())
return false;
-
+
if(!entryInfo.canFinish(startingPage, getConfigPage()))
return false;
-
+
if (customPages != null)
for (int i=0; i<customPages.length; i++)
if (!customPages[i].isPageComplete())
return false;
-
+
return super.canFinish();
}
-
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
index 706f0c6373..ab46facdf0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewMakeProjFromExisting.java
@@ -15,6 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@@ -25,6 +26,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
import org.eclipse.core.resources.IProject;
@@ -110,7 +112,10 @@ public class NewMakeProjFromExisting extends Wizard implements IImportWizard, IN
IBuilder builder = config.getEditableBuilder();
builder.setManagedBuildOn(false);
CConfigurationData data = config.getConfigurationData();
- projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+ ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, config, cfgDes);
+
monitor.worked(1);
pdMgr.setProjectDescription(project, projDesc);
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
index b5128f0ef2..231c82953b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java
@@ -12,6 +12,7 @@
package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@@ -23,6 +24,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -37,16 +39,16 @@ import org.eclipse.swt.widgets.Composite;
public class STDWizardHandler extends MBSWizardHandler {
public STDWizardHandler(Composite p, IWizard w) {
- super(Messages.StdBuildWizard_0, p, w);
+ super(Messages.StdBuildWizard_0, p, w);
}
@Override
public void addTc(IToolChain tc) {
if (tc == null) {
- full_tcs.put(Messages.StdProjectTypeHandler_0, null);
+ full_tcs.put(Messages.StdProjectTypeHandler_0, null);
} else {
if (tc.isAbstract() || tc.isSystemObject()) return;
- // unlike CWizardHandler, we don't check for configs
+ // unlike CWizardHandler, we don't check for configs
full_tcs.put(tc.getUniqueRealName(), tc);
}
}
@@ -58,9 +60,9 @@ public class STDWizardHandler extends MBSWizardHandler {
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask("", 100);//$NON-NLS-1$
-
+
setProjectDescription(project, defaults, onFinish, monitor);
-
+
doTemplatesPostProcess(project);
doCustom(project);
monitor.worked(30);
@@ -70,53 +72,60 @@ public class STDWizardHandler extends MBSWizardHandler {
}
private void setProjectDescription(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor)
- throws CoreException {
- ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
- ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
- ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
- ManagedProject mProj = new ManagedProject(des);
- info.setManagedProject(mProj);
- monitor.worked(20);
- cfgs = CfgHolder.unique(getCfgItems(false));
- cfgs = CfgHolder.reorder(cfgs);
- int work = 50/cfgs.length;
- for (int i=0; i<cfgs.length; i++) {
- String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
- Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
- cfgs[i].setConfiguration(cfg);
- IBuilder bld = cfg.getEditableBuilder();
- if (bld != null) {
- if(bld.isInternalBuilder()){
- IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
- IBuilder prefBuilder = prefCfg.getBuilder();
- cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
- bld = cfg.getEditableBuilder();
- bld.setBuildPath(null);
- }
- bld.setManagedBuildOn(false);
- } else {
- System.out.println(Messages.StdProjectTypeHandler_3);
- }
- cfg.setArtifactName(mProj.getDefaultArtifactName());
- CConfigurationData data = cfg.getConfigurationData();
- des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
- monitor.worked(work);
- }
- mngr.setProjectDescription(project, des);
- }
- public boolean canCreateWithoutToolchain() { return true; }
-
+ throws CoreException {
+
+ ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
+ ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish);
+ ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
+ ManagedProject mProj = new ManagedProject(des);
+ info.setManagedProject(mProj);
+ monitor.worked(20);
+ cfgs = CfgHolder.unique(getCfgItems(false));
+ cfgs = CfgHolder.reorder(cfgs);
+ int work = 50/cfgs.length;
+ for (int i=0; i<cfgs.length; i++) {
+ String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
+ Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName());
+ cfgs[i].setConfiguration(cfg);
+ IBuilder bld = cfg.getEditableBuilder();
+ if (bld != null) {
+ if(bld.isInternalBuilder()){
+ IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
+ IBuilder prefBuilder = prefCfg.getBuilder();
+ cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName());
+ bld = cfg.getEditableBuilder();
+ bld.setBuildPath(null);
+ }
+ bld.setManagedBuildOn(false);
+ } else {
+ System.out.println(Messages.StdProjectTypeHandler_3);
+ }
+ cfg.setArtifactName(mProj.getDefaultArtifactName());
+ CConfigurationData data = cfg.getConfigurationData();
+ ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+
+ ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
+
+ monitor.worked(work);
+ }
+ mngr.setProjectDescription(project, des);
+ }
+
+ public boolean canCreateWithoutToolchain() {
+ return true;
+ }
+
@Override
public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
- setProjectDescription(proj, true, true, monitor);
+ setProjectDescription(proj, true, true, monitor);
}
-
+
/**
* If no toolchains selected by user, use default toolchain
*/
@Override
public IToolChain[] getSelectedToolChains() {
- if (full_tcs.size() == 0 || table.getSelection().length == 0)
+ if (full_tcs.size() == 0 || table.getSelection().length == 0)
return new IToolChain[] { null };
else
return super.getSelectedToolChains();

Back to the top