PDA

View Full Version : TreeTable Leaf Node Icons



ngrant
2 Mar 2009, 7:09 AM
Hi,

I want empty leaf nodes at the root to have the same icon as the other nodes. I want the leaf nodes with a parent node to have a different icon. This is what I have so far...

Java code snippet:



table.getStyle().setNodeCloseIconStyle("icon-folder");
table.getStyle().setNodeOpenIconStyle("icon-folder-open");
table.getStyle().setLeafIconStyle("icon-file");
for (TreeItem item : table.getItems()) {
item.setStyleName("folder");
}


CSS snippet:


.icon-folder {
background: url(folder.gif) no-repeat center left !important;
}

.icon-folder-open {
background: url(folder-open.gif) no-repeat center left !important;
}

.icon-file {
background: url(file.gif) no-repeat center left !important;
}

.icon-file .folder {
background: url(folder.gif) no-repeat center left !important;
}


This doesn't work. Anybody got any other ideas?

Thanks,

Nick