|
|
Re: Dynamic table view [message #495206 is a reply to message #494994] |
Wed, 04 November 2009 07:42 |
Dirk Hoffmann 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
|
|
|
Powered by
FUDForum. Page generated in 0.04126 seconds