Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to use attributes of referenced objects as labels
How to use attributes of referenced objects as labels [message #526548] Mon, 12 April 2010 08:41 Go to next message
Eclipse UserFriend
Originally posted by: mikekilo.gmx.de

Hey friends,

i am new to gmf and have a problem i could neither solve with the
newsgroup archive nor with the power of google.
Lets expect that there are two classes A and B.
B has an attribute called "name". A has a reference to one object of B.

What i want (in the graphical editor) is a label on object/node a, where
the user is able to see/set the name of the referenced object b.Maybe
one of you can give me a hint what part i missed in the gmfgraph or
gmfmap file.

Many thanks in advance for your help.

Matthias
Re: How to use attributes of referenced objects as labels [message #526582 is a reply to message #526548] Mon, 12 April 2010 11:02 Go to previous messageGo to next message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
Hello Matthias,

One simple way would be to create a Compartment for the referenced element
and display only the name in a no-border-rectangle in a node.

An other way would be to introduce a derived property in your model and
calculate the value from the child object. You need to notify adapters on
reference changes. @see
http://wiki.eclipse.org/EMF/Recipes#Recipe:_Derived_Attribut e_Notifier

A third way would be to change the generated GMF code.

Enrico

"Matthias Kloppenborg" <mikekilo@gmx.de> schrieb im Newsbeitrag
news:hpumdm$l7q$1@build.eclipse.org...
> Hey friends,
>
> i am new to gmf and have a problem i could neither solve with the
> newsgroup archive nor with the power of google.
> Lets expect that there are two classes A and B.
> B has an attribute called "name". A has a reference to one object of B.
>
> What i want (in the graphical editor) is a label on object/node a, where
> the user is able to see/set the name of the referenced object b.Maybe
> one of you can give me a hint what part i missed in the gmfgraph or
> gmfmap file.
>
> Many thanks in advance for your help.
>
> Matthias
Re: How to use attributes of referenced objects as labels [message #526592 is a reply to message #526582] Mon, 12 April 2010 11:37 Go to previous message
Eclipse UserFriend
Originally posted by: mikekilo.gmx.de

Hello Enrico,

thanks for your help. I think i will try the first solution. Can you
provide me with more resources about compartments?
I read several GMF Tutorials, but I dont feel comfortable with the
informations which are given there. Need more input. ;)

Matthias
Previous Topic:"A handler conflict occurred.  This may disable some commands."
Next Topic:IP Dok
Goto Forum:
  


Current Time: Sun Jul 22 12:47:17 GMT 2018

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

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

Back to the top