Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Alternate row coloring in Grid
Alternate row coloring in Grid [message #589542] Wed, 30 April 2008 19:39
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member

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?

Previous Topic:Alternate row coloring in Grid
Next Topic:GalleryTreeViewer and model access through content and label provider --- strange
Goto Forum:

Current Time: Tue Jun 19 03:29:37 GMT 2018

Powered by FUDForum. Page generated in 0.01975 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top