Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Apply changes on save
Apply changes on save [message #418454] Wed, 16 April 2008 16:23 Go to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,
i am writing an editor for model instances, that means the editor is not
for a hole resource, but for one EObject inside (like editing only the
libary in the emf example). I use the emf databindings to synronize the
model and the controls. It is creating commands for me if the user edit
sth. in the controls. The problem i have is that i want changes made in
the controls not to be applied in the underlying model until the user
calls "save". This is because the model is shared between different
editors and is made persistent transparently without a resource.save.
The solution i was thinking of is not to use databindings. Then i could
let the user edit the Controls and on save write them into the model. But
this would be a lot of manual work to syncronize.
Is there any way to do this with databindings, like not executing the
commands until save()?
Re: Apply changes on save [message #418456 is a reply to message #418454] Wed, 16 April 2008 16:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Jonas,

Maybe you could make a copy of the instance and then replace the
original with the copy when they do a save. Or use something like a
change recorder to record the changes to the copy and apply them to the
original afterwards.

Jonas wrote:
> Hi,
> i am writing an editor for model instances, that means the editor is
> not for a hole resource, but for one EObject inside (like editing only
> the libary in the emf example). I use the emf databindings to
> synronize the model and the controls. It is creating commands for me
> if the user edit sth. in the controls. The problem i have is that i
> want changes made in the controls not to be applied in the underlying
> model until the user calls "save". This is because the model is shared
> between different editors and is made persistent transparently without
> a resource.save.
> The solution i was thinking of is not to use databindings. Then i
> could let the user edit the Controls and on save write them into the
> model. But this would be a lot of manual work to syncronize. Is there
> any way to do this with databindings, like not executing the commands
> until save()?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem with aliasings of ID values
Next Topic:Delete not enabled in editor for non-containment references
Goto Forum:
  


Current Time: Thu Apr 25 10:22:22 GMT 2024

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

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

Back to the top