Set active state on tree nodes.