Detecting when a TreeItem is no more used
tom.schindl at bestsolution.at
Fri Jul 26 04:47:50 PDT 2013
Not sure but what is reused is the TreeCell, the TreeItem is not freed
and has to exists as long as you show the tree!
On 26.07.13 13:37, Fabrizio Giudici wrote:
> I have a library which creates a hierarchy of TreeItems out of a data
> model, and of course the root TreeItem is later attached to a TreeView.
> I need to know when those TreeItems are no more used, so I can free some
> resources in the data model. I supposed that TreeItem had a life-cycle
> method or an event that notifies its destruction, but I seem unable to
> find it. At the moment it sounds as the solution is rather to watch for
> the TreeView and detect when it is destroyed, or its root property is
> changed, and then decide that the previously attached TreeView is no
> more used. It would be fine for me, but I'm just trying to understand
> whether this is the simpler, most appropriate approach.
More information about the openjfx-dev