From 573dd7fd5b57fbb9dcf7ed06cdc42a4fb3f6f279 Mon Sep 17 00:00:00 2001 From: John Eblen Date: Mon, 7 May 2012 17:04:37 -0400 Subject: [PATCH] Bug 363612 - [API] Add toolchain accessor functions to MBSWizardHandler Change-Id: I9bfd3f9aa2b6007172466be212f5f45b668c231f Reviewed-on: https://git.eclipse.org/r/5870 Reviewed-by: Chris Recoskie Tested-by: Chris Recoskie IP-Clean: Chris Recoskie --- .../ui/wizards/MBSWizardHandler.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) 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 8d204ec1f7f..34a8ce00fdd 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 @@ -271,6 +271,29 @@ public class MBSWizardHandler extends CWizardHandler { return out; } + /** + * Get a map from toolchain names to actual toolchains. + * This list should mirror the list displayed in the wizard. + * Bug #363612 + * + * @since 8.1 + * @return the map + */ + public SortedMap getToolChains() { + Set toolChainNames = this.tc_filter(); + SortedMap toolChainMap = new TreeMap(); + + for (String toolChainName : toolChainNames) { + IToolChain tc = tcs.get(toolChainName); + if (tc == null) { + toolChainMap.put(toolChainName, null); + } else { + toolChainMap.put(tc.getUniqueRealName(), tc); + } + } + return toolChainMap; + } + /** * Checks whether given toolchain can be displayed * @@ -708,6 +731,30 @@ public class MBSWizardHandler extends CWizardHandler { else return entryInfo.tc_filter().size(); } + /** + * Get a map from toolchain names to actual toolchains. + * Bug #363612 + * + * @since 8.1 + * @return the map + */ + public SortedMap getToolChains() { + if (entryInfo == null) + return full_tcs; + else + return entryInfo.getToolChains(); + } + /** + * Get the table that is displayed in the left pane. + * This allow for changes after handler creation. + * Bug #363612 + * + * @since 8.1 + * @return the table + */ + public Table getToolChainsTable() { + return table; + } public String getPropertyId() { return propertyId; }