> >> But for a more complex strategy (like coloring depending on some > >> rules, like the level of the node in the tree, or the amount value: > >> red in negative, green or default if positive, etc) i should be able > >> to set in the style property the name of the class (developed in > >> house) that implement this logic. > > > > You can use a renderer for this. > Ok, but is it possible / wanted to set the renderer (as full-class > name and maybe also as method name) from the style ? Or the renderer > is called only from paint, and i have to choose the operation to do > (or the renderer to call) depending on this new style property ? >
The renderer is an intrinsic property of the component. So you'd use treeView.setNodeRenderer(new MyCustomRenderer()), or in WTKX: '<TreeView><nodeRenderer><custom:MyCustomRenderer/></nodeRenderer></TreeView>'. Then when you're called to render, you look at the depth of the tree node (or whatever other criteria you want to bring to bear) and render appropriately. -T
