tags:

views:

2

answers:

2

I am working on NetBeans Platform 6.7

I have a simple BeanTreeView to display some nodes. They all start in normal text and I wish to change some of them to bold and/or underline, in response to events in the software.

Trouble is, I cannot see how to get the Tree to refresh the Nodes display.

I can call AbstractNode.setName() which will allow me to change the name but will not support the bold tags.

I can change the result of getHtmlDisplayName() to include bold tags. But then I must get the Node to be repainted - how can I do that ?

A: 

I can work around my problem if I stop caching AbstractNodes; when I want to update the HtmlDisplayName() of an AbstractNode instance I must construct a replacement Node.

It does not seem to be possible to simply update the existing node and get it refreshed.

Ben Hammond
A: 

Okay. It looks like I am being thick.

I can call Node.setDisplayName() on the Node, and the Node.getHtmlDisplayName() will be automatically called as a result - as long as the I have actually changed the DisplayName string - If I call setDisplayName() with the same string as before, then nothing happens.

Ben Hammond