Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Dynamic table view
Dynamic table view [message #494791] Mon, 02 November 2009 16:37 Go to next message
Dirk Hoffmann is currently offline Dirk HoffmannFriend
Messages: 163
Registered: July 2009
Senior Member
Hi,

the generated multipage editor provides a table view on the data.

The generated example just shows a single column with just the children
of the object selected in the outline view.

We want to customize the editor so that it gets the properties of the
children, takes their names as the names of the table columns and their
values as the contents of the table body. That means the table view
needs to change whenever the selection changes to an object of a
different type. E.g if the selection is on "Employees" and shows a table
with the information about all the company's employees and then the user
selects "Suppliers" the table needs to change so that ist shows the
company's suppliers. Changing the table means changing the number of
columns, their labels and of course the input data.

Does somebody have an idea how to achieve that? At which level would I
have to replace some objects. Dispose of the ViewerPane and create a new
one, the TableViewer, the Table, or just its columns?

Any help much appreciated.

Best Regards,
Dirk
Re: Dynamic table view [message #494994 is a reply to message #494791] Tue, 03 November 2009 13:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Dirk,

Note that you might find PropertyColumnLabelProvider quite useful in
that it supports a column that's effectively the same as the cell in the
property editor for that same property. More comments below.


Dirk Hoffmann wrote:
> Hi,
>
> the generated multipage editor provides a table view on the data.
>
> The generated example just shows a single column with just the
> children of the object selected in the outline view.
>
> We want to customize the editor so that it gets the properties of the
> children, takes their names as the names of the table columns and
> their values as the contents of the table body. That means the table
> view needs to change whenever the selection changes to an object of a
> different type. E.g if the selection is on "Employees" and shows a
> table with the information about all the company's employees and then
> the user selects "Suppliers" the table needs to change so that ist
> shows the company's suppliers. Changing the table means changing the
> number of columns, their labels and of course the input data.
>
> Does somebody have an idea how to achieve that?
You'd have to repeat the same type of logic that's used to set up the
initial view each time you update the input to the view.
> At which level would I have to replace some objects. Dispose of the
> ViewerPane and create a new one, the TableViewer, the Table, or just
> its columns?
I think you just need to dispose the columns and create new ones.
>
> Any help much appreciated.
>
> Best Regards,
> Dirk


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Dynamic table view [message #495206 is a reply to message #494994] Wed, 04 November 2009 07:42 Go to previous message
Dirk Hoffmann is currently offline Dirk HoffmannFriend
Messages: 163
Registered: July 2009
Senior Member
Ed,

thanks for the fast reply, more below (mostly to help those facing
similar problems):

Ed Merks schrieb:
> Dirk,
>
> Note that you might find PropertyColumnLabelProvider quite useful in
Yes I found that - unfortunately not in version 2.2
> that it supports a column that's effectively the same as the cell in the
> property editor for that same property. More comments below.
>
>
> Dirk Hoffmann wrote:
>> Hi,
>>
>> the generated multipage editor provides a table view on the data.
>>
>> The generated example just shows a single column with just the
>> children of the object selected in the outline view.
>>
>> We want to customize the editor so that it gets the properties of the
>> children, takes their names as the names of the table columns and
>> their values as the contents of the table body. That means the table
>> view needs to change whenever the selection changes to an object of a
>> different type. E.g if the selection is on "Employees" and shows a
>> table with the information about all the company's employees and then
>> the user selects "Suppliers" the table needs to change so that ist
>> shows the company's suppliers. Changing the table means changing the
>> number of columns, their labels and of course the input data.
>>
>> Does somebody have an idea how to achieve that?
> You'd have to repeat the same type of logic that's used to set up the
> initial view each time you update the input to the view.
Yes, the code that now updates the table view went to the
handleContentOutlineSelection method.
>> At which level would I have to replace some objects. Dispose of the
>> ViewerPane and create a new one, the TableViewer, the Table, or just
>> its columns?
> I think you just need to dispose the columns and create new ones.
I'm glad you think so, 'cause that's how we went about. Its just not so
easy to change the columns of a table doing it the first time. But we
got it going in the end. One crucial step is to explicitely set the
widths of the new columns so they become visible. The TableLayout
doesn't do so. Me and my colleagues are often having hard times with SWT
getting changes to the surface (Of course that hasn't anything to do
with EMF).
>>
>> Any help much appreciated.
>>
>> Best Regards,
>> Dirk
Previous Topic:[CDO] metamodel evolution
Next Topic:EMF Model Creation Wizard broken / no finish button
Goto Forum:
  


Current Time: Thu Apr 25 01:51:24 GMT 2024

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

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

Back to the top