Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create a child Reference automatically when I create an child contained in the first one (Create a child Reference automatically when I create an child contained in the first one )
Create a child Reference automatically when I create an child contained in the first one [message #664094] Thu, 07 April 2011 13:11 Go to next message
Rahma  is currently offline Rahma Friend
Messages: 7
Registered: February 2011
Junior Member
Hi,

I Have a Top Node Reference : System
the class System have a containment relation ship to a class called SystemFeatures. The class SystemFeatures have many containment relations ship to : DataPort, EventPort, EventDataPort.

In need to create a System in which I create DataPort, EventPort, EventDataPort, So how can I do to create directly DataPort, EventPort, EventDataPort and SystemFeatures will be created automatically?

Thanks.
Re: Create a child Reference automatically when I create an child contained in the first one [message #664113 is a reply to message #664094] Thu, 07 April 2011 14:04 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Look for a class called SystemFeaturesCreateCommand and add your code there ..
Re: Create a child Reference automatically when I create an child contained in the first one [message #664116 is a reply to message #664113] Thu, 07 April 2011 14:22 Go to previous message
Rahma  is currently offline Rahma Friend
Messages: 7
Registered: February 2011
Junior Member
Thanks for your answer,

But I'am a beginner , So I don't know what I should add to SystemFeaturesCreateCommand class.

In the gmfmap: I have


<domainMetaElement
href="component.ecore#//SystemType"/>
<domainInitializer
xsi:type="gmfmap:FeatureSeqInitializer">
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EAttribute"
href="core.ecore#//NamedElement/name"/>
<value
body=" 'SystemType'&#xD;&#xA;"/>
</initializers>
</domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping">
<diagramLabel
href="My.gmfgraph#SystemTypeName"/>
<features
href="core.ecore#//NamedElement/name"/>
<editableFeatures
href="core.ecore#//NamedElement/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="My.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="My.gmfgraph#SystemType"/>
<children>
<containmentFeature
href="component.ecore#//SystemType/features"/>
<ownedChild>
<domainMetaElement
href="feature.ecore#//SystemFeatures"/>
<tool
xsi:type="gmftool:CreationTool"
href="My.gmftool#//@palette/@tools.4/@tools.0"/>
<diagramNode
href="Features.gmfgraph#Features"/>
<children>
<containmentFeature
href="feature.ecore#//SoftwareFeatures/dataPort"/>
<ownedChild>
<domainMetaElement
href="feature.ecore#//DataPort"/>
<domainInitializer
xsi:type="gmfmap:FeatureSeqInitializer">
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EAttribute"
href="feature.ecore#//Port/direction"/>
<value
body="PortDirection::IN"/>
</initializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EAttribute"
href="core.ecore#//NamedElement/name"/>
<value
body=" 'InDataPort'&#xD;&#xA;"/>
</initializers>
</domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping">
<diagramLabel
href="Features.gmfgraph#InDataPortName"/>
<features
href="core.ecore#//NamedElement/name"/>
<editableFeatures
href="core.ecore#//NamedElement/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="My.gmftool#//@palette/@tools.4/@tools.1"/>
<diagramNode
href="Features.gmfgraph#InDataPort"/>
</ownedChild>
</children>
</ownedChild>
</children>
</ownedChild>
</nodes>


I don't know what I do in the gmafmap for SystemFeatures under SystemType Top Node Reference.

Please Help me.
thanks.

Previous Topic:Create a child Reference automatically when I create an child contained in the first one
Next Topic:NsLock issue
Goto Forum:
  


Current Time: Fri Sep 20 12:06:45 GMT 2024

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

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

Back to the top