Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Databinding with EMFObservables and Editing Domain
EMF Databinding with EMFObservables and Editing Domain [message #430698] Thu, 04 June 2009 13:00 Go to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Normaly I do the Databinding in the same way like Tom's EMF Databinding
example:

IWidgetValueProperty textProp;
IWidgetValueProperty dateProp;

textProp = WidgetProperties.text();
dateProp = WidgetProperties.selection();

IEMFEditValueProperty prop = EMFEditProperties.value(p.getEditingDomain(),
ZlvpPackage.Literals.LAGER__THEMA);
IObservableValue uObs = prop.observeDetail(viewerSelection);
dbc.bindValue(SWTObservables.observeDelayedValue(400,
(ISWTObservableValue) textProp.observe(tThema)), uObs);
Now, I use a new eclipse Version because the new JFace Version kann bind
SWT.DateTime. Now, IEMFEdit is no longer available.can you help me and give
me a short example how I can do it without IEMFEdit???
Re: EMF Databinding with EMFObservables and Editing Domain [message #430700 is a reply to message #430698] Thu, 04 June 2009 13:27 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
Hi,

Which version of EMF are you using? You need to use 2.5 RC2 or RC3. The
versions before don't have support for Databinding-Properties.

I've worked on an example in last weeks and there's going to be a
blog-series about it in the next weeks.

The example source code is already available from CVS if you are interested.

Tom

Waldi schrieb:
> Normaly I do the Databinding in the same way like Tom's EMF Databinding
> example:
>
> IWidgetValueProperty textProp;
> IWidgetValueProperty dateProp;
>
> textProp = WidgetProperties.text();
> dateProp = WidgetProperties.selection();
>
> IEMFEditValueProperty prop = EMFEditProperties.value(p.getEditingDomain(),
> ZlvpPackage.Literals.LAGER__THEMA);
> IObservableValue uObs = prop.observeDetail(viewerSelection);
> dbc.bindValue(SWTObservables.observeDelayedValue(400,
> (ISWTObservableValue) textProp.observe(tThema)), uObs);
> Now, I use a new eclipse Version because the new JFace Version kann bind
> SWT.DateTime. Now, IEMFEdit is no longer available.can you help me and give
> me a short example how I can do it without IEMFEdit???
>
>
Re: EMF Databinding with EMFObservables and Editing Domain [message #430701 is a reply to message #430700] Thu, 04 June 2009 13:36 Go to previous messageGo to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Thanks a lot for your answer. I will look aft RC2 or 3 One short question
for you: EMFObservables.observeResourceContents(doGetResource()); How is the
new way observe resources? Is it fixed in RC2 to?
"Tom Schindl" <tom.schindl@bestsolution.at> schrieb im Newsbeitrag
news:h08i4d$6en$1@build.eclipse.org...
> Hi,
>
> Which version of EMF are you using? You need to use 2.5 RC2 or RC3. The
> versions before don't have support for Databinding-Properties.
>
> I've worked on an example in last weeks and there's going to be a
> blog-series about it in the next weeks.
>
> The example source code is already available from CVS if you are
> interested.
>
> Tom
>
> Waldi schrieb:
>> Normaly I do the Databinding in the same way like Tom's EMF Databinding
>> example:
>>
>> IWidgetValueProperty textProp;
>> IWidgetValueProperty dateProp;
>>
>> textProp = WidgetProperties.text();
>> dateProp = WidgetProperties.selection();
>>
>> IEMFEditValueProperty prop =
>> EMFEditProperties.value(p.getEditingDomain(),
>> ZlvpPackage.Literals.LAGER__THEMA);
>> IObservableValue uObs = prop.observeDetail(viewerSelection);
>> dbc.bindValue(SWTObservables.observeDelayedValue(400,
>> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>> Now, I use a new eclipse Version because the new JFace Version kann bind
>> SWT.DateTime. Now, IEMFEdit is no longer available.can you help me and
>> give
>> me a short example how I can do it without IEMFEdit???
>>
>>
Re: EMF Databinding with EMFObservables and Editing Domain [message #430702 is a reply to message #430701] Thu, 04 June 2009 13:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
Hi Waldi,

Yes but this might change in 2.6 if we manage to come up with a
properties implementation for the resource-content.

This would make the EMFObservables-Class and others unneeded and we
would deprecate and probably even remove them if we manage to add this
support say for M1 or M2.

If you want get more background information you can take a look at
262160 which holds the implementation history of this support.

Tom

Waldi schrieb:
> Thanks a lot for your answer. I will look aft RC2 or 3 One short question
> for you: EMFObservables.observeResourceContents(doGetResource()); How is the
> new way observe resources? Is it fixed in RC2 to?
> "Tom Schindl" <tom.schindl@bestsolution.at> schrieb im Newsbeitrag
> news:h08i4d$6en$1@build.eclipse.org...
>> Hi,
>>
>> Which version of EMF are you using? You need to use 2.5 RC2 or RC3. The
>> versions before don't have support for Databinding-Properties.
>>
>> I've worked on an example in last weeks and there's going to be a
>> blog-series about it in the next weeks.
>>
>> The example source code is already available from CVS if you are
>> interested.
>>
>> Tom
>>
>> Waldi schrieb:
>>> Normaly I do the Databinding in the same way like Tom's EMF Databinding
>>> example:
>>>
>>> IWidgetValueProperty textProp;
>>> IWidgetValueProperty dateProp;
>>>
>>> textProp = WidgetProperties.text();
>>> dateProp = WidgetProperties.selection();
>>>
>>> IEMFEditValueProperty prop =
>>> EMFEditProperties.value(p.getEditingDomain(),
>>> ZlvpPackage.Literals.LAGER__THEMA);
>>> IObservableValue uObs = prop.observeDetail(viewerSelection);
>>> dbc.bindValue(SWTObservables.observeDelayedValue(400,
>>> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>>> Now, I use a new eclipse Version because the new JFace Version kann bind
>>> SWT.DateTime. Now, IEMFEdit is no longer available.can you help me and
>>> give
>>> me a short example how I can do it without IEMFEdit???
>>>
>>>
>
>
Re: EMF Databinding with EMFObservables and Editing Domain [message #430703 is a reply to message #430702] Thu, 04 June 2009 15:14 Go to previous messageGo to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Okay all is running fine, only one short problem: If I change a text, the
treeViewer doesn't reakt and the domain doesnt become dirty. I've changed
nothing, only the DateTimes. Is it sure there isn't a bug?
Another question: What is this for a number? 262160.
Can you give me a tip how I can find the example from which you talk?

Here is my Code again to observe the EditingDomain

tThema = new Text(composite2, SWT.NONE);
tThema.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

IEMFEditValueProperty prop =
EMFEditProperties.value(p.getEditingDomain(),
ZlvpPackage.Literals.LAGER__THEMA);
IObservableValue uObs = prop.observeDetail(viewerSelection);
dbc.bindValue(SWTObservables.observeDelayedValue(400,
(ISWTObservableValue) textProp.observe(tThema)), uObs);



"Tom Schindl" <tom.schindl@bestsolution.at> schrieb im Newsbeitrag
news:h08jtc$pri$1@build.eclipse.org...
> Hi Waldi,
>
> Yes but this might change in 2.6 if we manage to come up with a
> properties implementation for the resource-content.
>
> This would make the EMFObservables-Class and others unneeded and we
> would deprecate and probably even remove them if we manage to add this
> support say for M1 or M2.
>
> If you want get more background information you can take a look at
> 262160 which holds the implementation history of this support.
>
> Tom
>
> Waldi schrieb:
>> Thanks a lot for your answer. I will look aft RC2 or 3 One short question
>> for you: EMFObservables.observeResourceContents(doGetResource()); How is
>> the
>> new way observe resources? Is it fixed in RC2 to?
>> "Tom Schindl" <tom.schindl@bestsolution.at> schrieb im Newsbeitrag
>> news:h08i4d$6en$1@build.eclipse.org...
>>> Hi,
>>>
>>> Which version of EMF are you using? You need to use 2.5 RC2 or RC3. The
>>> versions before don't have support for Databinding-Properties.
>>>
>>> I've worked on an example in last weeks and there's going to be a
>>> blog-series about it in the next weeks.
>>>
>>> The example source code is already available from CVS if you are
>>> interested.
>>>
>>> Tom
>>>
>>> Waldi schrieb:
>>>> Normaly I do the Databinding in the same way like Tom's EMF Databinding
>>>> example:
>>>>
>>>> IWidgetValueProperty textProp;
>>>> IWidgetValueProperty dateProp;
>>>>
>>>> textProp = WidgetProperties.text();
>>>> dateProp = WidgetProperties.selection();
>>>>
>>>> IEMFEditValueProperty prop =
>>>> EMFEditProperties.value(p.getEditingDomain(),
>>>> ZlvpPackage.Literals.LAGER__THEMA);
>>>> IObservableValue uObs = prop.observeDetail(viewerSelection);
>>>> dbc.bindValue(SWTObservables.observeDelayedValue(400,
>>>> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>>>> Now, I use a new eclipse Version because the new JFace Version kann
>>>> bind
>>>> SWT.DateTime. Now, IEMFEdit is no longer available.can you help me and
>>>> give
>>>> me a short example how I can do it without IEMFEdit???
>>>>
>>>>
>>
>>
Re: EMF Databinding with EMFObservables and Editing Domain [message #430704 is a reply to message #430703] Thu, 04 June 2009 15:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
Waldi schrieb:
> Okay all is running fine, only one short problem: If I change a text, the
> treeViewer doesn't reakt and the domain doesnt become dirty. I've changed
> nothing, only the DateTimes. Is it sure there isn't a bug?
> Another question: What is this for a number? 262160.

It's a bug id.

> Can you give me a tip how I can find the example from which you talk?
>
> Here is my Code again to observe the EditingDomain
>
> tThema = new Text(composite2, SWT.NONE);
> tThema.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>
> IEMFEditValueProperty prop =
> EMFEditProperties.value(p.getEditingDomain(),
> ZlvpPackage.Literals.LAGER__THEMA);
> IObservableValue uObs = prop.observeDetail(viewerSelection);
> dbc.bindValue(SWTObservables.observeDelayedValue(400,
> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>

I have no idea. My wild guess is that because you are not setting any
converters the default ones are used and then you need to use a
ISO-Format for input which is yyyy-mm-dd.

Please also note you'll have to use an EMFDatabindingContext because
EMF-Databinding returns the EStructuralFeature as type from the observables.

You can check out my example project from CVS and reuse the converters
I've written there.

Because we are at it and you are using dates in a master-detail scenario
I have to point you to a nasty bug [1] which failed the inclusion in 3.5!

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=278301
Re: EMF Databinding with EMFObservables and Editing Domain [message #430717 is a reply to message #430704] Thu, 04 June 2009 19:05 Go to previous messageGo to next message
Waldi  is currently offline Waldi Friend
Messages: 60
Registered: July 2009
Member
Ok, fine, now all is running. It works like a charm. It was my fault I
forgot to set the date attribute to date.... I'm a newbie....

The example project from which you speak is it the library example? I
work with it... It is realy good. A big compliment to you.

I know the bug but what can I do? waiting ;-) It's ok... I have time.

Tom Schindl schrieb:
> Waldi schrieb:
>> Okay all is running fine, only one short problem: If I change a text, the
>> treeViewer doesn't reakt and the domain doesnt become dirty. I've changed
>> nothing, only the DateTimes. Is it sure there isn't a bug?
>> Another question: What is this for a number? 262160.
>
> It's a bug id.
>
>> Can you give me a tip how I can find the example from which you talk?
>>
>> Here is my Code again to observe the EditingDomain
>>
>> tThema = new Text(composite2, SWT.NONE);
>> tThema.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>>
>> IEMFEditValueProperty prop =
>> EMFEditProperties.value(p.getEditingDomain(),
>> ZlvpPackage.Literals.LAGER__THEMA);
>> IObservableValue uObs = prop.observeDetail(viewerSelection);
>> dbc.bindValue(SWTObservables.observeDelayedValue(400,
>> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>>
>
> I have no idea. My wild guess is that because you are not setting any
> converters the default ones are used and then you need to use a
> ISO-Format for input which is yyyy-mm-dd.
>
> Please also note you'll have to use an EMFDatabindingContext because
> EMF-Databinding returns the EStructuralFeature as type from the observables.
>
> You can check out my example project from CVS and reuse the converters
> I've written there.
>
> Because we are at it and you are using dates in a master-detail scenario
> I have to point you to a nasty bug [1] which failed the inclusion in 3.5!
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=278301
Re: EMF Databinding with EMFObservables and Editing Domain [message #430719 is a reply to message #430717] Thu, 04 June 2009 23:12 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6559
Registered: July 2009
Senior Member
Hi Waldi,

Well it depends the Libary example is the one I worked on for my
EclipseCon presentation. The one I talked about in this mail is the one
you can fetch from EMF-CVS
(cvsroot/org.eclipse.emf/org.eclipse.emf/examples/org.eclips e.emf.examples.databinding.*).


It's a completely running RCP-Application showing the complete
EMF-Databinding API.

In the next few days/weeks I'm going to run a blog series [1] about
EMF-Databinding which might give you a jump start into the whole topic.


The bug I referenced is *NOT* going to be fixed in 3.5.0 and because the
code part it is in is a really dangerous it might not get fixed in 3.5.x.

We are currently working on documenting an work around using the public
API but we haven't come to a final conclusion what we are going to
propose to our customers.

The regression I talked about in the is there since 2007 and nobody came
across it (until I came across :-) though I think the use case I
described is not that unusual.

To get informed about solutions I'd suggest that you subscribe to the
bug report so that you see what's going on.

Tom

[1]http://tomsondev.bestsolution.at

Waldi Waldemar schrieb:
> Ok, fine, now all is running. It works like a charm. It was my fault I
> forgot to set the date attribute to date.... I'm a newbie....
>
> The example project from which you speak is it the library example? I
> work with it... It is realy good. A big compliment to you.
>
> I know the bug but what can I do? waiting ;-) It's ok... I have time.
>
> Tom Schindl schrieb:
>> Waldi schrieb:
>>> Okay all is running fine, only one short problem: If I change a text,
>>> the treeViewer doesn't reakt and the domain doesnt become dirty. I've
>>> changed nothing, only the DateTimes. Is it sure there isn't a bug?
>>> Another question: What is this for a number? 262160.
>>
>> It's a bug id.
>>
>>> Can you give me a tip how I can find the example from which you talk?
>>>
>>> Here is my Code again to observe the EditingDomain
>>>
>>> tThema = new Text(composite2, SWT.NONE);
>>> tThema.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>>>
>>> IEMFEditValueProperty prop =
>>> EMFEditProperties.value(p.getEditingDomain(),
>>> ZlvpPackage.Literals.LAGER__THEMA);
>>> IObservableValue uObs = prop.observeDetail(viewerSelection);
>>> dbc.bindValue(SWTObservables.observeDelayedValue(400,
>>> (ISWTObservableValue) textProp.observe(tThema)), uObs);
>>>
>>
>> I have no idea. My wild guess is that because you are not setting any
>> converters the default ones are used and then you need to use a
>> ISO-Format for input which is yyyy-mm-dd.
>>
>> Please also note you'll have to use an EMFDatabindingContext because
>> EMF-Databinding returns the EStructuralFeature as type from the
>> observables.
>>
>> You can check out my example project from CVS and reuse the converters
>> I've written there.
>>
>> Because we are at it and you are using dates in a master-detail scenario
>> I have to point you to a nasty bug [1] which failed the inclusion in 3.5!
>>
>> Tom
>>
>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=278301
Previous Topic:Add another model to an exist EMF project
Next Topic:WSDL model listener
Goto Forum:
  


Current Time: Thu Jul 16 04:43:45 GMT 2020

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

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

Back to the top