Detecting when a TreeItem is no more used
Tom Schindl
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!
Tom
On 26.07.13 13:37, Fabrizio Giudici wrote:
> Hello.
>
> 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.
>
> Thanks.
>
More information about the openjfx-dev
mailing list