Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF limitation, a bug, or is it me?
GMF limitation, a bug, or is it me? [message #120989] Fri, 20 April 2007 10:24 Go to next message
Eclipse UserFriend
GMF experts -

If I alter the mindmap example slightly so that the features for a links source/target do not exist
in an immediate child class of the Map element then I cannot get a mapping of a link. Is this a
limitation (seems bad if that is that case), a bug or am I just not understanding what I'm doing.
Thanks in advance for any help (including how/if I can hand code around it if it were a limitation).

Original mindmap element hierarchy:
<mindmap:map title="" >
<rootTopics >
<comments >
<items />
</comments>
</rootTopics>
<relations label="" source="http://tempuri.org" target="http://tempuri.org" type="DEPENDENCY"/>
<resources />
</mindmap:map>

Modified hierarchy where source/target features have an additional parent element:
<mindmap:map >
<rootTopics >
<comments >
<items />
</comments>
</rootTopics>
<relations >
<Connection label="" source="http://tempuri.org" target="http://tempuri.org" type="DEPENDENCY"/>
</relations>
<resources />
</mindmap:map>


Here are a couple simple tweaks I made to the mindmap.xsd that demonstrate the problem.

I changed the type of the relations to insert a new element:
<xsd:complexType name="Map">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="rootTopics" type="mindmap:Topic"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="relations" type="mindmap:LinkParent"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="resources" type="mindmap:Resource"/>
</xsd:sequence>
<xsd:attribute name="title" type="xsd:string"/>
</xsd:complexType>

LinkParent looks like this (type mindmap:Relationship is unchanged):
<xsd:complexType name="LinkParent">
<xsd:sequence>
<xsd:element minOccurs="1" name="SomeElement"/>
<xsd:element minOccurs="1" name="Connection" type="mindmap:Relationship"/>
</xsd:sequence>
<xsd:attribute name="about" type="xsd:string"/>
</xsd:complexType>

With those minor changes and the following link mapping, I cannot make connections using the
connection tool (GMF 2.0) as the cursor never changes to show connections are allowed to a topic.
The containmentFeature element (connection) is not an immediate child of the Map as is the case for
the original relations element - this is what I see as being different.

<links>
<domainMetaElement
href="mindmap.ecore#//Relationship"/>
<containmentFeature
href="mindmap.ecore#//LinkParent/connection"/>
<tool
xsi:type="gmftool:CreationTool"
href="mindmap.gmftool#//@palette/@tools.1/@tools.1"/>
<diagramLink
href="mindmap.gmfgraph#RelationshipLink"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="mindmap.ecore#//Relationship/source"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="mindmap.ecore#//Relationship/target"/>
</links>
Re: GMF limitation, a bug, or is it me? [message #121268 is a reply to message #120989] Mon, 23 April 2007 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hello Mark,

Looks like this problem is covered in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=146535

-----------------
Alex Shatalin
Re: GMF limitation, a bug, or is it me? [message #121523 is a reply to message #120989] Tue, 24 April 2007 08:59 Go to previous message
Eclipse UserFriend
Mark,

Check
TopicItemSemanticEditPolicy#getCreate[Start|Complete][Incomi ng|Outgoing]RelationshipCommand()
methods. There are uses of getRelationshipContainer() method that detects
owner of the link (not Map, but Relations in your example). Also,
Relationship[*]TypeLinkCreateCommand may be of interest, especially
super.doDefaultElementCreation() together with getContainmentFeature() and
getElementToEdit() methods. You'll need to tweak this code to use your
intermediate container.

The reasons why we can't do it for you are described in the bugzilla pointed
out by Alex. Briefly, we don't know whether we should create this container
or to expect it to be there, and how to handle cases with multiple possible
containers.


Artem


"Mark" <brodhun@us.ibm.com> wrote in message
news:f0aiem$3k0$1@build.eclipse.org...
> GMF experts -
>
> If I alter the mindmap example slightly so that the features for a links
> source/target do not exist in an immediate child class of the Map element
> then I cannot get a mapping of a link. Is this a limitation (seems bad if
> that is that case), a bug or am I just not understanding what I'm doing.
> Thanks in advance for any help (including how/if I can hand code around it
> if it were a limitation).
>
> Original mindmap element hierarchy:
> <mindmap:map title="" >
> <rootTopics >
> <comments >
> <items />
> </comments>
> </rootTopics>
> <relations label="" source="http://tempuri.org"
> target="http://tempuri.org" type="DEPENDENCY"/>
> <resources />
> </mindmap:map>
>
> Modified hierarchy where source/target features have an additional parent
> element:
> <mindmap:map >
> <rootTopics >
> <comments >
> <items />
> </comments>
> </rootTopics>
> <relations >
> <Connection label="" source="http://tempuri.org"
> target="http://tempuri.org" type="DEPENDENCY"/>
> </relations>
> <resources />
> </mindmap:map>
>
>
> Here are a couple simple tweaks I made to the mindmap.xsd that demonstrate
> the problem.
>
> I changed the type of the relations to insert a new element:
> <xsd:complexType name="Map">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="rootTopics"
> type="mindmap:Topic"/>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="relations"
> type="mindmap:LinkParent"/>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="resources"
> type="mindmap:Resource"/>
> </xsd:sequence>
> <xsd:attribute name="title" type="xsd:string"/>
> </xsd:complexType>
>
> LinkParent looks like this (type mindmap:Relationship is unchanged):
> <xsd:complexType name="LinkParent">
> <xsd:sequence>
> <xsd:element minOccurs="1" name="SomeElement"/>
> <xsd:element minOccurs="1" name="Connection"
> type="mindmap:Relationship"/>
> </xsd:sequence>
> <xsd:attribute name="about" type="xsd:string"/>
> </xsd:complexType>
>
> With those minor changes and the following link mapping, I cannot make
> connections using the connection tool (GMF 2.0) as the cursor never
> changes to show connections are allowed to a topic. The containmentFeature
> element (connection) is not an immediate child of the Map as is the case
> for the original relations element - this is what I see as being
> different.
>
> <links>
> <domainMetaElement
> href="mindmap.ecore#//Relationship"/>
> <containmentFeature
> href="mindmap.ecore#//LinkParent/connection"/>
> <tool
> xsi:type="gmftool:CreationTool"
> href="mindmap.gmftool#//@palette/@tools.1/@tools.1"/>
> <diagramLink
> href="mindmap.gmfgraph#RelationshipLink"/>
> <sourceMetaFeature
> xsi:type="ecore:EReference"
> href="mindmap.ecore#//Relationship/source"/>
> <linkMetaFeature
> xsi:type="ecore:EReference"
> href="mindmap.ecore#//Relationship/target"/>
> </links>
Previous Topic:problem opening a new editor on double click
Next Topic:Propsheet : How to integrate the plugin propsheet in my model
Goto Forum:
  


Current Time: Tue Jul 22 14:42:20 EDT 2025

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

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

Back to the top