With CheckBoxTree, is it possible to distinguish between:
a) A user unchecking a checkbox for an item in the tree
and
b) An item getting deleted from the tree
I'm using this in the context of a todo list, where checking and unchecking items means a change in the "completed" status
of the todo item. I also allow users to filter out items based on completetion status. Which means there are cases when
an item gets temporarily "deleted" from the list, but I don't want to change the "completed" status of the underlying todo item.
I have a TreeSelectionListener setup to listen to changes to checkbox state changes, but it seems like
my listener gets called with the same event for both scenarios above.
What I'm currently doing is, every time my valueChanged() method gets called in my listener, I'm checking the
backing TreeModel to see if the item still exists or not. If it still exists, I'm interpreting this a
the users unchecking the item. If the items does not exist in the TreeModel, I'm interpreting this as
the item being deleted.
Is there a better way for me to do all of this?