Community
Participate
Working Groups
When you call expandToLevel(1) on a tree item it will expands all of it's children in a virtual tree even with a lazyContentProvidier The code in question is in TreeViewer#createChildren() Object element = widget.getData(); if (element == null && widget instanceof TreeItem) { // parent has not been materialized virtualMaterializeItem((TreeItem) widget); // try getting the element now that updateElement was called element = widget.getData(); } if (element == null) { // give up because the parent is still not materialized return; } Item[] children = getChildren(widget); if (children.length == 1 && children[0].getData() == null) { // found a dummy node virtualLazyUpdateChildCount(widget, children.length); children = getChildren(widget); } // touch all children to make sure they are materialized for (int i = 0; i < children.length; i++) { if (children[i].getData() == null) { virtualLazyUpdateWidget(widget, i); } } return; The line Item[] children = getChildren(widget); will create all of the children of the tree item even though most of them may not be visible.
Created attachment 77753 [details] Snapshot of the expand code This is the snapshot from YourKit. it looks like the real problem is the attempt tp preserve the selection when doing this
This optimization in the AbstractTreeViewer sped things up considerably public void expandToLevel(Object elementOrTreePath, int level) { if (level == 1) { Widget widget = findItem(elementOrTreePath); if (widget != null && widget instanceof TreeItem) { ((TreeItem) widget).setExpanded(true); return; } }
With the optimization it went from 32 seconds to being too fast for me to profile.
When this gets fixed I have a workaround in the new markers view that can be deleted.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.