O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom node labels

We can specify the node labels of a TreePanel instance by properly using its setDisplayProperty() method, giving it the name of a property from the TreeStore instance.. However, we may need to format this value (lowercase, uppercase, ellipsis, and so on), derive it from computation, or even display it from different properties of the model at different situations; this is where the ModelStringProvider interface comes to the rescue.

An implementation of the ModelStringProvider interface can be passed to the TreePanel class by using its setLabelProvider() method, and it will be used to determine how the label of nodes in the tree have been obtained.

How to do it...

Create a ModelStringProvider implementation and pass it to the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required