PDA

View Full Version : Custom logos on Tree



LINEMAN78
25 Nov 2008, 11:49 AM
Can someone please tell me if it is possible to put a different custom png next to every item in a tree and if so how? I have a Tree for a menu and I want to put a different icon next to each folder in my menu.

nannous
26 Nov 2008, 5:27 AM
Yes you can do it by implement an IconProvider of binder's tree. here is an example



binder.setIconProvider(new ModelStringProvider<TreeNodeOrganisation>(){

public String getStringValue(BaseTreeModel model,
String property) {

return "icone-custom";

}});

///CSS
.icone-custom{
background: url(custom.gif);
}

LINEMAN78
26 Nov 2008, 8:29 AM
OK, thx. I will try this out when I get around to it.