|
|
|
|
Re: Deletion of reference does also delete containment [message #223651 is a reply to message #223572] |
Tue, 31 March 2009 12:28 |
Daniel Rippel Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Hi Alex,
yes you are right, acutally I use a ChildReference to access the
Properties, and to put them in the according compartment. The
ChildReference has set Containment on the DiagramRoots containment and
ChildrenFeature on the Node_Objects non-containment-reference.
My actual Model looks like:
TopNode Node_Object
|- Compartment
|- ChildReference Property (Containment:
DiagramRoot.PropertyContainment/ChildrenFeature: Node_Object.Properties)
There are some other TopNodes (witch are rather similar to the
Node_Object) and one Link Maping for the associations that could be
drawn in the model.
I have tried to use a Top Node Reference to define the Properties, but
then I'm not sure how to create them correctly (using Node_Objects
childreference and setting Referenced Child to the top node does only
create the property in the Root-Containment and then crashes when trying
to add it to the Node_Object (again it tries to cast to both from
getElementToEdit() )
I'm not sure how I could create a Link Maping, using the non containment
relationship as containment feature, or how i could include a link in an
compartment. My situation is the following: I want to create something
that looks similar to the uml class. Box (Node_Object) with an
compartment of referenced Properties (Each displayed in a shared
WrappingLabel). These properties are contained in the DiagramRoot
because I need to have a complete list of all of them, and because the
Node_Object should only use references to the object, so that changing
one of them also influences and updates the other references (this works
fine)
Alex Shatalin schrieb:
> Hello Daniel,
>
> Looks like Property is described as a child element of Node_Object in
> your .gmfmap model (otherwise why generated Property2CreateCommand
> casting element to edit to Node_Object..)
>
> Can you please briefly explain me a structure of mapping model in this
> situation? In general if you are describing a node and child
> elements/links from this node then corresponding children/link domain
> model element should be deleted from morel on deleting the node…
> Looking on your model structure I propose following mapping:
> - TopNodeMapping for Node_Object
> - TopNodeMapping for Property
> - LinkMapping with LinkMetaFeature set to a reference from Node_Object
> to Property
> In this case Property should not be removed on deleting a link from
> Node_Object to Property or NodeObject itself..
>
> -----------------
> Alex Shatalin
>
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03928 seconds