1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

[184289] had to override internalUpdateStruct in order to provide context support for the refresh

This commit is contained in:
David McKnight 2007-05-25 15:09:03 +00:00
parent 10f1fcfea0
commit af0ffae2e4

View file

@ -3038,10 +3038,49 @@ public class SystemView extends SafeTreeViewer
}
}
if (firstCall) {
internalRefresh(element);
}
}
/**
* Override of internalRefreshStruct so that we can account for context
*/
protected void internalRefreshStruct(Widget widget, Object element, boolean updateLabels) {
if (widget instanceof TreeItem)
{
IContextObject contextObject = getContextObject((TreeItem)widget);
internalRSERefreshStruct(widget, contextObject, updateLabels);
}
else
{
internalRSERefreshStruct(widget, element, updateLabels);
}
}
/**
* This is used during RSE refresh - otherwise filters aren't applied during refresh
* @param widget the widget to refresh
* @param element the element to refresh
* @param updateLabels whether to update labels (ends up being ignored and having the value of true)
*/
private void internalRSERefreshStruct(Widget widget, Object element, boolean updateLabels)
{
updateChildren(widget, element, null); // DKM - using deprecated API because it's the only way to call updateChildren
// need a better solution for this in the future (the proper updateChildren is private)
Item[] children = getChildren(widget);
if (children != null) {
for (int i = 0; i < children.length; i++) {
Widget item = children[i];
Object data = item.getData();
if (data != null) {
internalRSERefreshStruct(item, data, updateLabels);
}
}
}
}
protected Object[] getRawChildren(Widget w) {
Object parent = w.getData();