diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index 26e82451ba2..4095d9efe2d 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,3 +1,8 @@ +2004-04-22 Sean Evoy + 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. + 2004-04-22 Hoda Amer Backing out previous changes regarding new JFace interfaces. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties index de07d5f1028..2e501e017e6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties @@ -38,7 +38,7 @@ OpenClassWizardAction.title=New Class # ------- 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 diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java index 257c5466003..c47e783b305 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java @@ -73,6 +73,11 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { return null; } + public void updateValues() { + fErrorParserList.removeAllElements(); + setValues(); + } + /** * Returns a label provider for the error parsers * @@ -111,10 +116,19 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { /** * 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 @@ -143,12 +157,19 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { 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 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { String[] parserIDs = (String[])list.toArray(EMPTY); if (project == null) { + // Save to preferences saveErrorParsers(fPrefs, parserIDs); } else { saveErrorParsers(project, parserIDs);