1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

[186845] fix so that we don't assume a TreeItem when doing add()

This commit is contained in:
David McKnight 2007-05-14 19:58:19 +00:00
parent ddf02094dd
commit 332a08db68

View file

@ -5521,15 +5521,25 @@ public class SystemView extends SafeTreeViewer
{
for (int i = 0; i < matches.size(); i++) {
Widget match = (Widget) matches.get(i);
ISystemFilterReference ref = getContainingFilterReference((TreeItem)match);
ISystemFilterReference ref = null;
if (match instanceof TreeItem)
{
ref = getContainingFilterReference((TreeItem)match);
}
if (matches.size() > 1 && ref != null && ref != originalFilter)
{
// could have the same object under multiple filters
// need to apply filter
ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)((IAdaptable)parentElementOrTreePath).getAdapter(ISystemViewElementAdapter.class);
IContextObject contextObject = getContextObject((TreeItem)match);
Object[] newChildren = adapter.getChildren(contextObject, new NullProgressMonitor());
internalAdd(match, parentElementOrTreePath, newChildren);
Object[] newChildren = null;
if (match instanceof TreeItem)
{
IContextObject contextObject = getContextObject((TreeItem)match);
newChildren = adapter.getChildren(contextObject, new NullProgressMonitor());
internalAdd(match, parentElementOrTreePath, newChildren);
}
}
else
{