Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ColumnLabelProvider reusable ?
ColumnLabelProvider reusable ? [message #333821] Wed, 07 January 2009 11:15 Go to previous message
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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:to Platform Debug experts
Next Topic:Feature not displayed
Goto Forum:
  


Current Time: Sat May 25 14:29:32 EDT 2013

Powered by FUDForum. Page generated in 0.02063 seconds