| [news.eclipse.modeling.gmf] Re: A clear definition of "children feature" and its use cases? |
Hello Mous,
I had to search on google to understand what "AFAIK" means! My english is not that good :p!
AW(AnyWay ;)), I tried to create an editor for this case :
EClass D <>------>EClass E<>------>EClass B <>------> EClass C ------> EClass A EClass D <>------>EClass A I created a main editor (Root D) Es contain Bs => no problem. I created a sub-editor for the Bs: in the gmfmap B is the root element. I created a top node for C and a top node for A with (containment feature)and (children feature) left blank. So it's a phantom node. I created a linkMapping representing the reference between C and A.
I generated the gmfgen ignoring the validating error (phatom nodes exist not targeted ...) of the gmfmap. I generated the code(No complain from the gmfgen).
My editor works fine. A nodes appears at the resource level as expected from the phantom nodes.
From now, I have 3 questions :
Well, you still have "unexpected behavior" - "A" diagram elements created on "B" diagram will go to the root of domain model resource directly and will not reside in any containers.. This is why we show warning while transforming .gmfmap to .gmfgen..- Is this a bug in gmf : gmfmap not valid and gmfgen valid and no problem in generated code ?
I suggest you to modify ACreateCommand generated for diagram "B". You can see that this command is now attaching newly created "A" instance to the root of domain model resource. You can modify this code to look for appropriate "D" and use it as a container for newly created "A". I suppose you will have some problems with diagram contents initialization functionality at the end, but let's postpone these questions till next time. :-)- I want the As to be created in the D level instead of the resource level. Is this possible ? If yes, how to do it ? EMF custom code or GMF custom code ?
This is expected behavior for "phantom" nodes - all nodes without specified contained will reside in resource root.- I noticed that the As are shared between all the instances of B diagrams i-e if I created a new instance of B all the As that ewxist
the resource are loaded in my new diagram. I managed to handle this by changing the XDiagramUpdater.getB_VisualIDSemanticChildren() method. Is there a another/better way to do this ?
I think this is a proper place to enter custom modifications in this case.
----------------- Alex Shatalin