Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » child referencing also a top node
child referencing also a top node [message #196597] Fri, 11 July 2008 09:54 Go to next message
Eclipse UserFriend
Originally posted by: paolo.paolo.it

hi, I have my editor with a set of top nodes. Then I need one of this
nodes to be contained (if one wishes so) in another of those nodes. I do
all the compartments, the nodes, the diagram labels stuff but I get a
validation error telling me that 'Containment Feature' must be owned by
'Domain Meta Element' or its super type of this reference parent Node
Mapping.
to make an example, I have two top nodes with their creation tools like an
html editor, for instance, so "creation tool DIV" and "creation tool IMG",
an img tag can be placed also alone, but into a div too... so first I had
this working mapping:

+ top node DIV ...
+ top node IMG ...

then I added a new node, diagram label, a new compartment mapping for the
img into a div, and added this:


+ top node DIV ...
--->child reference IMGintoDIV ...
+ top node IMG ...

but then I get the error, and it seems all ok to me. If I remove the IMG
top node reference I can place how many references of IMG wherever I want,
but having both a topnode and its copy as a child seems not to work
easily. I have got another model specialized in another way (with
superclasses since many properties are shared by the most of the widgets)
but here I don't want to use superclasses references because I would need
a different superclass for each widget. How can I workaround this?
Re: child referencing also a top node [message #196613 is a reply to message #196597] Fri, 11 July 2008 11:06 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Paolo,

> + top node DIV ...
> --->child reference IMGintoDIV ...
> + top node IMG ...
Similar diagram structure present in Ecore diagram example - you can create
top-level package and inner package (inside a top-level one) use this example
to create similar structures on your diagram.

Concerning error message - it is saying that containmenr reference associated
with child reference IMGintoDIV is not a reference of DIV meta-class.. AFAIU
IMG instances can be added both to the diagram and into the DIV element in
your situation, but I suppoose different containment references should be
used while adding IMG into the doamain model element associated with diagram
or into DIV element.. child references was designed exactly for this purpose.
You can have several child references referencing the same NodeMapping, but
specifying differenc containment features..

HTH
-----------------
Alex Shatalin
Re: child referencing also a top node [message #196629 is a reply to message #196613] Fri, 11 July 2008 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: paolo.paolo.it

thanks, I'll give it another try before superclassing everything... what
example do you mean? the mindmap?
Re: child referencing also a top node [message #196704 is a reply to message #196629] Fri, 11 July 2008 15:18 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Paolo,

> what example do you mean? the mindmap?
Ecore diagram example

-----------------
Alex Shatalin
Previous Topic:creating GMF files from dashboard
Next Topic:how to disable the Grammar guidance mechanism in GMF deveoped editors
Goto Forum:
  


Current Time: Thu Mar 28 22:59:18 GMT 2024

Powered by FUDForum. Page generated in 0.03504 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top