|
Re: table viewer and possibility to change columns header [message #333690 is a reply to message #333671] |
Tue, 23 December 2008 14:39 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
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 #333832 is a reply to message #333819] |
Wed, 07 January 2009 22:11 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 09:45 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Carmelo ![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=carmeloscala%40hotmail.com) Messages: 224 Registered: July 2009 |
Senior Member |
|
|
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.04255 seconds