Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to get outer data in model.
How to get outer data in model. [message #199591] Thu, 31 July 2008 17:13
Eclipse UserFriend
Originally posted by: jiezi506.gmail.com

<module:>
<shareData/>
<shareData/>
<shareData/>
<a>
<b>
<c>
<d>
</d>
</c>
</b>
</a>
</module>

above is a tree model,now I want to make a sub-tree:<d></d>,but I need
some share data between the whole-tree and the sub-tree,

I think up two solutions,

The first solution is:

construct two diagram for whole-tree and sub-tree like below

<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.0"/>
</children>
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<children>
<children>
<children>
<children>
<element href="default.model#//@module/@d"/>
</children>
<element href="default.model#//@module/@c"/>
</children>
<element href="default.model#//@module/@b"/>
</children>
<element href="default.model#//@module/@a"/>
</children>
<element href="default.model#//@module"/>
</notation:Diagram>

<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<element href="default.model#//@module/@a/@b/@c/@d"/>
</notation:Diagram>

but the second diagram can't access the data "shareData" of parent,
"<element href="default.model#//@module/@a/@b/@c/@d"/>" decides all the
model in sub-tree.

The second solution is:

I construct the second diagram like below,

<notation:Diagram xmi:id="" type="" >
<children>
<element href="default.model#//@module/@shareData.1"/>
</children>
<children>
<element href="default.model#//@module/@shareData.2"/>
</children>
<children>
<element href="default.model#//@module/@d"/>
</children>
<element href="default.model#//@module"/>
</notation:Diagram>

but I find when I make the diagram with differences with model,it's
meaningless.
"<element href="default.model#//@module"/>" decides what to display in
editor,there is a/b/c/d 4 layers yet,instead of just d 1 layer which I
want to get.
I can't control the display in editor just by diagram.

I'm sorry about my bad English,but I need some help however,thx.
Previous Topic:Remove Load Resource object contribution
Next Topic:remember pallete selection ?
Goto Forum:
  


Current Time: Sat Jun 06 12:02:55 GMT 2020

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

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

Back to the top