Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Databinding - ObservableListTreeContentProvider problem with removes from a list in a CDOView
[CDO] Databinding - ObservableListTreeContentProvider problem with removes from a list in a CDOView [message #1070098] Wed, 17 July 2013 08:30 Go to next message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
Hello,

we are using a JFace-Treeviewer with the ContentProvider 'ObservableListTreeContentProvider' on an CDOObject-List from a CDOView. It works everything very nice Smile

The list here has references and is not containing the elements.

But if we remove an item from the list within a CDOTransaction nothing happens (Additions are working). I have debugged a little, the events are reaching the ContentProvider-Listener for the changes. The Diff-Element from the changeevent looks like this:
org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition [false], element [UNKNOWN]}

F.e., an addition Diff-Element looks like this:
org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition [true], element [MyClass@OID459]}

Further on in the listener, the implementation tries to remove the element
element [UNKNOWN]
The SWT-Tree removes nothing, because the element doesn't exist.

I see that the offset is mentioned in the Diff-Element. Is this problem a JFace-Databinding bug or is it CDO related?

Regards,

Per Sterner
Re: [CDO] Databinding - ObservableListTreeContentProvider problem with removes from a list in a CDOV [message #1071130 is a reply to message #1070098] Fri, 19 July 2013 12:07 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 17-07-13 10:30, Per Sterner wrote:
> Hello,
>
> we are using a JFace-Treeviewer with the ContentProvider
> 'ObservableListTreeContentProvider' on an CDOObject-List from a CDOView.
> It works everything very nice :)
>
> The list here has references and is not containing the elements.
>
uh.... an ObservableListTreeContentProvider for a list? That's
potentially odd, unless some top-level node on he list is what you want
to display in a two-level hierarchy. If the children are
non-containement you might need to tweak the getParent() method in the
TreeStructureAdvisor, to return the 'virtual' parent. otherwise
eContainer will be used, but that's not the real parent you see.


> But if we remove an item from the list within a CDOTransaction nothing
> happens (Additions are working). I have debugged a little, the events
> are reaching the ContentProvider-Listener for the changes. The
> Diff-Element from the changeevent looks like this:
> org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition
> [false], element [UNKNOWN]}
> F.e., an addition Diff-Element looks like this:
> org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition
> [true], element [MyClass@OID459]}
> Further on in the listener, the implementation tries to remove the
> element element [UNKNOWN] The SWT-Tree removes nothing, because the
> element doesn't exist.
>
> I see that the offset is mentioned in the Diff-Element. Is this problem
> a JFace-Databinding bug or is it CDO related?
>
> Regards,
>
> Per Sterner
Re: [CDO] Databinding - ObservableListTreeContentProvider problem with removes from a list in a CDOV [message #1072613 is a reply to message #1070098] Tue, 23 July 2013 06:32 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 17.07.2013 10:30, schrieb Per Sterner:
> Hello,
>
> we are using a JFace-Treeviewer with the ContentProvider 'ObservableListTreeContentProvider' on an CDOObject-List from
> a CDOView. It works everything very nice :)
>
> The list here has references and is not containing the elements.
>
> But if we remove an item from the list within a CDOTransaction nothing happens (Additions are working). I have
> debugged a little, the events are reaching the ContentProvider-Listener for the changes. The Diff-Element from the
> changeevent looks like this: org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition [false], element
> [UNKNOWN]}
> F.e., an addition Diff-Element looks like this:
> org.eclipse.core.databinding.observable.Diffs$8{position [3], isAddition [true], element [MyClass@OID459]}
> Further on in the listener, the implementation tries to remove the element element [UNKNOWN] The SWT-Tree removes
> nothing, because the element doesn't exist.
>
> I see that the offset is mentioned in the Diff-Element. Is this problem a JFace-Databinding bug or is it CDO related?
What CDO version are you using? Newer CDO versions are more relaxed with respect to removed object handling, i.e. they
have these defaults:

public interface CDOStaleReferencePolicy
{
[...]
public static final CDOStaleReferencePolicy DEFAULT = PROXY;
}

public interface CDOInvalidationPolicy
{
[...]
public static final CDOInvalidationPolicy DEFAULT = RELAXED;
}

You haven't changed that somehow?

Can you provide me with a runnable piece of code to reproduce your issue? The easiest way is to extend our
AbstractCDOTest. Please have a look at the 2000+ test case implementations.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:Copy On Write EList
Next Topic:Marshalling (XML) / Unresolved Proxy
Goto Forum:
  


Current Time: Tue Apr 23 17:45:19 GMT 2024

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

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

Back to the top