|Re: 2 different top level node types from same model element type [message #228635 is a reply to message #228619]
||Fri, 01 May 2009 07:58
| Yuri G
Registered: July 2009
I guess you need to add OCL constraints to each of node mappings for
FOLDER, so that GMF can choose the right type of node to display (I think
in your case at the moment it just peeks the first node mapping which
works for the FOLDER meta-element).
For the FOLDER only with TEXT_FILES it would be something like
'self.IMAGE_FILES->isEmpty()' and for the second node which has an image
compartment: 'self.IMAGE_FILES->notEmpty()'. Here I suggest that
IMAGE_FILES is a collection contained in the FOLDER.
John Yotka wrote:
> I need to display 2 different types of top level nodes for a given type
> of model element, where each type displays different relevant
> information about the model element. For example, suppose I have a
> model element type FOLDER that always contains TEXT_FILES, but sometimes
> (rarely) also contains IMAGE_FILES. I need one top level node type,
> which has a compartment showing the TEXT_FILES. And I also need a
> different top level node type, which has a compartment showing the
> IMAGE_FILES. When I create the two top level nodes in the .gmfmap file
> everything generates ok, that is there are 2 different editParts
> generated for the 2 different top nodes, but only one type of nodes
> (eg., TEXT_FILES) are displayed.
> Is this concept of multiple (different) Top Level Nodes for same model
> element type supported directly by GMF? Is there a way to modify the
> generated code to accomplish this? Thanks for any help in advance!
I suggest that you need to add OCL constraints
Powered by FUDForum
. Page generated in 0.02367 seconds