Home » Modeling » EMF » EMF Edit - can additional operations happen when a command happens?
EMF Edit - can additional operations happen when a command happens? [message #1046945] |
Mon, 22 April 2013 15:29 |
Ben Cox Messages: 17 Registered: June 2012 |
Junior Member |
|
|
I have a form-based editor, backed by EMF using the EMF Edit databindings. The editor's dirty state and undo/redo are all linked into the EditingDomain's dirty flag - all good.
The editor modifies a number of files, which aren't linked in an EMF-aware manner. For example, in one file a reference is made to a particular object name, which is also referred to in another file.
I'd like it to be the case that, when I modify the object name in a Text box, it changes in both places.
Is the best way of doing this to have two bindings registered, both with the Text as target but different EMFEdit observables in the background? Or is there another way, whereby changing the value in the binding also triggers a change in the other place? I would use Adapters, but I'm not sure they fit into the EditingDomain's view of things - is that correct?
|
|
|
Re: EMF Edit - can additional operations happen when a command happens? [message #1046972 is a reply to message #1046945] |
Mon, 22 April 2013 16:05 |
Ed Merks Messages: 33107 Registered: July 2009 |
Senior Member |
|
|
Ben,
Comments below.
On 22/04/2013 5:30 PM, Ben Cox wrote:
> I have a form-based editor, backed by EMF using the EMF Edit
> databindings. The editor's dirty state and undo/redo are all linked
> into the EditingDomain's dirty flag - all good.
>
> The editor modifies a number of files, which aren't linked in an
> EMF-aware manner.
The editor modifying files seems bad in and of itself. One generally
expects and editor to make to changes to the underlying storage except
when you save. So if you close a dirty editor, any changes you made
should have no impact...
> For example, in one file a reference is made to a particular object
> name, which is also referred to in another file.
>
> I'd like it to be the case that, when I modify the object name in a
> Text box, it changes in both places.
So you're really modifying other files and "saving" those changes?
>
> Is the best way of doing this to have two bindings registered, both
> with the Text as target but different EMFEdit observables in the
> background?
Probably, if it's all just in-memory changes.
> Or is there another way, whereby changing the value in the binding
> also triggers a change in the other place? I would use Adapters, but
> I'm not sure they fit into the EditingDomain's view of things - is
> that correct?
All the views supported directly by EMF.Edit using adapters so that's
fine too.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: EMF Edit - can additional operations happen when a command happens? [message #1047021 is a reply to message #1046972] |
Mon, 22 April 2013 17:27 |
Ben Cox Messages: 17 Registered: June 2012 |
Junior Member |
|
|
Hi Ed,
Thanks for your speedy response. Comments below.
Quote:On 22/04/2013 5:30 PM, Ben Cox wrote:
> I have a form-based editor, backed by EMF using the EMF Edit
> databindings. The editor's dirty state and undo/redo are all linked
> into the EditingDomain's dirty flag - all good.
>
> The editor modifies a number of files, which aren't linked in an
> EMF-aware manner.
The editor modifying files seems bad in and of itself. One generally
expects and editor to make to changes to the underlying storage except
when you save. So if you close a dirty editor, any changes you made
should have no impact...
Sorry, perhaps I wasn't clear. To clarify, the editor only makes changes to the files when a save is requested. The point I was trying to highlight was that the editor takes input from, and will save to, a number of files - much like the PDE Manifest Editor, which uses MANIFEST.MF, plugin.xml and build.properties.
Quote:> For example, in one file a reference is made to a particular object
> name, which is also referred to in another file.
>
> I'd like it to be the case that, when I modify the object name in a
> Text box, it changes in both places.
So you're really modifying other files and "saving" those changes?
Err... maybe?
Quote:> Is the best way of doing this to have two bindings registered, both
> with the Text as target but different EMFEdit observables in the
> background?
Probably, if it's all just in-memory changes.
> Or is there another way, whereby changing the value in the binding
> also triggers a change in the other place? I would use Adapters, but
> I'm not sure they fit into the EditingDomain's view of things - is
> that correct?
All the views supported directly by EMF.Edit using adapters so that's
fine too.
I will try to find some solution that involves either a number of bindings or adapters. I just want to ensure that the additional changes caused by that change are seen by the EditingDomain, and are added to the same step on the command stack.
|
|
| | | | | |
Goto Forum:
Current Time: Tue Mar 19 05:33:35 GMT 2024
Powered by FUDForum. Page generated in 0.02498 seconds
|