Alternate row coloring in Grid [message #52227] |
Wed, 30 April 2008 15:39 |
Eclipse User |
|
|
|
Originally posted by: edwin.park.rbccm.com
Hi,
I want to render a nebula grid with an alternating background color to
improve visibility. There is an example snippet which does this, but it
does this by embedding the row count into the row element. This is a
problem for me because I want the model to be sortable, and when I sort
the row elements the row indexes get scrambled. I'd rather not have to
modify every row in my model with new indexes every time I sort,
especially given that the row index is already known to the grid when it
is rendering itself. The difficulty is that even though the grid
(obviously) knows about the row index, none of the methods on the callback
interfaces to the grid seem to provide me with any way of getting the row
index in any reasonable manner. Ideally I'd love it if the JFace
ITableColorProvider getBackground() callback method had an extra parameter
of the row index, but sadly it does not. The existing JFace
ITableXProvider interfaces assume that users will only need to customize
behavior based on row element info, but in this case I want to be able to
customize behavior also on grid position info, which is something
independent of the row element data. Does anyone know if there is an
existing hook to customize the grid background painting behavior based on
row index?
Thanks,
Edwin
|
|
|
Powered by
FUDForum. Page generated in 0.04400 seconds