Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java32
2 files changed, 31 insertions, 7 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index dd98aa0fe9a..6d34f1ceb17 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -3770,19 +3770,19 @@
<extension point="org.eclipse.cdt.core.templates">
<template
id="org.eclipse.cdt.build.core.templates.HelloWorldCCProject"
- filterPattern=".*"
+ filterPattern=".*g\+\+"
location="$nl$/templates/projecttemplates/HelloWorldCCProject/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
<template
id="org.eclipse.cdt.build.templates.HelloWorldCAnsiProject"
- filterPattern=".*"
+ filterPattern=".*gcc"
location="$nl$/templates/projecttemplates/HelloWorldCAnsiProject/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
<template
id="org.eclipse.cdt.build.core.templates.MakefileHelloWorldCCProject"
- filterPattern=".*"
+ filterPattern=".*g\+\+"
location="$nl$/templates/projecttemplates/MakefileHelloWorldCCProject/template.xml"
projectType="org.eclipse.cdt.build.makefile.projectType">
</template>
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 2641987acde..5753acf9bb2 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
@@ -13,6 +13,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -119,11 +120,17 @@ public class MBSWizardHandler extends CWizardHandler {
private IWizardPage[] templatePages;
private IWizardPage predatingPage;
private IWizardPage followingPage;
+ private IWizard wizard;
public EntryInfo(EntryDescriptor dr, SortedMap<String, IToolChain> _tcs){
entryDescriptor = dr;
tcs = _tcs;
}
+
+ public EntryInfo(EntryDescriptor dr, SortedMap<String, IToolChain> _tcs, IWizard w){
+ this(dr, _tcs);
+ wizard = w;
+ }
public boolean isValid(){
initialize();
@@ -154,8 +161,25 @@ public class MBSWizardHandler extends CWizardHandler {
if(!entryDescriptor.isDefaultForCategory() &&
path.length > 1 && (!path[0].equals(ManagedBuildWizard.OTHERS_LABEL))){
templateId = path[path.length - 1];
- Template templates[] = TemplateEngineUI.getDefault().getTemplates(projectTypeId);
- if(templates.length == 0)
+ Template templates[] = null;
+ if(wizard instanceof CDTCommonProjectWizard) {
+ CDTCommonProjectWizard wz = (CDTCommonProjectWizard)wizard;
+ String[] langIDs = wz.getLanguageIDs();
+ if(langIDs.length > 0) {
+ List<Template> lstTemplates = new ArrayList<Template>();
+ for(int i = 0; i < langIDs.length; ++i) {
+ lstTemplates.addAll(Arrays.asList(TemplateEngineUI.getDefault().
+ getTemplates(projectTypeId, null, langIDs[i])));
+ }
+ templates = lstTemplates.toArray(new Template[lstTemplates.size()]);
+ }
+ }
+ if(null == templates) {
+ templates =
+ TemplateEngineUI.getDefault().
+ getTemplates(projectTypeId);
+ }
+ if((null == templates) || (templates.length == 0))
break;
for(int i = 0; i < templates.length; i++){
@@ -723,12 +747,12 @@ public class MBSWizardHandler extends CWizardHandler {
}
public boolean isApplicable(EntryDescriptor data) {
- EntryInfo info = new EntryInfo(data, full_tcs);
+ EntryInfo info = new EntryInfo(data, full_tcs, wizard);
return info.isValid() && (info.getToolChainsCount() > 0);
}
public void initialize(EntryDescriptor data) throws CoreException {
- EntryInfo info = new EntryInfo(data, full_tcs);
+ 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$

Back to the top