Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Display properties of an eObject (EMF)
icon5.gif  Display properties of an eObject (EMF) [message #683651] Tue, 14 June 2011 07:32 Go to next message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
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 08:43 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
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 09:35 Go to previous messageGo to next message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
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 16:07 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
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 17:03 Go to previous messageGo to next message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
Thank you!!
Re: Display properties of an eObject (EMF) [message #687199 is a reply to message #683651] Tue, 14 June 2011 13:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Display properties of an eObject (EMF) [message #687605 is a reply to message #687199] Wed, 22 June 2011 20:19 Go to previous messageGo to next message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
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] Thu, 23 June 2011 02:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Display properties of an eObject (EMF) [message #1707981 is a reply to message #687605] Fri, 11 September 2015 08:06 Go to previous message
Guilhem Dross is currently offline Guilhem DrossFriend
Messages: 2
Registered: June 2015
Junior Member
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: Thu Apr 25 11:16:17 GMT 2024

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

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

Back to the top