|
Re: Best practice: how to get the row of a table colored [message #438608 is a reply to message #438566] |
Mon, 28 June 2004 17:13 |
Jean-Christophe Deprez Messages: 133 Registered: July 2009 |
Senior Member |
|
|
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 6/27/2004, 3:37:18 PM, ak_71@libero.it (Davide) wrote regarding Best
practice: how to get the row of a table colored:
As is all too common in Eclipse there is an instanceof
check that gives you what you want instead of something
visible in the API.
In this case it is an instanceof check in TableViewer
that checks to see if your IContentProvider is an
instanceof IColorProvider, and if it is, calls
getForeground and getBackground. When it
calls them it passes the element which in the
case of a Table should be your row object.
-- d
> I have read tons of messages in the newsgroup for
> this topic, but unfortunately I still haven't found
> an handy approach. I'd like to accomplish this from
> the JFace TableViewer level, w/o having to dive
> to the underling Table instance to to get the list
> of TableItem(s) and colore them and then show the table
> because this does not address the problem of coloring
> the rows added to the table *after* it had been shown.
> Another suggested approach was again to get tableitem,
> then add a specific class as the paint listener (get the canvas...).
> but I think this is anyway not elegant, for the same reasons.
> In the API there is the IColorProvider interface:
> can we add the instance of a class implementing it somehow (as the
> LabelProvider and ContentProvider are added) to the TableViewer?
> This could solve any problem at once and e very valuable in
> application design where you build over TableViewer your
> own complicated, custom viever, yet keep it configurable for
> the disparate business objects plugging into it the specific
> Label, Content, Color and whatever provider classes
> Any hints?
> best regards
|
|
|
Re: Best practice: how to get the row of a table colored [message #438923 is a reply to message #438608] |
Sat, 03 July 2004 22:15 |
Eclipse User |
|
|
|
Originally posted by: ak_71.libero.it
hi nobody, thanks for your answer.
How the hell did you get this? did you dive into the whole
tableviewer code?
Other nice things like this?
Sani
d.
nobody@nowhere.com wrote:
> >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> On 6/27/2004, 3:37:18 PM, ak_71@libero.it (Davide) wrote regarding Best
> practice: how to get the row of a table colored:
> As is all too common in Eclipse there is an instanceof
> check that gives you what you want instead of something
> visible in the API.
> In this case it is an instanceof check in TableViewer
> that checks to see if your IContentProvider is an
> instanceof IColorProvider, and if it is, calls
> getForeground and getBackground. When it
> calls them it passes the element which in the
> case of a Table should be your row object.
> -- d
> > I have read tons of messages in the newsgroup for
> > this topic, but unfortunately I still haven't found
> > an handy approach. I'd like to accomplish this from
> > the JFace TableViewer level, w/o having to dive
> > to the underling Table instance to to get the list
> > of TableItem(s) and colore them and then show the table
> > because this does not address the problem of coloring
> > the rows added to the table *after* it had been shown.
> > Another suggested approach was again to get tableitem,
> > then add a specific class as the paint listener (get the canvas...).
> > but I think this is anyway not elegant, for the same reasons.
> > In the API there is the IColorProvider interface:
> > can we add the instance of a class implementing it somehow (as the
> > LabelProvider and ContentProvider are added) to the TableViewer?
> > This could solve any problem at once and e very valuable in
> > application design where you build over TableViewer your
> > own complicated, custom viever, yet keep it configurable for
> > the disparate business objects plugging into it the specific
> > Label, Content, Color and whatever provider classes
> > Any hints?
> > best regards
|
|
|
Powered by
FUDForum. Page generated in 0.02830 seconds