Keeping top displayed node the same during tree refreshing [message #778264] |
Wed, 11 January 2012 22:03  |
Eclipse User |
|
|
|
I have a Tree view with lots of nodes.
Sometimes a notification comes in of a change to the root node.
Since the new node is a new object, I can't just updated it. I have to do a setInput() and replace the tree.
I'd LIKE to be able to rescroll the tree so the same "value" is still at the top of the view.
So far I haven't found any way to do that.
I can use TreeViewer.getTree().getTopItem() to get the top item before the setInput().
I then get the data item value so I know what needs to be the new top value.
I just haven't found any way to use setTopItem() to restore the state, since all the TreeItems will be new now.
There doesn't seem to be a way to find the new TreeItem that has the correct data value, so I can set it to be the top item.
Any suggestions?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07191 seconds