Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDavid Inglis2004-03-25 14:53:34 -0500
committerDavid Inglis2004-03-25 14:53:34 -0500
commitca24825bd88d97a01304ad7a1d1aa2c8fb918cb2 (patch)
tree4404c8806b77c73e51ca607d3e35ad5b66d5fa5e /core
parent7f918c42c3d51df8ec3f52651b2b7c34a8a8575c (diff)
downloadorg.eclipse.cdt-ca24825bd88d97a01304ad7a1d1aa2c8fb918cb2.tar.gz
org.eclipse.cdt-ca24825bd88d97a01304ad7a1d1aa2c8fb918cb2.tar.xz
org.eclipse.cdt-ca24825bd88d97a01304ad7a1d1aa2c8fb918cb2.zip
clean up getProcessList and schemas for CProject & CBuildConsole
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog11
-rw-r--r--core/org.eclipse.cdt.core/plugin.xml4
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java42
3 files changed, 39 insertions, 18 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index e720ba5ba6..b2d421ea8f 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 5e9d9d1c8c..cb41df5a02 100644
--- a/core/org.eclipse.cdt.core/plugin.xml
+++ b/core/org.eclipse.cdt.core/plugin.xml
@@ -22,11 +22,11 @@
</requires>
- <extension-point id="CProject" name="%CProject.name"/>
+ <extension-point id="CProject" name="%CProject.name" schema="schema/CProject.exsd"/>
<!-- =================================================================================== -->
<!-- Extension Point:(work in progress) IConsole, customize a C Build console output -->
<!-- =================================================================================== -->
- <extension-point id="CBuildConsole" name="%CBuildConsole.name"/>
+ <extension-point id="CBuildConsole" name="%CBuildConsole.name" schema="schema/CBuildConsole.exsd"/>
<!-- =================================================================================== -->
<!-- Extension Point: IProcessList, returns a list of running processes -->
<!-- =================================================================================== -->
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 e363ab071d..9b866369f5 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;
+
}
/**

Back to the top