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.