Yeah - this is a good suggestion. ListView and TableView renderers would be passed the item/row index, and TreeView's renderer would be passed the row index as well as the node's path.

On Sep 21, 2009, at 12:42 PM, Todd Volkert wrote:


Renderers will definitely allow you to customize the background color based
on the node data. You just can't customize it based on the node's
index/path, because that information isn't passed to the renderer. That's why the "zebra" style would need to be added to the tree view skin, not the
renderer.

So I'd need also a custom style because it has access to some row/ node
attributes, but from here is it possible to send some data to the
renderer, or currently this is not possible (without some changes to
the code) ? In the case it's currently not possible, do you think we
can modify something to enable this ?


There's not really any such thing as a "custom style", unless you create a custom TreeView subclass and associated skin. It is also not currently possible to pass any additional information to the renderer to support "zebra" styling without changing the node renderer interface, which I don't
think we should do.


Actually, given that there's no easy way to find out this info if we don't
pass it to the renderer, I think we should add it to the renderer
interfaces. For reference, Swing's renderers do give such info. Sandro, if you want to create a JIRA ticket for this, list it as "Renderers should be
passed index/path".

Reply via email to