|
Re: [EMF + Teneo] EMF.edit actions and GMF [message #420988 is a reply to message #420987] |
Sat, 19 July 2008 16:33 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Matthias,
Comments below.
Matthias wrote:
> Hi Ed and Martin!
>
> I edit my model instances with the help of the provided EMF.edit
> actions like CopyAction, CutAction, DeleteAction and so on. This works
> perfect until I want to edit my "Map" model instance that can be
> displayed by the GMF editor. As you know a map always must come with
> an diagram model instance where the graphical information is persisted.
No, I don't really get it. I don't know all that much about GMF,
unfortunately.
> The problem is that the provided Action implementaiton does not work
> as expected: DeleteAction only removes the map instance not the
> diagram instance, CopyAction only copies the map instance and not the
> diagram too and so on.
It sounds like you should be doing something more directly with GMF and
acting on the diagram.
> AFAIK this is because the map does not know (say it has no reference)
> anything about its diagram instance, only the diagram has a
> non-containment reference to the map (Diagram.setElement() ). So all
> these actions are useless for this type of model instances and I have
> to provide additional implementation to this actions.
Yes, you'd need to act on both the model and the diagram that references it.
>
> My ideas/questions are
> a) how should I extend the provided actions so that also concern the
> diagram instance?!? Iterate over all diagrams in the resource and
> search for the adequate map?
There must be a GMF API for finding the diagram things that reference a
given model instance.
> b) do we have any API like "is referenced by"?!?
We have cross referencers and and an ECrossReferenceAdapter that
maintains up-to-date information about inverses of unidirectional
references.
> c) can this problem be easily solved with some proper resource
> handling: like each map and diagram instance is stored inside its own
> resource, and than the resource should be deleted, copied, etc.?! Is
> this possible with the EMF edit actions out of the box?!
I kind of doubt it. I just imagine that GMF must have a way to dealing
with all these basic issues though I think they don't reuse the commands
produced by the item providers (and I'm not sure why).
> d) or maybe bad idea: keep a diagram reference in the map
I'm slightly confused by this. The model is referring back to the
diagram for the model?
>
> Thanks for any ideas,
> Matthias
>
> PS: Do not forget I am using Teneo's Store Resource to persist and
> load my model instances.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02669 seconds