Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Show model attributes as rows in a table/tree(How is it possible to get a table viewer that shows one row per attribute?)
icon5.gif  EMF Show model attributes as rows in a table/tree [message #664028] Thu, 07 April 2011 08:49 Go to next message
Martin Domig is currently offline Martin DomigFriend
Messages: 12
Registered: August 2010
Junior Member
Hello

I'm quite new to EMF and don't know my way around here, so sorry if this question has been answered before - I couldn't find it using the keyword search.

Lets suppose I have a model class "Configuration" with ~15 attributes. The class also contains references to "SubConfiguration" classes, also ~15 attributes each.

Now, I know how to use the generated edit code to create a table/tree viewer with ~15 columns for a table viewer: put 15 columns in a table viewer and implement getColumnImage() / getColumnText() in the respective item providers.

But - a table with 15 columns is all but fun to work with. I would like to get a tree with 2 columns, attribute name in the first and value in the second column.

How can I get a content provider that takes the EMF classes and returns its attributes as children? Do I have to write it myself or is there some implementation in EMF that is either ready to use or can be generated?

Thanks!
Re: EMF Show model attributes as rows in a table/tree [message #664128 is a reply to message #664028] Thu, 07 April 2011 14:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30546
Registered: July 2009
Senior Member
Martin,

Via the GenFeature of the GenModel you can instruct the generator (via
the Children property) to support attributes as children, so that would
be a starting point at least...


Martin Domig wrote:
> Hello
>
> I'm quite new to EMF and don't know my way around here, so sorry if
> this question has been answered before - I couldn't find it using the
> keyword search.
>
> Lets suppose I have a model class "Configuration" with ~15 attributes.
> The class also contains references to "SubConfiguration" classes, also
> ~15 attributes each.
>
> Now, I know how to use the generated edit code to create a table/tree
> viewer with ~15 columns for a table viewer: put 15 columns in a table
> viewer and implement getColumnImage() / getColumnText() in the
> respective item providers.
>
> But - a table with 15 columns is all but fun to work with. I would
> like to get a tree with 2 columns, attribute name in the first and
> value in the second column.
>
> How can I get a content provider that takes the EMF classes and
> returns its attributes as children? Do I have to write it myself or is
> there some implementation in EMF that is either ready to use or can be
> generated?
>
> Thanks!
Previous Topic:[CDO] Locking in CDO 3 and 4
Next Topic:Global EMF Registry
Goto Forum:
  


Current Time: Wed Oct 16 12:46:29 GMT 2019

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

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

Back to the top