TreeNodeScope

sealed interface TreeNodeScope

The receiver a Tree node composes against: the row inputs the tree hands a TreeCellRenderer for the node being stamped, exposed as read-only composition state so the node can lay itself out by position, selection, expansion and focus.

Mirrors the arguments of javax.swing.tree.TreeCellRenderer.getTreeCellRendererComponent: row is the node's row, isSelected whether it is selected, isExpanded whether its children are shown below it, isLeaf whether the structure gives it children at all, and hasFocus whether it draws the focus decoration.

See also

Properties

Link copied to clipboard
abstract val hasFocus: Boolean

Whether the node being rendered currently draws the focus decoration.

Link copied to clipboard
abstract val isExpanded: Boolean

Whether the node being rendered is expanded, so its children are displayed below it.

Link copied to clipboard
abstract val isLeaf: Boolean

Whether the node being rendered is a leaf - one the structure gives no children.

Link copied to clipboard
abstract val isSelected: Boolean

Whether the node being rendered is selected.

Link copied to clipboard
abstract val row: Int

The row the node being rendered occupies, counting the tree's displayed rows from the top.