For the latest version of JMP Help, visit JMP.com/help.


JSL Syntax Reference > JSL Messages > Display Box Messages > Tree Node and Tree Box Messages
Publication date: 04/21/2023

Tree Node and Tree Box Messages

For the following JSL messages, node stands for a tree node or a reference to one and root stands for a tree box or a reference to one.

Caution: If you send a root node that contains one or more nodes with the Set Node Select Script defining a collapse message, then macOS runs the script twice. Windows doesn’t run the script. This behavior on macOS doesn’t just affect increments. Any script runs twice. It will print to the log twice, create a column twice, try to delete something twice, and so on.

node<<Append(<node>)

Inserts a referenced tree node after this node’s children.

node<<Collapse

Closes the node. The behavior is not guaranteed if the node has a collapsed parent.

node<<Expand

Opens the node. The behavior is not guaranteed if the node has a collapsed parent.

node<<Get Dimmed(<node>)

Gets the option to dim text (decrease the opacity) for the node.

node<<Get Font Style(<node>)

Gets the font style for the node.

node<<Get Tip

Returns the tooltip for the node.

node<<Prepend(<node>)

Inserts a tree node before this node’s children.

node<<Remove

Removes the given tree node and all its children from the tree display box.

node<<Set Dimmed(Boolean)

Sets the option to dim text (decrease the opacity)) for the node.

node<<Set Font Style("Plain"|"Bold")

Specifies the font style for the node.

node<<Set Selected(<node>)

Selects the node. The behavior is not guaranteed if the node has a collapsed parent.

node<<Set Tip(tooltip)

Sets a tooltip for the node. The tooltip argument is quoted.

root<<Collapse(<node>)

Collapses the given tree node.

root<<Expand(<node>)

Expands the given tree node.

root<<Get Selected(<node>)

Gets the currently selected tree node.

In a single-item tree, the currently selected tree node or Empty is returned.

Table 3.1 shows the results for a Tree Box() that contains the MultiSelect argument.

Table 3.1 Multi-Select Tree Results

Items Selected in Tree

Result

no items selected

empty

single item selected

list of one tree node

multiple items selected

list of selected tree nodes

root<<Is Multiselect

Returns 1 for a MultiSelect tree and 0 for a single-select tree.

root<<Set Selected(node|{nodes}, <Boolean>)

Selects the given tree node in the tree display box. In list of tree nodes, all nodes in the list are selected for MultiSelect trees. Otherwise, the first node in the list is selected. Specify the Boolean argument to indicate whether the node or nodes should be selected or unselected. The default value is 1, which selects the nodes.

Notes

On Windows, the Set Selected message expands all nodes between the selected node or nodes and the root of the tree; items that are selected deep within the tree are shown. The expansion state does not change for nodes that were previously selected.

On macOS, the Set Selected message does not change the tree expansion state.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).