[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Shortcut for 1:1:n containment reference chains in NodeMapping/ChildReference

Hello Christian,

model so that i can ask A for instances of C. (containment, derived,
transient references from A->C) - Remember: A->B is 1:1 containment
This is a right solution for now with only addition â this reference should not be containment and GMF should allow you to specify non-containment reference as containment one in ChildReference (you should be able to igronre warning on map->gen transformation and generate code then).

Might it eventually be possible to extend GMF to support this? If so,
I think, generic support of this situation is rather complex, so I doubt support this kind of âcomplex diagram structure modellingâ will be implemented in GMF in near future. As you correctly found there is a workaround for this problem â you can use EMFâs derived features + java to implement all the logic there so for GMF this will be still a parent domain model element (indirectly) containing child one.. Nevertheless for now you can try modifying GMF templates (using custom templates for this diagram editor generation) to handle this situation at least to some extend. Once youâll find a solution you can simply raise a bugzilla request with appropriate patch attached to contribute this functionality into the project.

First of all you have to modify templates generating CreateCommand to properly create intermediate element + properly assign child element to the chain of containment feature. In this case an entry point will be xpt/diagram/commands/CreateNodeCommand.xpt template.

Then youâll probably face some problems with update logic. This part will not be so simple (update is quite compex place in GMF) and in this case you have to start with xpt/diagram/updater/DiagramUpdater.xpt template.

I can not remember any other templates to be involved into this task, so good luck and ping me if you get any more questions.

-----------------
Alex Shatalin