Reputation: 3390
I use Vaadin 7. I tried to change the component's icon with the following code :
Tree tree = new Tree("The Planets and Major Moons");
tree.setIcon(new ThemeResource("img/inode-directory.png"));
.... //here I fill the tree
When I run the application I still get the same icon (default icon) of Vaadin Tree. Is there something that I forgot to add?
Upvotes: 0
Views: 1147
Reputation: 3390
I figured how to change to tree icon in Vaadin. It's simple :
.v-tree-node
and .v-tree-node-expanded
You can set any img you want from an url like this :
.v-tree-node-expanded {
background: transparent url(img/Documenta.png) no-repeat 0px 4px;
}
.v-tree-node {
background: transparent url(img/Documenta.png) no-repeat 0px 4px;
padding: 1px 0;
padding-left: 2px;
}
Upvotes: 1