Cannot properly update error badges on a custom node

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot properly update error badges on a custom node

attila.kelemen
I have created a custom node in the Gradle plugin (https://github.com/kelemen/netbeans-gradle-project) and want to display error (or other) badge on it when any of the files under it contains error.

The feature is that you can change how the sources are organized. Currently, you can group them by source sets or don't group them at all. If I start NetBeans with the config telling the plugin to group the sources, my solution works. However, if I reconfigure it to non-grouping mode and after that configure it back to grouping mode badges will no longer be displayed on my custom node.

I have debugged the code and this is what happens when the issue occurs:

1. I properly detect that the badges might have changed on the node.
2. I call fireIconChange and fireOpenedIconChange.
3. Despite the change events, NetBeans never tries to get the icon again.

The two relavant classes of my plugin are: JavaSourceSetNode which is wrapped into a BadgeAwareNode (extends FilterNode).




Reply | Threaded
Open this post in threaded view
|

Cannot properly update error badges on a custom node

attila.kelemen
It was most likely my fault. What I was seeing is that a not yet GCd listener was notified of destroyed node (the displayed node did not fire an icon change event). Sorry for the hassle.