diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index e720ba5ba68..b2d421ea8f9 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,14 @@ +2004-03-25 David Inglis + + Fixed up getProcessList to filter on platform. + + * src/org/eclipse/cdt/core/CCorePlugin.java + + Added schemas for CProject & CBuildConsole + + * plugin.xml + + 2004-03-25 Hoda Amer Joined effort with Bogdan: Added a TimeOut class to core.utils that implements a thread to control parser timeout. diff --git a/core/org.eclipse.cdt.core/plugin.xml b/core/org.eclipse.cdt.core/plugin.xml index 5e9d9d1c8c1..cb41df5a023 100644 --- a/core/org.eclipse.cdt.core/plugin.xml +++ b/core/org.eclipse.cdt.core/plugin.xml @@ -22,11 +22,11 @@ - + - + diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java index e363ab071d4..9b866369f51 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java @@ -33,6 +33,7 @@ import org.eclipse.cdt.internal.core.search.indexing.IndexManager; import org.eclipse.cdt.internal.core.search.indexing.SourceIndexer; import org.eclipse.cdt.internal.core.search.matching.MatchLocator; import org.eclipse.cdt.internal.core.search.processing.JobManager; +import org.eclipse.core.boot.BootLoader; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IWorkspace; @@ -449,7 +450,7 @@ public class CCorePlugin extends Plugin { for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] configElements = extensions[i].getConfigurationElements(); for (int j = 0; j < configElements.length; j++) { - String builderID = configElements[j].getAttribute("builderID"); //$NON-NLS-1$ + String builderID = configElements[j].getAttribute("id"); //$NON-NLS-1$ if ((id == null && builderID == null) || (id != null && id.equals(builderID))) { return (IConsole) configElements[j].createExecutableExtension("class"); //$NON-NLS-1$ } @@ -739,28 +740,37 @@ public class CCorePlugin extends Plugin { convertProjectFromCtoCC(projectHandle, monitor); } - // Extract the builder from the .cdtproject. - // public ICBuilder[] getBuilders(IProject project) throws CoreException { - // ICExtension extensions[] = fDescriptorManager.createExtensions(BUILDER_MODEL_ID, project); - // ICBuilder builders[] = new ICBuilder[extensions.length]; - // System.arraycopy(extensions, 0, builders, 0, extensions.length); - // return builders; - // } - - public IProcessList getProcessList() { + /** + * Get the IProcessList contributed interface for the platform. + * @return IProcessList + */ + public IProcessList getProcessList() throws CoreException { IExtensionPoint extension = getDescriptor().getExtensionPoint("ProcessList"); //$NON-NLS-1$ if (extension != null) { IExtension[] extensions = extension.getExtensions(); - IConfigurationElement[] configElements = extensions[0].getConfigurationElements(); - if (configElements.length != 0) { - try { - return (IProcessList) configElements[0].createExecutableExtension("class"); //$NON-NLS-1$ - } catch (CoreException e) { - log(e); + IConfigurationElement defaultContributor = null; + for (int i = 0; i < extensions.length; i++) { + IConfigurationElement[] configElements = extensions[i].getConfigurationElements(); + for (int j = 0; j < configElements.length; j++) { + if (configElements[j].getName().equals("processList")) { //$NON-NLS-1$ + String platform = configElements[j].getAttribute("platform"); //$NON-NLS-1$ + if (platform == null ) { // first contrbutor found with not platform will be default. + if (defaultContributor == null) { + defaultContributor = configElements[j]; + } + } else if (platform.equals(BootLoader.getOS())) { + // found explicit contributor for this platform. + return (IProcessList) configElements[0].createExecutableExtension("class"); //$NON-NLS-1$ + } + } } } + if ( defaultContributor != null) { + return (IProcessList) defaultContributor.createExecutableExtension("class"); //$NON-NLS-1$ + } } return null; + } /**