mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
bug 445718: CDT Wizard Page started crashing with NPE when custom wizard
is defined
This commit is contained in:
parent
0a3f35c3ed
commit
044853140e
1 changed files with 34 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2009 Intel Corporation and others.
|
* Copyright (c) 2007, 2014 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -304,9 +304,37 @@ public class CDTMainWizardPage extends WizardNewProjectCreationPage implements I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// bug # 211935 : allow items filtering.
|
// items filtering
|
||||||
if (ls != null) // NULL means call from prefs
|
if (ls != null) { // NULL means call from prefs
|
||||||
items = ls.filterItems(items);
|
List<EntryDescriptor> filteredItems = ls.filterItems(items);
|
||||||
|
List<EntryDescriptor> newItems = new ArrayList<EntryDescriptor>(filteredItems);
|
||||||
|
|
||||||
|
// Add parent folders
|
||||||
|
for (EntryDescriptor ed : filteredItems) {
|
||||||
|
if (!ed.isCategory()) {
|
||||||
|
String parentId = ed.getParentId();
|
||||||
|
if (parentId != null) {
|
||||||
|
boolean found = false;
|
||||||
|
for (EntryDescriptor item : newItems) {
|
||||||
|
if (item.isCategory() && parentId.equals(item.getId())) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
for (EntryDescriptor item : items) {
|
||||||
|
if (item.isCategory() && parentId.equals(item.getId())) {
|
||||||
|
newItems.add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
items = newItems;
|
||||||
|
}
|
||||||
|
|
||||||
addItemsToTree(tree, items);
|
addItemsToTree(tree, items);
|
||||||
|
|
||||||
if (tree.getItemCount() > 0) {
|
if (tree.getItemCount() > 0) {
|
||||||
|
@ -428,6 +456,8 @@ public class CDTMainWizardPage extends WizardNewProjectCreationPage implements I
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchTo(CWizardHandler h, EntryDescriptor ed) {
|
private void switchTo(CWizardHandler h, EntryDescriptor ed) {
|
||||||
|
if (ed == null)
|
||||||
|
return;
|
||||||
if (h == null)
|
if (h == null)
|
||||||
h = ed.getHandler();
|
h = ed.getHandler();
|
||||||
if (ed.isCategory())
|
if (ed.isCategory())
|
||||||
|
|
Loading…
Add table
Reference in a new issue