Skip to main content



      Home
Home » Modeling » EMF » Databinding & Transactional Editing Domain
Databinding & Transactional Editing Domain [message #730946] Thu, 29 September 2011 11:18 Go to next message
Eclipse UserFriend
Hi,

I'm creating an application that needs a transactional editing domain (leverages XText & Graphiti). In this application I need to create some data-entry page, allowing the user to inspect and change parts of the model. I would like to use the databinding functionality to link the JFace GUI elements with the underlying model. Since I'm not an expert in this field, I used the WindowBuilder wizards. Everything works correctly if the element is not inserted in any Resource (e.g., in those wizards that provide the user with the ability to create new elements). However, as soon as the element is inserted in a resource (directly or by containment relationships) everything stop working and the following exception is thrown:

java.lang.IllegalStateException: Cannot modify resource set without a write transaction children=[Status ERROR: org.eclipse.core.databinding code=0 An error occurred while setting the value. java.lang.IllegalStateException: Cannot modify resource set without a write transaction]

For this reason, it seems to me that my basic databinding does not use any transactional editing domain... does anybody have successfully created a databinding with a transactional resource?

Thanks for any help!

--
Matteo
Re: Databinding & Transactional Editing Domain [message #730950 is a reply to message #730946] Thu, 29 September 2011 11:21 Go to previous messageGo to next message
Eclipse UserFriend
* EMFProperties / EMFObservables directly use eGet/eSet/List-API
* EMFEditProperties / EMFEditObservables goes through the provided
EditingDomain using Commands

=> You need to use EMFEditProperties / EMFEditObservables

Tom

Am 29.09.11 17:18, schrieb Matteo:
> Hi,
>
> I'm creating an application that needs a transactional editing domain
> (leverages XText & Graphiti). In this application I need to create some
> data-entry page, allowing the user to inspect and change parts of the
> model. I would like to use the databinding functionality to link the
> JFace GUI elements with the underlying model. Since I'm not an expert in
> this field, I used the WindowBuilder wizards. Everything works correctly
> if the element is not inserted in any Resource (e.g., in those wizards
> that provide the user with the ability to create new elements). However,
> as soon as the element is inserted in a resource (directly or by
> containment relationships) everything stop working and the following
> exception is thrown:
>
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction children=[Status ERROR: org.eclipse.core.databinding
> code=0 An error occurred while setting the value.
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction]
>
> For this reason, it seems to me that my basic databinding does not use
> any transactional editing domain... does anybody have successfully
> created a databinding with a transactional resource?
>
> Thanks for any help!
>
> --
> Matteo
Re: Databinding & Transactional Editing Domain [message #730959 is a reply to message #730946] Thu, 29 September 2011 11:26 Go to previous messageGo to next message
Eclipse UserFriend
Matteo,

Are you using EMFEditObservables? That will certainly be necessary to
get this working, but I saw this question about using EMFEditObservables
verses EMFObservables in the WindowBuilder forum yesterday and that's
not currently supported. You might look into using EEF...


On 29/09/2011 8:18 AM, Matteo wrote:
> Hi,
>
> I'm creating an application that needs a transactional editing domain
> (leverages XText & Graphiti). In this application I need to create
> some data-entry page, allowing the user to inspect and change parts of
> the model. I would like to use the databinding functionality to link
> the JFace GUI elements with the underlying model. Since I'm not an
> expert in this field, I used the WindowBuilder wizards. Everything
> works correctly if the element is not inserted in any Resource (e.g.,
> in those wizards that provide the user with the ability to create new
> elements). However, as soon as the element is inserted in a resource
> (directly or by containment relationships) everything stop working and
> the following exception is thrown:
>
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction children=[Status ERROR: org.eclipse.core.databinding
> code=0 An error occurred while setting the value.
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction]
>
> For this reason, it seems to me that my basic databinding does not use
> any transactional editing domain... does anybody have successfully
> created a databinding with a transactional resource?
>
> Thanks for any help!
>
> --
> Matteo
Re: Databinding & Transactional Editing Domain [message #730967 is a reply to message #730959] Thu, 29 September 2011 11:55 Go to previous message
Eclipse UserFriend
Hi,

Tom was right: I was using EMFObservables. With EMFEditObservables everything is ok!

Ed, I saw EEF, but I was afraid to mix so many new projects (new for me, I mean Smile ). Now that everything starts working, I will give EEF a try!

Thanks,
Matteo
Re: Databinding & Transactional Editing Domain [message #730982 is a reply to message #730959] Thu, 29 September 2011 11:55 Go to previous message
Eclipse UserFriend
Hi,

Tom was right: I was using EMFObservables. With EMFEditObservables everything is ok!

Ed, I saw EEF, but I was afraid to mix so many new projects (new for me, I mean :) ). Now that everything starts working, I will give EEF a try!

Thanks,
Matteo
Previous Topic:Proxy resolution in case of Abstract types
Next Topic:Line separators in the Sample Ecore Model Editor
Goto Forum:
  


Current Time: Wed Jul 16 02:59:32 EDT 2025

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

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

Back to the top