table viewer and possibility to change columns header [message #333671] |
Mon, 22 December 2008 10:22  |
Eclipse User |
|
|
|
Hi all,
I have got a table which displays a list of items ...
now I would like to re-use the same table to display list items of different
nature ...
I mean ...
table viewer 1 [ column A B C D E ]
table viewer 2 [ column E F G H ]
now what is the best approach to achieve this?
I can use different views and enable every time the one I need (but this
mean having double table, double provider(s))
is there anyway to change at runtime the table column header (sure the
providers could make the difference depending on the input element)
Thanks
Kar
|
|
|
|
|
Re: table viewer and possibility to change columns header [message #333832 is a reply to message #333819] |
Wed, 07 January 2009 17:11   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
On 1/7/2009 10:13 AM, Kar wrote:
> Yes indeed ....
> don't know why I was even trying to do this ...
>
> one ore question ... what is the best layout to use for doing this kind
> of replacement ...
> I mean I need to have one container that will display the table and
> depending on the event I have to switch to the second table ...
org.eclipse.swt.custom.StackLayout is exactly what you want. See the
example code in the class Javadoc.
Hope this helps,
Eric
> "Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
> news:giqt6i$7bi$1@build.eclipse.org...
>> On 12/22/2008 10:22 AM, Kar wrote:
>>> Hi all,
>>> I have got a table which displays a list of items ...
>>>
>>> now I would like to re-use the same table to display list items of
>>> different nature ...
>>>
>>> I mean ...
>>>
>>> table viewer 1 [ column A B C D E ]
>>> table viewer 2 [ column E F G H ]
>>>
>>> now what is the best approach to achieve this?
>>> I can use different views and enable every time the one I need (but this
>>> mean having double table, double provider(s))
>>>
>>> is there anyway to change at runtime the table column header (sure the
>>> providers could make the difference depending on the input element)
>>
>> There is probably a way to to it by some column size manipulation (you
>> can "hide" a column by settings its size/width to 0), but I don't see
>> a compelling reason not to use two separate table viewers. There is
>> really no significant resource usage unless you have LOTS of viewers
>> or LOTS of rows or LOTS of columns (by LOTS I mean hundreds or
>> thousands).
>> It really seems like a much simpler solution than trying to manipulate
>> the columns; I always strive for small, simple classes that do one
>> thing well, rather than complex ones that try to do a lot.
>>
>> Hope this helps,
>> Eric
>
|
|
|
Re: table viewer and possibility to change columns header [message #333839 is a reply to message #333832] |
Thu, 08 January 2009 04:45  |
Eclipse User |
|
|
|
Thanks Eric
:-)
"Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
news:gk39b7$jsp$1@build.eclipse.org...
> On 1/7/2009 10:13 AM, Kar wrote:
>> Yes indeed ....
>> don't know why I was even trying to do this ...
>>
>> one ore question ... what is the best layout to use for doing this kind
>> of replacement ...
>> I mean I need to have one container that will display the table and
>> depending on the event I have to switch to the second table ...
>
> org.eclipse.swt.custom.StackLayout is exactly what you want. See the
> example code in the class Javadoc.
>
> Hope this helps,
> Eric
>
>
>
>> "Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
>> news:giqt6i$7bi$1@build.eclipse.org...
>>> On 12/22/2008 10:22 AM, Kar wrote:
>>>> Hi all,
>>>> I have got a table which displays a list of items ...
>>>>
>>>> now I would like to re-use the same table to display list items of
>>>> different nature ...
>>>>
>>>> I mean ...
>>>>
>>>> table viewer 1 [ column A B C D E ]
>>>> table viewer 2 [ column E F G H ]
>>>>
>>>> now what is the best approach to achieve this?
>>>> I can use different views and enable every time the one I need (but
>>>> this
>>>> mean having double table, double provider(s))
>>>>
>>>> is there anyway to change at runtime the table column header (sure the
>>>> providers could make the difference depending on the input element)
>>>
>>> There is probably a way to to it by some column size manipulation (you
>>> can "hide" a column by settings its size/width to 0), but I don't see
>>> a compelling reason not to use two separate table viewers. There is
>>> really no significant resource usage unless you have LOTS of viewers
>>> or LOTS of rows or LOTS of columns (by LOTS I mean hundreds or
>>> thousands).
>>> It really seems like a much simpler solution than trying to manipulate
>>> the columns; I always strive for small, simple classes that do one
>>> thing well, rather than complex ones that try to do a lot.
>>>
>>> Hope this helps,
>>> Eric
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03762 seconds