|OutlineView [message #879523]
||Thu, 31 May 2012 07:11
| Kitesurfer ()
Registered: December 2009
I have a plugin where I programmatically position the Outline view to the cursorposition in the editor (after a cursormove or mouseposition).
I do this by determining the specific TreeViewItem object, and perform a :
prvTreeViewer.setSelection(new StructuredSelection(lcObjectToSelect), false);
This statement however goes to (and selects) the piece of text where the TreeViewItem relates to ... whereas I want to keep the cursor where it is, and don't have the editor repositioned, or redrawn etc at all.
I already tried :
prvTreeViewer.setSelection(new StructuredSelection(lcObjectToSelect), true);
result is the same.
I already tried saving the offset, and after the setSelection position again on the offset ... this also result in "movements" on the editor (it sometimes goes up or down) ... so not ideal.
So ... how do I select a TreeViewItem programmatically with the editor NOT changing at all (regarding cursorposition and visible lines of code) ?