[TreeViewer] post selection changes are not handled as expected (as in RCP)? [message #546673] |
Tue, 13 July 2010 13:40  |
Eclipse User |
|
|
|
I added a post selection changed listener to my TreeViewer like this:
TreeViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(final SelectionChangedEvent e) {
System.out.println("post selection changed");
}
});
The problem is that if I change the selection twice very quickly by pressing the arrow up or arrow down key, then "post selection changed" is printed out twice. But it should occur only once - exactly for the last selected element, isn't it?
Because the JavaDoc of IPostSelectionProvider says:
Quote: | * A post selection changed event is equivalent to selection changed event
* if the selection change was triggered by the mouse, but it has a delay
* if the selection change is triggered by keyboard navigation.
|
In RCP I see it only once, as expected.
Use case:
I need to open the selected objects from my Tree in corresponding editors. But if I change selection quickly with the keyboard I only need to open the object I stop on. Not to open all traversed objects. Isn't it the use of post selection anyway?
Could you please advise me what I could do to make it work like in RCP?
[Updated on: Tue, 13 July 2010 13:42] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04767 seconds