Class TriStateCheckBoxTreeBinders
TriStateCheckBoxTree that manage checked state via a two-path design.
Programmatic update path — when the checkedNodes property emits, the binder
syncs the TriStateCheckBoxTree.TriStateSelectionModel from the current BindableTreeNode.CheckBoxState
values on each node. The publisher is expected to have already set node states before emitting.
User-click path — when the user clicks a checkbox, the binder reads the raw checked set
from TriStateCheckBoxTree.TriStateSelectionModel and passes it to the callback. The callback (typically a
ViewModel) is responsible for deriving the correct BindableTreeNode.CheckBoxState for all
affected nodes and emitting an updated checked set. After the callback returns, the binder syncs
JIDE from the updated node states as a safety net for cases where the callback did not emit.
The binder itself is stateless with respect to derivation — it never sets BindableTreeNode.CheckBoxState directly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidbindCheck(TriStateCheckBoxTree tree, PropertyPublisherReadOnly<Set<BindableTreeNode<T>>> checkedNodes, Consumer<Set<BindableTreeNode<T>>> callback, BinderContext binderContext) Binds a property controlling the checked state of nodes.
-
Constructor Details
-
TriStateCheckBoxTreeBinders
public TriStateCheckBoxTreeBinders()
-
-
Method Details
-
bindCheck
public static <T> void bindCheck(TriStateCheckBoxTree tree, PropertyPublisherReadOnly<Set<BindableTreeNode<T>>> checkedNodes, Consumer<Set<BindableTreeNode<T>>> callback, BinderContext binderContext) Binds a property controlling the checked state of nodes.When
checkedNodesemits a new value theTriStateCheckBoxTree.TriStateSelectionModelis synced from the current node states. When the user clicks a checkbox,callbackreceives the raw set of checked nodes fromTriStateCheckBoxTree.Note: The callback is responsible for determining the correct
BindableTreeNode.CheckBoxStateof the nodes from the raw set of checked nodes.- Parameters:
tree- to bind to events emitted when the user clicks a checkboxcheckedNodes- publisher of nodes that should appear checkedcallback- receives raw checked nodes from the treebinderContext- lifecycle context, ornullto use the tree's own context
-