1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

[411398] SystemView event handling for icon changes needs to handle

multi-source
This commit is contained in:
Dave McKnight 2013-08-27 13:01:58 -04:00
parent c66b4cab97
commit 3ec0a08800

View file

@ -2219,21 +2219,32 @@ public class SystemView extends SafeTreeViewer
if (multiSource != null && multiSource.length > 1){ if (multiSource != null && multiSource.length > 1){
src = multiSource; // use multi source instead src = multiSource; // use multi source instead
} }
if (src instanceof Object[]){ if (src instanceof Object[] && ((Object[])src).length < 1000){ // too expensive when there are tons of children
Object[] srcs = (Object[])src; Object[] srcs = (Object[])src;
// only do this if there's an associated item
Object src1 = srcs[0];
Widget w = findItem(src1);
if (w == null){ // can't find item in tree - so fall back to refresh
refresh(parent);
}
else {
for (int s = 0; s < srcs.length; s++){ for (int s = 0; s < srcs.length; s++){
Object srcObj = srcs[s];
if (srcObj != null){
if (initViewerFilters != null && initViewerFilters.length > 0) { if (initViewerFilters != null && initViewerFilters.length > 0) {
Widget w = findItem(srcs[s]); w = findItem(srcs[s]);
if (w == null) { if (w == null) {
refresh(parent); refresh(parent);
} else { } else {
properties[0] = IBasicPropertyConstants.P_IMAGE; properties[0] = IBasicPropertyConstants.P_IMAGE;
update(srcs[s], properties); // for refreshing non-structural properties in viewer when model changes update(srcObj, properties); // for refreshing non-structural properties in viewer when model changes
} }
} else { } else {
properties[0] = IBasicPropertyConstants.P_IMAGE; properties[0] = IBasicPropertyConstants.P_IMAGE;
update(srcs[s], properties); // for refreshing non-structural properties in viewer when model changes update(srcObj, properties); // for refreshing non-structural properties in viewer when model changes
}
}
} }
} }
} }