This can replace AbstractTreeRenderer.
cc @sandy081 for problems panel
Pinging all tree users @isidorn @jrieken @roblourens @bpasero @sandy081
I've introduced a new tree API which lets you simply refresh a single element, including updating its height if there are any height changes. @jrieken first convinced me to introduce this API which doesn't modify the tree model at all but, at most, simply re-renders a single tree element. This API came up in several use cases, including @isidorn's rename feature in several trees, @jrieken's breadcrumbs, @sandy081's marker panel, etc, all of which would have to refresh the parent of the node in question in order to get that functionality.
After discussing with @sandy081 and @isidorn, I've decided to call this API refresh. Consequentially, I had to rename the current refresh call and decided to name it updateChildren. I've refactored all code in master accordingly. Sorry for the hassle in other branches and for renaming such a well known operation, but I feel the new names currently match their behaviors much better.
The current API now is:
// tree model modification calls
updateChildren(): Promise; // for async data tree
updateChildren(); // for data tree
setChildren(); // for object tree
splice(); // for index tree
// tree view re-render call
refresh(element); // for all trees
We are getting closer to the good old Eclipse JFace tree :)
Also fyi @weinand
Works fine, I am using it in the explorer -> verified
Most helpful comment
Pinging all tree users @isidorn @jrieken @roblourens @bpasero @sandy081
I've introduced a new tree API which lets you simply refresh a single element, including updating its height if there are any height changes. @jrieken first convinced me to introduce this API which doesn't modify the tree model at all but, at most, simply re-renders a single tree element. This API came up in several use cases, including @isidorn's rename feature in several trees, @jrieken's breadcrumbs, @sandy081's marker panel, etc, all of which would have to refresh the parent of the node in question in order to get that functionality.
After discussing with @sandy081 and @isidorn, I've decided to call this API
refresh. Consequentially, I had to rename the currentrefreshcall and decided to name itupdateChildren. I've refactored all code inmasteraccordingly. Sorry for the hassle in other branches and for renaming such a well known operation, but I feel the new names currently match their behaviors much better.The current API now is: