CheckBoxTreeCell (JavaFX 8) (original) (raw)


public class CheckBoxTreeCell
extends TreeCell
A class containing a TreeCell implementation that draws a CheckBox node inside the cell, along with support for common interactions (discussed in more depth shortly).
To make creating TreeViews with CheckBoxes easier, a convenience class called CheckBoxTreeItem is provided. It is highly recommended that developers use this class, rather than the regular TreeItem class, when constructing their TreeView tree structures. Refer to the CheckBoxTreeItem API documentation for an example on how these two classes can be combined.
When used in a TreeView, the CheckBoxCell is rendered with a CheckBox to the right of the 'disclosure node' (i.e. the arrow). The item stored in TreeItem.getValue() will then have the StringConverter called on it, and this text will take all remaining horizontal space. Additionally, by using CheckBoxTreeItem, the TreeView will automatically handle situations such as: