Skip to main content



      Home
Home » Modeling » EMF » Display properties of an eObject (EMF)
icon5.gif  Display properties of an eObject (EMF) [message #683651] Tue, 14 June 2011 03:32 Go to next message
Eclipse UserFriend
Hello everybody,

I built a treeviewer containing eObject elements (in fact, the treeviewer contains DiffElement elements, a class I created. This DiffElement contains an eObject).

I would like to display properties (in the properties view) of the eObject (of the DiffElement) I select in the tree.

Do my DiffElement have to implement IPropertySource?
And how I have to proceed?

Thanks very much!
Re: Display properties of an eObject (EMF) [message #683685 is a reply to message #683651] Tue, 14 June 2011 04:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi Renaud,

You can check how the sample ecore reflective editor works.
Selection of any element gets shows the properies of that in the properties view.

Plus the edit framework generates the property sources for you.You need not do anything here.

cheers,
Saurav
Re: Display properties of an eObject (EMF) [message #683711 is a reply to message #683685] Tue, 14 June 2011 05:35 Go to previous messageGo to next message
Eclipse UserFriend
I have a listener on the tree that allows me to do operations on the DiffElement selected, but I don't really konw how to get properties of the eObject (attribute of this DiffElement), and display it in the properties view?

Sorry for my poor knowledge of this part of Java and EMF.

Thanks!
Re: Display properties of an eObject (EMF) [message #683900 is a reply to message #683711] Tue, 14 June 2011 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi Renaud,

This article will surely help you.

http://www.eclipse.org/articles/Article-Properties-View/properties-view.html

cheers,
Saurav
Re: Display properties of an eObject (EMF) [message #683926 is a reply to message #683900] Tue, 14 June 2011 13:03 Go to previous messageGo to next message
Eclipse UserFriend
Thank you!!
Re: Display properties of an eObject (EMF) [message #687199 is a reply to message #683651] Tue, 14 June 2011 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Renaud,

Comments below.

Renaud C wrote:
> Hello everybody,
>
> I built a treeviewer containing eObject elements (in fact, the
> treeviewer contains DiffElement elements, a class I created. This
> DiffElement contains an eObject).
By contains do you mean a containment reference?
>
> I would like to display properties (in the properties view) of the
> eObject (of the DiffElement) I select in the tree.
So the EObject itself isn't displayed in the tree but rather it's a
non-containment reference displayed in the properties view?
>
> Do my DiffElement have to implement IPropertySource?
> And how I have to proceed?
Have a look at
GenBaseItemProvider.GenItemPropertyDescriptor.createPropertyValueWrapper.
That's what makes properties of the GenModel in the Generator that are
references to the Ecore model have a little + to be able to expand the
properties of the Ecore model
>
> Thanks very much!
Re: Display properties of an eObject (EMF) [message #687605 is a reply to message #687199] Wed, 22 June 2011 16:19 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the answer!

The EObject is an attribute of my DiffElement.
Actually, my class DiffElement implements the IPropertySource, and simply, I have to used methods from the IPropertySource, and everything is ok!

Thanks for your help!
If someone want more details about how I proceeded, don't hesitate to ask me!

See you,

Renaud
Re: Display properties of an eObject (EMF) [message #687688 is a reply to message #687605] Wed, 22 June 2011 22:34 Go to previous messageGo to next message
Eclipse UserFriend
Renaud,

Yes implementing IPropertySource would do the trick too (because then an
adapter isn't needed). It's just that most folks don't want to mix such
UI things into their model implementation...


Renaud C wrote:
> Thanks for the answer!
>
> The EObject is an attribute of my DiffElement.
> Actually, my class DiffElement implements the IPropertySource, and
> simply, I have to used methods from the IPropertySource, and
> everything is ok!
>
> Thanks for your help!
> If someone want more details about how I proceeded, don't hesitate to
> ask me!
>
> See you,
>
> Renaud
Re: Display properties of an eObject (EMF) [message #1707981 is a reply to message #687605] Fri, 11 September 2015 04:06 Go to previous message
Eclipse UserFriend
Hi Renaud,

I would be interested to know how you did in details ; indeed I have exactly the same implementation as you have (TreeObject elements for a TreeViewer, containing EObjects).

I implemented IPropertySource, but was not able to display dynamically the properties of each EObject.

Thank you,

Guilhem
Previous Topic:JavaFX Sample Application not working
Next Topic:Two Packages in Ecore model and their relation
Goto Forum:
  


Current Time: Tue Jul 01 00:57:23 EDT 2025

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

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

Back to the top