ColumnLabelProvider reusable ? [message #333821] |
Wed, 07 January 2009 16:15 |
Eclipse User |
|
|
|
Originally posted by: rune.molin.cph.dk
I was looking into how to provide a tooltip for an entire row in a
tableviewer for an RCP app i'm working on when I came across the new
(as of 3.3) API of ColumnLabelProvider, TableViewerColumn etc.
Google found me some articles explaining why this is a good thing
because you could reuse a labelprovider, for example like this:
public class StockValueProvider extends ColumnLabelProvider {
@Override
public String getText(Object element) {
return ((Stock)element).modification.doubleValue() + "%";
}
Now, what I don't get is why this is supposed to be reusable in any
relevant way - The way I see it, the only case you can use this
StockValueProvider is when you have a public "modification" attribute in
a Stock class. What if this modification attribute is a member of
another class, but I still want it displayed with a percentage sign
appended. Then I write another label provider ? Am I missing something
obvious here ?
So anyway, how do you implement a tooltip that pertains to the entire
row, and not just one column :0)
-- Cheers
Rune Molin
Software Developer
Copenhagen Airports
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05017 seconds