Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Adding Error Parsers to Managed Build Projects (part un)


Hi All,
This is the first part of the patch supplied by Leo at Intel to add error parsers to a managed build project, and to manipulate the list of error parsers that apply to a project. There are two components of this patcht hat I do not have permission to commit.

The first contains a small change to the error parser dialog used in the new project wizard and property pages. The new behaviour is to continue to support getting and saving the error parser IDs from the preferences for a standard build project, but for managed projects, there is now a capacity to supply a method in an overridden implementation of the dialog that supplies an array of parser IDs or saves it as needed. It looks liek Leo also fixed a couple of old javadoc comments that were out of date. Now that's a thorough patch!

Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada

Index: src/org/eclipse/cdt/internal/ui/CPluginResources.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties,v
retrieving revision 1.29
diff -u -r1.29 CPluginResources.properties
--- src/org/eclipse/cdt/internal/ui/CPluginResources.properties	12 Mar 2004 16:07:50 -0000	1.29
+++ src/org/eclipse/cdt/internal/ui/CPluginResources.properties	22 Apr 2004 15:47:40 -0000
@@ -38,7 +38,7 @@
 # ------- Project/Prefernces/Wizards COnfiguration blocks -------
 
 ErrorParserBlock.label=Error Parsers
-ErrorParserBlock.desc=Set the error parser for this project
+ErrorParserBlock.desc=Set the error parsers for this project
 
 BinaryParserBlock.label=Binary Parser
 BinaryParserBlock.desc=Set required binary parser for this project
Index: src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java,v
retrieving revision 1.5
diff -u -r1.5 AbstractErrorParserBlock.java
--- src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java	26 Feb 2004 19:30:35 -0000	1.5
+++ src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java	22 Apr 2004 15:47:40 -0000
@@ -73,6 +73,11 @@
 		return null;
 	}
 
+	public void updateValues() {
+		fErrorParserList.removeAllElements();
+		setValues();	
+	}
+	
 	/**
 	 * Returns a label provider for the error parsers
 	 *
@@ -111,11 +116,20 @@
 	/**
 	 * To be implemented, abstract method.
 	 * @param project
-	 * @param list
+	 * @return String[]
 	 */
 	protected abstract String[] getErrorParserIDs(IProject project);
 
 	/**
+	 * To be overloaded by subclasses with another method of getting the error parsers.
+	 * For example, the managed builder new project wizard uses the selected Target.
+	 * @return String[]
+	 */
+	protected String[] getErrorParserIDs() {
+		return new String[0];
+	}
+
+	/**
 	 * To be implemented. abstract method.
 	 * @param project
 	 * @param parsers
@@ -143,12 +157,19 @@
 
 	protected void initializeValues() {
 		initMapParsers();
+		setValues();
+	}
 
+	protected void setValues() {
 		String[] parserIDs;
 		IProject project = getContainer().getProject();
 		if (project == null) {
-			// From a Preference.
-			parserIDs =getErrorParserIDs(fPrefs);
+			if (fPrefs != null) {
+				// From a Preference.
+				parserIDs = getErrorParserIDs(fPrefs);
+			} else {
+				parserIDs = getErrorParserIDs();
+			}
 		} else {
 			// From the Project.
 			parserIDs = getErrorParserIDs(project);
@@ -227,6 +248,7 @@
 			String[] parserIDs = (String[])list.toArray(EMPTY);
 
 			if (project == null) {
+				//  Save to preferences
 				saveErrorParsers(fPrefs, parserIDs);
 			} else {
 				saveErrorParsers(project, parserIDs);

Back to the top