diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java index b1761380717..48266df6fe9 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. + * Copyright (c) 2003, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -193,7 +193,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI private static boolean projectTypesLoaded = false; private static boolean projectTypesLoading = false; // Project types defined in the manifest files - public static SortedMap projectTypeMap; + public static SortedMap projectTypeMap; private static List projectTypes; // Early configuration initialization extension elements private static List startUpConfigElements; @@ -371,13 +371,13 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI * * @return Map */ - public static SortedMap getExtensionProjectTypeMap() { + public static SortedMap getExtensionProjectTypeMap() { try { loadExtensions(); } catch (BuildException e) { } if (projectTypeMap == null) { - projectTypeMap = new TreeMap(); + projectTypeMap = new TreeMap(); } return projectTypeMap; } 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 45248cff3d4..937052c2849 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,7 +14,6 @@ package org.eclipse.cdt.managedbuilder.ui.wizards; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -91,7 +90,7 @@ public class MBSWizardHandler extends CWizardHandler { Messages.getString("CWizardHandler.4") + //$NON-NLS-1$ Messages.getString("CWizardHandler.5"); //$NON-NLS-1$ - protected SortedMap full_tcs = new TreeMap(); + protected SortedMap full_tcs = new TreeMap(); private String propertyId = null; private IProjectType pt = null; protected IWizardItemsListListener listener; @@ -105,7 +104,7 @@ public class MBSWizardHandler extends CWizardHandler { protected IWizardPage[] customPages; protected static final class EntryInfo { - private SortedMap tcs; + private SortedMap tcs; private EntryDescriptor entryDescriptor; private Template template; private boolean initialized; @@ -116,7 +115,7 @@ public class MBSWizardHandler extends CWizardHandler { private IWizardPage predatingPage; private IWizardPage followingPage; - public EntryInfo(EntryDescriptor dr, SortedMap _tcs){ + public EntryInfo(EntryDescriptor dr, SortedMap _tcs){ entryDescriptor = dr; tcs = _tcs; } @@ -170,13 +169,13 @@ public class MBSWizardHandler extends CWizardHandler { initialized = true; } - public Template getInitializedTemplate(IWizardPage predatingPage, IWizardPage followingPage, Map map){ + public Template getInitializedTemplate(IWizardPage predatingPage, IWizardPage followingPage, Map map){ getNextPage(predatingPage, followingPage); Template template = getTemplate(); if(template != null){ - Map/**/ valueStore = template.getValueStore(); + Map valueStore = template.getValueStore(); // valueStore.clear(); for(int i=0; i < templatePages.length; i++) { IWizardPage page = templatePages[i]; @@ -226,17 +225,14 @@ public class MBSWizardHandler extends CWizardHandler { * * @return - set of compatible toolchain's IDs */ - protected Set tc_filter() { - Set full = tcs.keySet(); + protected Set tc_filter() { + Set full = tcs.keySet(); if (entryDescriptor == null) return full; - Set out = new LinkedHashSet(full.size()); - Iterator it = full.iterator(); - while (it.hasNext()) { - String s = (String)it.next(); + Set out = new LinkedHashSet(full.size()); + for (String s : full) if (isToolChainAcceptable(s)) out.add(s); - } return out; } @@ -306,9 +302,9 @@ public class MBSWizardHandler extends CWizardHandler { return startingPage; } - public Map getMainPageData() { + public Map getMainPageData() { WizardNewProjectCreationPage page = (WizardNewProjectCreationPage)getStartingPage(); - Map data = new HashMap(); + Map data = new HashMap(); String projName = page.getProjectName(); projName = projName != null ? projName.trim() : EMPTY_STR; data.put("projectName", projName); //$NON-NLS-1$ @@ -336,7 +332,7 @@ public class MBSWizardHandler extends CWizardHandler { } public void handleSelection() { - List preferred = CDTPrefUtil.getPreferredTCs(); + List preferred = CDTPrefUtil.getPreferredTCs(); if (table == null) { table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); @@ -349,12 +345,10 @@ public class MBSWizardHandler extends CWizardHandler { ); table.setToolTipText(tooltip); if (entryInfo != null) { - Iterator it = entryInfo.tc_filter().iterator(); int counter = 0; int position = 0; - while (it.hasNext()) { + for (String s : entryInfo.tc_filter()) { TableItem ti = new TableItem(table, SWT.NONE); - String s = (String)it.next(); Object obj = full_tcs.get(s); String id = CDTPrefUtil.NULL; if (obj instanceof IToolChain) { @@ -425,7 +419,7 @@ public class MBSWizardHandler extends CWizardHandler { else if (natures.length == 1) MBSCustomPageManager.addPageProperty(MBSCustomPageManager.PAGE_ID, MBSCustomPageManager.NATURE, natures[0]); else { - Set x = new TreeSet(); + TreeSet x = new TreeSet(); for (int i=0; i x = new ArrayList(); + TreeSet y = new TreeSet(); for (int i=0; i configs = new ArrayList(); for(int i = 0; i < cfgs.length; i++){ - configs.add(cfgs[i].getConfiguration()); + configs.add((IConfiguration)cfgs[i].getConfiguration()); } template.getTemplateInfo().setConfigurations(configs); @@ -585,7 +579,9 @@ public class MBSWizardHandler extends CWizardHandler { /** * Mark preferred toolchains with specific images + * @ */ + public void updatePreferred(List prefs) { int x = table.getItemCount(); for (int i=0; i items = new ArrayList(); // new style project types for (int i=0; i sm = ManagedBuildManager.getExtensionProjectTypeMap(); + for (String s : sm.keySet()) { IProjectType pt = (IProjectType)sm.get(s); if (pt.isAbstract() || pt.isSystemObject()) continue; if (supportedOnly && !pt.isSupported()) continue; // not supported 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 c9c5e0a7747..fad96e83347 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -81,6 +81,8 @@ public class STDWizardHandler extends MBSWizardHandler { mngr.setProjectDescription(project, des); doPostProcess(project); + // process custom pages + doCustom(); } public boolean canCreateWithoutToolchain() { return true; }