From 0c31d6a542ed86afc77ba75f391f9b7ae888f4a9 Mon Sep 17 00:00:00 2001 From: Oleg Krasilnikov Date: Mon, 2 Apr 2007 11:15:17 +0000 Subject: [PATCH] Bug #180286: discovery pages need exact correspondence to discovery profiles. --- .../ui/properties/DiscoveryTab.java | 33 ++++--------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java index 56b9b0d9c12..2ac7545da60 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java @@ -71,9 +71,6 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf private static final String SC_SELECTED_PROFILE_COMBO = PREFIX + ".scGroup.selectedProfile.combo"; //$NON-NLS-1$ private static final int DEFAULT_HEIGHT = 110; private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 }; - - private static final String PATTERN_PER_FILE = "PerFileProfile"; //$NON-NLS-1$ - private static final String PATTERN_PER_PROJ = "PerProjectProfile"; //$NON-NLS-1$ private Table resTable; private Button scEnabledButton; @@ -286,9 +283,9 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf buildInfo.setSelectedProfileId(profileId); // needs to create page for (Iterator it2 = pagesList.iterator(); it2.hasNext(); ) { DiscoveryProfilePageConfiguration p = (DiscoveryProfilePageConfiguration)it2.next(); - if (p != null) { + if (p != null && p.profId.equals(profileId)) { AbstractDiscoveryPage pg = p.getPage(); - if (pg != null && p.isProfileAccepted(profileId)) { + if (pg != null) { realPages[counter] = pg; pg.setContainer(wrapper); pg.createControl(profileComp); @@ -336,37 +333,20 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf */ protected static class DiscoveryProfilePageConfiguration { IConfigurationElement fElement; - private String pattern, name; + private String profId, name; protected DiscoveryProfilePageConfiguration(IConfigurationElement element) { fElement = element; - String s = fElement.getAttribute(PROFILE_ID); - // extracting pattern from Profile Id - // for compatibility with make.ui. - if (s != null && s.indexOf(PATTERN_PER_PROJ) >= 0) - pattern = PATTERN_PER_PROJ; - else - pattern = PATTERN_PER_FILE; -// pattern = fElement.getAttribute(PROFILE_PATTERN); + profId = fElement.getAttribute(PROFILE_ID); name = fElement.getAttribute(PROFILE_NAME); } - protected String getPattern() { return pattern; } protected String getName() { return name; } - - private boolean isProfileAccepted(String id) { - return (id.indexOf(getPattern()) > -1); - } private AbstractDiscoveryPage getPage() { - AbstractDiscoveryPage discoveryPage = null; try { - discoveryPage = (org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage) fElement.createExecutableExtension("class"); //$NON-NLS-1$ - } catch (CoreException e) {} - if (discoveryPage == null) { -// System.out.println(Messages.getString("DiscoveryTab.13") + fElement.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$ - } - return discoveryPage; + return (AbstractDiscoveryPage) fElement.createExecutableExtension("class"); //$NON-NLS-1$ + } catch (CoreException e) { return null; } } } @@ -494,7 +474,6 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf return true; } - public boolean canBeVisible() { if (page.isForProject() || page.isForPrefs()) return true; // Hide this page for folders and files