I have been wondering about the parameter properties in the method TreeViewer#update(Object element, String[] properties). What are they? What do they refer to? I am not sure what goes into the String[] - are there predefined constants to use? Or are these the names of my column headers? Something else?
I couldn't find any example of the usage of update() that doesn't have null passed on to it as the value for properties. The Javadoc isn't really helpful to me.
Thanks!
This eclipse.org article explains in chapter 'Responding to change' what those properties are used for: You can fine tune if you want a complete update of the treeitem's label or just the label's text or the label's image. It does not go into detail on how the properties should look like. Her, I think, you have to study the source code directly, if javadocs are not sufficient.
They are conveniences for the viewer's label provider to let it know what properties of the model changed. If the property that changed doesn't affect the display of the item in the view, then the provider can elect to not do anything by implementing the isLabelProperty() method to only return true when an interesting property changes.
If there are no logical properties on the item that changed to trigger the update call, then just pass null or an empty array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With