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

Bug 5771

Summary: TreeViewer bug preserving expansion state
Product: [Eclipse Project] Platform Reporter: Craig Salter <csalter>
Component: UIAssignee: Nick Edgar <n.a.edgar>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P2 CC: hudsonr, James_Moody
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Craig Salter CLA 2001-11-10 22:42:07 EST
I'm using a TreeViewer and I've noticed that the expansion state doen't seem to 
be preserved correctly when model objects are inserted or removed.  

If I have the following tree, where A,B, and D are expanded.

[-] A
     [-] B
     [+] C
     [-] D

Then I add an X object into my model before B ... which triggers a 
viewer.refresh().  Now A, X and C are expanded.  

[-] A
     [-] X
     [+] B
     [-] C
     [+] D

There appears to be a bug in the AbstractTreeViewer code (likely in the  
updateChildren() method) such that the item.getData() information is not being 
respected when attempting to preserve expansion state.  The result (as shown 
above) is that the expansion state is associated with the wrong tree items.
Comment 1 Nick Edgar CLA 2002-05-08 16:36:06 EDT
*** Bug 15562 has been marked as a duplicate of this bug. ***
Comment 2 James Moody CLA 2002-05-16 14:36:32 EDT
*** Bug 14959 has been marked as a duplicate of this bug. ***
Comment 3 Nick Edgar CLA 2002-07-22 10:46:01 EDT

*** This bug has been marked as a duplicate of 3840 ***