1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for PR 49595

The error parsers were not save in the correct order.
This commit is contained in:
Alain Magloire 2004-01-07 17:39:05 +00:00
parent 7a48cc3a16
commit 41a0020d24
2 changed files with 35 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2004-01-07 Alain Magloire
Fix for bug 49595
The error parser order were not save correctly.
* src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java
2003-12-31 Hoda Amer 2003-12-31 Hoda Amer
Displayed "No Completions Found" message in status bar Displayed "No Completions Found" message in status bar

View file

@ -142,16 +142,8 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
protected void initializeValues() { protected void initializeValues() {
initMapParsers(); initMapParsers();
List list = new ArrayList(mapParsers.size());
Iterator items = mapParsers.keySet().iterator();
while( items.hasNext()) {
list.add((String)items.next());
}
fErrorParserList.setElements(list);
list.clear();
String[] parserIDs = EMPTY;
String[] parserIDs;
IProject project = getContainer().getProject(); IProject project = getContainer().getProject();
if (project == null) { if (project == null) {
// From a Preference. // From a Preference.
@ -161,7 +153,24 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
parserIDs = getErrorParserIDs(project); parserIDs = getErrorParserIDs(project);
} }
fErrorParserList.setCheckedElements(Arrays.asList(parserIDs)); List checkedList = Arrays.asList(parserIDs);
fErrorParserList.setElements(checkedList);
fErrorParserList.setCheckedElements(checkedList);
Iterator items = mapParsers.keySet().iterator();
while( items.hasNext()) {
String item = (String)items.next();
boolean found = false;
for (int i = 0; i < parserIDs.length; i++) {
if (item.equals(parserIDs[i])) {
found = true;
break;
}
}
if (!found) {
fErrorParserList.addElement(item);
}
}
} }
public void createControl(Composite parent) { public void createControl(Composite parent) {
@ -204,7 +213,15 @@ public abstract class AbstractErrorParserBlock extends AbstractCOptionPage {
monitor = new NullProgressMonitor(); monitor = new NullProgressMonitor();
} }
monitor.beginTask("Setting Error Parsers...", 1); monitor.beginTask("Setting Error Parsers...", 1);
List list = fErrorParserList.getCheckedElements(); List elements = fErrorParserList.getElements();
int count = elements.size();
List list = new ArrayList(count);
for (int i = 0; i < count; i++) {
Object obj = elements.get(i);
if (fErrorParserList.isChecked(obj)) {
list.add(obj);
}
}
String[] parserIDs = (String[])list.toArray(EMPTY); String[] parserIDs = (String[])list.toArray(EMPTY);