Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EObjectObservableList in EMF Databinding 1.1
EObjectObservableList in EMF Databinding 1.1 [message #493120] Fri, 23 October 2009 09:34 Go to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Hi all,
using EObjectObservableList I stepped over the constructor:
public EObjectObservableList(Realm realm, EObject eObject,
EStructuralFeature eStructuralFeature)
{
super(realm, (EList< ? >)eObject.eGet(eStructuralFeature),
eStructuralFeature);
this.eObject = eObject;
this.eStructuralFeature = eStructuralFeature;
}

The last parameter in super call should be the element type of the
IObservableList I guess. (see JavaDoc for
org.eclipse.core.databinding.observable.list.IObservableList .getElementType())

So it looks like the ElementType of the EObjectObservableList is ever
EStructuralFeature and not the feature type. I think it should be
eStructuralFeature.getEType().
Or am I missing something?

Best Regards,
Dennis.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: EObjectObservableList in EMF Databinding 1.1 [message #493136 is a reply to message #493120] Fri, 23 October 2009 10:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Dennis,

Knowing just the type of the value isn't enough information. The
multiplicity of the feature affects whether you get a list or just a
single value and the feature includes constraints, such as the upper and
lower bound, so generally use the feature everywhere.


Dennis Hübner wrote:
> Hi all,
> using EObjectObservableList I stepped over the constructor:
> public EObjectObservableList(Realm realm, EObject eObject,
> EStructuralFeature eStructuralFeature)
> {
> super(realm, (EList< ? >)eObject.eGet(eStructuralFeature),
> eStructuralFeature);
> this.eObject = eObject;
> this.eStructuralFeature = eStructuralFeature;
> }
>
> The last parameter in super call should be the element type of the
> IObservableList I guess. (see JavaDoc for
> org.eclipse.core.databinding.observable.list.IObservableList .getElementType())
>
>
> So it looks like the ElementType of the EObjectObservableList is ever
> EStructuralFeature and not the feature type. I think it should be
> eStructuralFeature.getEType().
> Or am I missing something?
>
> Best Regards,
> Dennis.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EObjectObservableList in EMF Databinding 1.1 [message #493147 is a reply to message #493120] Fri, 23 October 2009 11:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

The reason that the type in Eclipse Databinding is an Object and not an
Class is that technologies like EMF can provide more clever conversion,
.... .

So we are using EStructuralFeature as the type where ever e.g.
JavaBeanBindings uses Class. You should not create instance of this
class your own BTW but go through the factories. I was on the way to
deprecate them in the last cycle but was too late.

Is this causing you any problems?

Tom

Dennis Hübner schrieb:
> Hi all,
> using EObjectObservableList I stepped over the constructor:
> public EObjectObservableList(Realm realm, EObject eObject,
> EStructuralFeature eStructuralFeature)
> {
> super(realm, (EList< ? >)eObject.eGet(eStructuralFeature),
> eStructuralFeature);
> this.eObject = eObject;
> this.eStructuralFeature = eStructuralFeature;
> }
>
> The last parameter in super call should be the element type of the
> IObservableList I guess. (see JavaDoc for
> org.eclipse.core.databinding.observable.list.IObservableList .getElementType())
>
>
> So it looks like the ElementType of the EObjectObservableList is ever
> EStructuralFeature and not the feature type. I think it should be
> eStructuralFeature.getEType().
> Or am I missing something?
>
> Best Regards,
> Dennis.
Re: EObjectObservableList in EMF Databinding 1.1 [message #493151 is a reply to message #493136] Fri, 23 October 2009 12:01 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Hello Ed,
in my case:
I bind an upper bound EStructuralFeature, type is i.e. EString, to a
whatever swt list control. So I create an
EditingDomainEObjectObservableList(domain, someEObject,
myUpperBoundFeature). Cause it's an *ObservableList we know that it's an
upper bound Feature and the element type should be EString I suppose.

Maybe I just misunderstood the meaning of getElementType() method or the
JavaDoc is not clear enough :)

Thanks,
Dennis.

Ed Merks schrieb:
> Dennis,
>
> Knowing just the type of the value isn't enough information. The
> multiplicity of the feature affects whether you get a list or just a
> single value and the feature includes constraints, such as the upper and
> lower bound, so generally use the feature everywhere.
>
>
> Dennis Hübner wrote:
>> Hi all,
>> using EObjectObservableList I stepped over the constructor:
>> public EObjectObservableList(Realm realm, EObject eObject,
>> EStructuralFeature eStructuralFeature)
>> {
>> super(realm, (EList< ? >)eObject.eGet(eStructuralFeature),
>> eStructuralFeature);
>> this.eObject = eObject;
>> this.eStructuralFeature = eStructuralFeature;
>> }
>>
>> The last parameter in super call should be the element type of the
>> IObservableList I guess. (see JavaDoc for
>> org.eclipse.core.databinding.observable.list.IObservableList .getElementType())
>>
>>
>> So it looks like the ElementType of the EObjectObservableList is ever
>> EStructuralFeature and not the feature type. I think it should be
>> eStructuralFeature.getEType().
>> Or am I missing something?
>>
>> Best Regards,
>> Dennis.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: EObjectObservableList in EMF Databinding 1.1 [message #493176 is a reply to message #493147] Fri, 23 October 2009 13:11 Go to previous message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Hi Tom!
> Is this causing you any problems?
I noticed any so far, just wonder about the implementation.

Thanks,
Dennis.


Tom Schindl schrieb:
> Hi,
>
> The reason that the type in Eclipse Databinding is an Object and not an
> Class is that technologies like EMF can provide more clever conversion,
> ... .
>
> So we are using EStructuralFeature as the type where ever e.g.
> JavaBeanBindings uses Class. You should not create instance of this
> class your own BTW but go through the factories. I was on the way to
> deprecate them in the last cycle but was too late.
>
> Is this causing you any problems?
>
> Tom
>
> Dennis Hübner schrieb:
>> Hi all,
>> using EObjectObservableList I stepped over the constructor:
>> public EObjectObservableList(Realm realm, EObject eObject,
>> EStructuralFeature eStructuralFeature)
>> {
>> super(realm, (EList< ? >)eObject.eGet(eStructuralFeature),
>> eStructuralFeature);
>> this.eObject = eObject;
>> this.eStructuralFeature = eStructuralFeature;
>> }
>>
>> The last parameter in super call should be the element type of the
>> IObservableList I guess. (see JavaDoc for
>> org.eclipse.core.databinding.observable.list.IObservableList .getElementType())
>>
>>
>> So it looks like the ElementType of the EObjectObservableList is ever
>> EStructuralFeature and not the feature type. I think it should be
>> eStructuralFeature.getEType().
>> Or am I missing something?
>>
>> Best Regards,
>> Dennis.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Problem with href
Next Topic:How to control the line termintor used by XML resources?
Goto Forum:
  


Current Time: Thu Apr 25 10:50:40 GMT 2024

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

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

Back to the top