1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 01:55:24 +02:00

[187205] don't expanded previously unexpanded node in refreshRemoteObject()

This commit is contained in:
David McKnight 2007-05-16 19:38:22 +00:00
parent 6b0da7d092
commit a19090e01d

View file

@ -2852,6 +2852,7 @@ public class SystemView extends SafeTreeViewer
// a reference to this remote object // a reference to this remote object
if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) { if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
Object data = match.getData(); Object data = match.getData();
boolean wasExpanded = ((TreeItem)match).getExpanded();
smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object
if (firstSelection && // for now, we just select the first binary occurrence we find if (firstSelection && // for now, we just select the first binary occurrence we find
(data == remoteObject)) // same binary object as given? (data == remoteObject)) // same binary object as given?
@ -2864,7 +2865,7 @@ public class SystemView extends SafeTreeViewer
{ {
allowExpand = rmtAdapter.hasChildren((IAdaptable)data); allowExpand = rmtAdapter.hasChildren((IAdaptable)data);
} }
if (allowExpand && !getExpanded(match)) // assume if callers wants to select kids that they want to expand parent if (allowExpand && wasExpanded && !getExpanded(match)) // assume if callers wants to select kids that they want to expand parent
{ {
createChildren(match); createChildren(match);
setExpanded(match, true); setExpanded(match, true);