Allow a tree node to be selected programmatically via a predicate function