Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 383177

Summary: [Tree] Wrong tree selection after collapse/expand tree node
Product: [RT] RAP Reporter: Michal Nikodim <michal.nikodim>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: webmaster
Version: 1.5   
Target Milestone: 2.0 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Michal Nikodim CLA 2012-06-21 01:59:32 EDT
use case:
http://rap.eclipsesource.com/rapdemo/examples#treeviewer


1. select "Hong Kong" in left tree  (fired event SWT.Selection)
2. collapse "Asia"
3. expand "Asia"

Row with "Hong Kong" is not selected. When I ask programatically tree.getSelection() then I get "Hong Kong" but visual says "nothing selected".

Bug: after expand tree row, client side have to revisualise selected rows.
Comment 1 Ivan Furnadjiev CLA 2012-06-21 04:19:41 EDT
Just tested with SWT Tree:
- when multi selection is set on the Tree, collapsing of an item removes the selection from its children. 
- when single selection is set on the Tree, collapsing of an item moves the selection from the child (hidden) item to its visible parent item.
Comment 2 Ivan Furnadjiev CLA 2012-06-22 08:10:36 EDT
(In reply to comment #1)
> - when multi selection is set on the Tree, collapsing of an item removes the
> selection from its children.
> - when single selection is set on the Tree, collapsing of an item moves the
> selection from the child (hidden) item to its visible parent item.
Fixed in master with commit 3dd62ca0e851464f718f15f673d6b3ea0c7f4646.
Comment 3 Ivan Furnadjiev CLA 2012-10-09 07:02:24 EDT
*** Bug 391396 has been marked as a duplicate of this bug. ***
Comment 4 Markus Krüger CLA 2013-10-14 04:21:24 EDT
Could you please reopen the bug?

The problem still exists in 2.1.1 and 2.1.0. See the rap demo. You can reproduce it the same way as stated in Commen #1.
Comment 5 Ivan Furnadjiev CLA 2013-10-14 04:35:54 EDT
(In reply to comment #4)
> Could you please reopen the bug?
> 
> The problem still exists in 2.1.1 and 2.1.0. See the rap demo. You can reproduce
> it the same way as stated in Commen #1.
Hi Markus, for me the Examples Demo behaves exactly as described in comment#2. The TreeViewer in the Examples Demo is created with MULTI style flag and selection is removed from the non visible items. Tree#getSelection() returns empty selection as expected.
Comment 6 Ivan Furnadjiev CLA 2013-10-14 04:37:33 EDT
I mean comment#1.
Comment 7 Markus Krüger CLA 2013-10-14 05:54:58 EDT
Never mind, Ivan. Actually we expected that if you expand the item again the selection will still exist. But we checked with SWT and it is the same behavior. So everthing is fine.