Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Link between GMF Figure and EMF Node, Properties provisionning
Link between GMF Figure and EMF Node, Properties provisionning [message #217494] Fri, 06 February 2009 14:20 Go to next message
Rodolphe Beck is currently offline Rodolphe BeckFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

I have two problems with my modeler :

First, I need to export my diagram into a custom xml file format. I
found how to do it by recovering the list of items composing my diagram
and serializing them using XStream.

My diagram is like the following :
http://img132.imageshack.us/my.php?image=conceptsdp4.png

A concept can be linked to one or more concepts, or to one of more items

When I generate my xml export though, it generates that :
<?xml version="1.0" encoding="UTF-8"?>
<pivot>
<concept nom="Concept">
<item nom="Test">
<item nom="Test 2"/>
</item>
</concept>
<concept nom="Concept 0">
<concept nom="Concept">
<item nom="Test">
<item nom="Test 2"/>
</item>
</concept>
</concept>
</pivot>

What I want to do is to generate the part that corresponds to the
selected concept only. How can y translate my ConceptEditPart object
(the one I get in my selectionChanged method) into the corresponding
EObject ?

Second question :
My 'items' have a 'name' property, what I want to do is to allow the
user to create one the regular way ie with the tool palette and by
providing a name, but I want him to be able to pick an existing name
from a database.

Here again, I know how to retrieve the data from a datasource (excel
file, db2 database...) I imagine I will have to modify the ItemEditPart
class to include a dropdown... But I don't know what to use : the name
label is currently a WrappingLabel, is there a class that acts like a
dropdown ? Or maybe in the properties view of the figure ? Or do it myself ?

Thanks for your answers.
Re: Link between GMF Figure and EMF Node, Properties provisionning [message #217501 is a reply to message #217494] Fri, 06 February 2009 14:22 Go to previous messageGo to next message
Rodolphe Beck is currently offline Rodolphe BeckFriend
Messages: 18
Registered: July 2009
Junior Member
Le 06/02/2009 15:20, Rodolphe Beck a écrit :
> Hi,
>
> I have two problems with my modeler :
>
> First, I need to export my diagram into a custom xml file format. I
> found how to do it by recovering the list of items composing my diagram
> and serializing them using XStream.
>
> My diagram is like the following :
> http://img132.imageshack.us/my.php?image=conceptsdp4.png
>
> A concept can be linked to one or more concepts, or to one of more items
>
> When I generate my xml export though, it generates that :
> <?xml version="1.0" encoding="UTF-8"?>
> <pivot>
> <concept nom="Concept">
> <item nom="Test">
> <item nom="Test 2"/>
> </item>
> </concept>
> <concept nom="Concept 0">
> <concept nom="Concept">
> <item nom="Test">
> <item nom="Test 2"/>
> </item>
> </concept>
> </concept>
> </pivot>
>
> What I want to do is to generate the part that corresponds to the
> selected concept only. How can y translate my ConceptEditPart object
> (the one I get in my selectionChanged method) into the corresponding
> EObject ?
>
> Second question :
> My 'items' have a 'name' property, what I want to do is to allow the
> user to create one the regular way ie with the tool palette and by
> providing a name, but I want him to be able to pick an existing name
> from a database.
>
> Here again, I know how to retrieve the data from a datasource (excel
> file, db2 database...) I imagine I will have to modify the ItemEditPart
> class to include a dropdown... But I don't know what to use : the name
> label is currently a WrappingLabel, is there a class that acts like a
> dropdown ? Or maybe in the properties view of the figure ? Or do it
> myself ?
>
> Thanks for your answers.

Ok I saw the Post about dropdowns below...
Re: Link between GMF Figure and EMF Node, Properties provisionning [message #217633 is a reply to message #217494] Fri, 06 February 2009 17:42 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Rodolphe,

> selected concept only. How can y translate my ConceptEditPart object
> (the one I get in my selectionChanged method) into the corresponding
> EObject ?
Try calling ConceptEditPart.getNotationView().getElement() to get domain
model element from the selected EditPart instance.

-----------------
Alex Shatalin
Re: Link between GMF Figure and EMF Node, Properties provisionning [message #218441 is a reply to message #217633] Thu, 12 February 2009 11:53 Go to previous message
Rodolphe Beck is currently offline Rodolphe BeckFriend
Messages: 18
Registered: July 2009
Junior Member
Le 06/02/2009 18:42, Alex Shatalin a écrit :
> Hello Rodolphe,
>
>> selected concept only. How can y translate my ConceptEditPart object
>> (the one I get in my selectionChanged method) into the corresponding
>> EObject ?
> Try calling ConceptEditPart.getNotationView().getElement() to get domain
> model element from the selected EditPart instance.
>
> -----------------
> Alex Shatalin
>
>
Thanks !
Previous Topic:Preventing Selection of Diagram Elements
Next Topic:Connection disappears when figures moved apart
Goto Forum:
  


Current Time: Thu Mar 04 13:34:55 GMT 2021

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

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

Back to the top