Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 15562 - Expansion state in tree viewer is strange on refresh()
Summary: Expansion state in tree viewer is strange on refresh()
Status: RESOLVED DUPLICATE of bug 5771
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-08 13:56 EDT by James Moody CLA
Modified: 2002-05-08 16:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Moody CLA 2002-05-08 13:56:11 EDT
See the dependent PR for details on how to see this.

Basically, I remove some model elements from the TreeViewer's underlying model,
and call refresh() on the tree viewer. As a result, the tree expansion is wrong.

Consider:
-A
 -b
   b1
 +c
 -d
   d1
 +e

I remove b and b1 from the tree as the result of a commit. After a refresh(), I
would expect the expansion to be:

-A
 +c
 -d
   d1
 +e

but instead it is:
-A
 -c
   c1
 +d
 -e
   e1

It looks like expansion state is remembered by index, rather than by underlying
object.

If I'm doing something wrong, please tell me.
Comment 1 Nick Edgar CLA 2002-05-08 16:36:05 EDT
A longstanding viewer problem which I'd dearly love to fix.
To do so properly requires moving to a diff-based update algorithm.
As a workaround, use remove and add rather than refresh if you can.

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