Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » JFace-Databinding(Persisting to file as per GMF?)
JFace-Databinding [message #1236928] Tue, 28 January 2014 12:17 Go to next message
Greg Dart is currently offline Greg DartFriend
Messages: 17
Registered: September 2013
Junior Member
Hi,

I'm trying to create my first JFace-Databinding application. I am working from these tutorials:

http://www.vogella.com/tutorials/EclipseDataBindingEMF/article.html
http://tomsondev.bestsolution.at/2009/06/06/galileo-improved-emf-databinding-support/

What I don't understand is as follows:

I have created an EMF model and generated all the code. I have also built on top of this a GMF application (yes, I know this is the EMF forum, but I'm kind of falling between the crack....)

When I make changes to the GMF diagram (add entity for example), the change is recorded in two files (diagram layout and instance data), all based on the EMF model.

If I now replace the GMF view with a custom built JFace view using databinding as per the above tutorials, how do I first load/create those files and how do I continue to store the updates? I'm assuming via databinding but I just can't understand where to even start with this....

(I know that if I keep the GMF view, I can just "steal" the editingDomain of that view and drive changes that way but if I don't have that view at all....???)

Thanks,
Greg

[Updated on: Tue, 28 January 2014 12:18]

Report message to a moderator

Re: JFace-Databinding [message #1236961 is a reply to message #1236928] Tue, 28 January 2014 13:47 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 28-01-14 13:17, Greg Dart wrote:
> Hi,
>
> I'm trying to create my first JFace-Databinding application. I am
> working from these tutorials:
>
> http://www.vogella.com/tutorials/EclipseDataBindingEMF/article.html
> http://tomsondev.bestsolution.at/2009/06/06/galileo-improved-emf-databinding-support/
>
>
> What I don't understand is as follows:
>
> I have created an EMF model and generated all the code. I have also
> built on top of this a GMF application (yes, I know this is the EMF
> forum, but I'm kind of falling between the crack....)
>
> When I make changes to the GMF diagram (add entity for example), the
> change is recorded in two files (diagram layout and instance data), all
> based on the EMF model.
>
> If I now replace the GMF view with a custom built JFace view using
> databinding as per the above tutorials, how do I first load/create those
> files and how do I continue to store the updates? I'm assuming via
> databinding but I just can't understand where to even start with this....

There are different ways to go about.
You could simply get an EMF Resource and bind it.

set = new ResourceSetImpl()
set.getResource(URI) => the URI location of your semantic file (Not the
notation from GMF, as this only contains the visual aspects of your model).

.... bind your resource.


Other options involve sharing the EditingDoman, but this is more
complicated. Editing domain sharing is really only interresting if you
want to share the CommandStack (So Undo/Redo works accross mutiple views
or editors).

>
> (I know that if I keep the GMF view, I can just "steal" the
> editingDomain of that view and drive changes that way but if I don't
> have that view at all....???
>
> Thanks,
> Greg
Re: JFace-Databinding [message #1236977 is a reply to message #1236961] Tue, 28 January 2014 14:23 Go to previous message
Greg Dart is currently offline Greg DartFriend
Messages: 17
Registered: September 2013
Junior Member
Fantastic - that makes sense, I'll give it a go. Thanks for the swift response. Smile
Previous Topic:remove delete problems
Next Topic:EMF Eclipse Forms Editor
Goto Forum:
  


Current Time: Thu Mar 28 08:28:42 GMT 2024

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

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

Back to the top