-
21 Mar 2012 6:13 AM #1
Answered: Custom icons in tree Model
Answered: Custom icons in tree Model
In 2.5, the documentation about the method TreePanel.getStyle().setNodeOpenIcon is:
I'm looking all over the place but can't find a way to change my individual items icons. All my items in the tree are extending (BaseTreeModel). I assume I'm not extending (or) implementing the good classe.Sets the global icon style for expanded tree items (defaults to 'tree-folder-open'). Individual tree items can override this value by setting the the item's icon style.
Can someone shed some light on this?
-
Best Answer Posted by Ersmarker
You should use the iconprovider.
Code:tree.setIconProvider(new ModelIconProvider<ModelData>() { @Override public AbstractImagePrototype getIcon(ModelData model) { // return your icon } });
-
23 Mar 2012 5:49 AM #2
You should use the iconprovider.
Code:tree.setIconProvider(new ModelIconProvider<ModelData>() { @Override public AbstractImagePrototype getIcon(ModelData model) { // return your icon } });
-
23 Mar 2012 11:10 AM #3
Solved!
Solved!
Thanks Ersmarker,
I use the ClientBundle to ge the icons.
Here's my code:
Code:tree.setIconProvider(new ModelIconProvider<ModelData>() { @Override public AbstractImagePrototype getIcon(ModelData model) { return AbstractImagePrototype.create(Resources.ICONS.add()); } });


Reply With Quote