Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Duplicate Nodes on TreeViewer Refresh
Duplicate Nodes on TreeViewer Refresh [message #293172] Wed, 19 October 2005 10:40 Go to next message
Eclipse UserFriend
Originally posted by: anonymous.tugulu.com

I am using a TreeViewer (from ResourceNavigator) as a view on a project.
When I come to refresh the viewer, however, items are added back into the
tree. For example if I have the tree:

- Root
A item
- B folder
B1 item
D item

and I add an item 'C item' and refresh I get:

- Root
A item
A item
- B folder
B1 item
+ B folder
C item
D item
D item

Refreshing again results in triplicate items etc.

I have tried passing the child nodes as identical references for identical
nodes, as well as identical values for nodes representing the same data.
I have overridden the equals() method on the nodes. This appears to be
called and the values it generates are correct, but none of these solve
the problem.

I am having trouble locating the bug (which actually exists in somebody
else's code that I am updating). I know it might be hard to diagnose this
without seeing the code, but would it be possible to give me any pointers
as to where the problem may lie or how to overcome it?

Thanks.

Graham.
Re: Duplicate Nodes on TreeViewer Refresh [message #293225 is a reply to message #293172] Thu, 20 October 2005 06:43 Go to previous message
Eclipse UserFriend
Originally posted by: anonymous.tugulu.com

Bug found - it was one of those cringingly obvious oversights that are
just too blatant to see. The code I had populated an array with nodes but
didn't clear the array or merge the data when the method was called for a
second time, thus it would add nodes repeatedly.
Previous Topic:WizardPage.finish() when user clicks on NEXT
Next Topic:Batching resource deletion - IWorkspaceRunnable?
Goto Forum:
  


Current Time: Sun May 11 03:25:31 EDT 2025

Powered by FUDForum. Page generated in 0.02254 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top