how to make a node pre-displayed inside another node [message #485937] |
Tue, 15 September 2009 14:58 |
Eclipse User |
|
|
|
Originally posted by: yuzhanghan.hotmail.com
Could anybody tell me how to realize the following:
Given that both Node A and Node B possess independent classes in the
ecore, and Node B is defined to be drawn inside of Node A (conpartment
defined). Then how to realize that when one draws a Node A in the editor,
Node B's figure shound exist inside Node A's, there's no need to draw Node
B separately.
Thanks a lot!
|
|
|
|
Re: how to make a node pre-displayed inside another node [message #486191 is a reply to message #486001] |
Wed, 16 September 2009 16:22 |
Eclipse User |
|
|
|
Originally posted by: yuzhanghan.hotmail.com
Alex Shatalin wrote:
> Hello Yuzhang,
> Create feature sequence initializers for node A creating node B
automatically.
> -----------------
> Alex Shatalin
Hi, Alex,
your soloution works. But I have other problems following. Now I wanna
generate Node A, at the same time Node B and Node C generated inside Node
A automatically. Both Node B and C have aggregation from A. I made two
Reference New Element Specs for Node B and C respectively, but only Node B
got generated along with Node A, not Node C. (FYI Node A B C can be
generated correcly manually)
I paste the relevant part of my .gmfmap. Could you give some hints? Thanks
a lot!
... ...
<ownedChild> // from Top Node Reference of Node A
<domainMetaElement
href="dmiwf.ecore#//ProcessingElement"/> //Node A
<domainInitializer
xsi:type="gmfmap:FeatureSeqInitializer">
<initializers //Reference New Element Spec for Node B
xsi:type="gmfmap:ReferenceNewElementSpec">
<feature
xsi:type="ecore:EReference"
href="dmiwf.ecore#//ProcessingElement/inputs"/>
<newElementInitializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EReference"
href="dmiwf.ecore#//Inputs/items"/>
<value
body="0"
language="java"/>
</initializers>
</newElementInitializers>
</initializers>
<initializers //Reference New Element Spec for Node C
xsi:type="gmfmap:ReferenceNewElementSpec">
<feature
xsi:type="ecore:EReference"
href="dmiwf.ecore#//ProcessingElement/outputs"/>
<newElementInitializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EReference"
href="dmiwf.ecore#//Outputs/items"/>
<value
body="0"
language="java"/>
</initializers>
</newElementInitializers>
</initializers>
</domainInitializer>
... ...
|
|
|
Re: how to make a node pre-displayed inside another node [message #486227 is a reply to message #486191] |
Wed, 16 September 2009 19:48 |
Eclipse User |
|
|
|
Originally posted by: news.sascha.gessler.googlemail.com
Yuzhang Han wrote:
>> Create feature sequence initializers for node A creating node B
> automatically.
good way to go. If you want to take full control of the creation /
configuration of elements you can configure an AdviceBinding. For more
information and some examples, see:
Eclipse Help contents > GMF Developer Guide > Programmer's Guide > Runtime
> Extensible Type Registry > "Binding Advice to an Existing Element Type"
For example you could overwrite
"getAfterConfigureCommand(ConfigureRequest)". This way you get a hook to
provide a more complex configuration. For example you could easily
instantiate an element B when the configuration of A is requested. This
again results in an configure request after B has been created, and so on
...
A good example for an advice binding is the class
"NotationViewDependentsAdvice".
Cheers,
sas
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03427 seconds