Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] Deletion in model not shown in Treeviewer when bound
[DataBinding] Deletion in model not shown in Treeviewer when bound [message #312928] Mon, 26 February 2007 04:56 Go to next message
Eclipse UserFriend
Problem:
--------
I am binding to a TreeViewer using the UnorderedTreeContentProvider and
when I delete a child in the model, this isn't shown in the bounded
TreeViewer. I am using the source code that is currently in cvs for
databinding.

Investigation:
------------
After investigation, I think that the UnorderedTreeContentProvider.remove
method is calling the wrong remove method in TreeViewer. This is what
brought me to that conclusion.

This is the signature of the UnorderedTreeContentProvider.remove method

void remove(Object element, Set removals, boolean lastElement)

it is called from the class UnorderedTreeNode class in 3 places, in each
place the first parameter is a TreePath object.


(1) handleStateChanged(StaleEvent) contentProvider.remove(treePath,
removals, children.isEmpty() && !hasPendingNode);
(2) handleStale(StaleEvent): contentProvider.remove(treePath,
Collections.singleton(contentProvider.getPendingNode()), true);

(3) dispose(): contentProvider.remove(treePath, children, true);

The first parameter in UnorderedTreeContentProvider.remove method (the
TreePath object) is then used as the "parent" parameter for the
TreeViewer.remove method with this signature

public void remove(final Object parent, final Object[] elements)

However, that method should not have the TreePath as the parent, it should
have the actual parent object. There is another "remove" method in
TreeViewer that should be used for TreePaths:

public void remove(Object elementsOrTreePaths).

Conclusion:
-----------
Solution could be found by
(a) change the object being passed as the first parameter to the
UnorderedTreeContentProvider.remove method in (1), (2) (3)
(b) call the other TreeViewer remove method for TreePaths in the
UnorderedTreeContentProvider.remove method
Re: [DataBinding] Deletion in model not shown in Treeviewer when bound [message #312934 is a reply to message #312928] Mon, 26 February 2007 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Can someone tell me if I have discovered a bug in the
UnorderedTreeContentProvider or have I done something wrong and deletion
and binding to a TreeViewer work fine?

Any help would be appreciated. Thanks in advance.
Re: [DataBinding] Deletion in model not shown in Treeviewer when bound [message #312935 is a reply to message #312928] Mon, 26 February 2007 08:23 Go to previous messageGo to next message
Eclipse UserFriend
I forgot to ask a question. Can someone verify that I have found a bug in
the UnorderedTreeContentProvider or verify that binding to a TreeViewer
and deleting children in the model works fine (that means I'm doing
something else wrong).

Thanks in advance.
Re: [DataBinding] Deletion in model not shown in Treeviewer when bound [message #312948 is a reply to message #312935] Mon, 26 February 2007 10:57 Go to previous message
Eclipse UserFriend
The Tree APIs have been removed from HEAD (or more correctly made
internal) because they were incomplete and we couldn't complete them
before 1.0. If you think you have a bug can you please log it in bugzilla?

-brad
Previous Topic:How to detect Eclipse version
Next Topic:Back Arrow and 3.3M5
Goto Forum:
  


Current Time: Sun Jun 08 02:07:06 EDT 2025

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

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

Back to the top