node | The node to move. |
newParent | The new parent of the moved node, or null if the moved node should be made into a root node. |
newChildIndex | An optional zero-based index for positioning the moved node in the new parent's children list, or in the list of roots if the node is becoming a root node. If the index is not provided or is invalid, the moved node will be the last child of its parent. |
bool Whether the node was successfully moved.
Moves the node elsewhere in the hierarchy, which causes the given node to be parented by a different node
in the hierarchy. An optional index can be supplied for specifying the position within the list of children the
moved node should take (zero-based). If no index is supplied, the node is added as the last child of the new parent by default.
Root nodes can be moved elsewhere in the hierarchy, therefore ceasing to be a root.
Non-root nodes can be moved to become a root node by providing null
as the new parent node.
Warning: The moving operation is costly as many checks have to be executed to guarantee the integrity of
the hierarchy. Therefore this operation should not be done excessively as it may affect performance.