CheckBoxTreeItem behavior - independent property

Nir Lisker nlisker at gmail.com
Sat Nov 19 07:28:27 UTC 2022


Hi,

Another issue I stumbled across is the usage of the Independent property
on CheckBoxTreeItem. The docs read:

A BooleanProperty used to represent the independent state of this
> CheckBoxTreeItem. The independent state is used to represent whether
> changes to a single CheckBoxTreeItem should influence the state of its
> parent and children.


By default, the independent property is false, which means that when a
> CheckBoxTreeItem has state changes to the selected or indeterminate
> properties, the state of related CheckBoxTreeItems will possibly be
> changed. If the independent property is set to true, the state of related
> CheckBoxTreeItems will never change.


It makes it clear that changes to this checkbox don't influence its
children/parents, and in terms of usage, it means that clicking on the
checkbox doesn't change the state of its parents/children. However:

1. Does it also include stopping the propagation of selection updates
through it? If an independent item has a child and a parent, and the parent
is selected, does the item stop its child from being selected? I think that
the answer is yes, but I want to make sure the independent property wasn't
just meant for direct clicks or direct changes to its own properties alone.

2. Do the parents/children affect this item? The docs only mention one
direction: item -> parents/children, it doesn't mention parents/children ->
item. As it stands currently, the item seems to be affected by other
selections. I find it odd because this doesn't make the item really
independent, and I can't think of a use case for this one-sided independent
behavior.

In any case, I think that the documentation should clarify these points, so
I would like to know what the behavior should be.

- Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20221119/ab2eb1df/attachment.htm>


More information about the openjfx-dev mailing list