var node = message.node;
// if younger siblings var previousSibling = node.getPreviousSibling();
if(previousSibling){
node = previousSibling;
// if the previous node is expanded, dive in deepwhile(node.isExpandable&& node.isExpanded&& node.hasChildren()){// move to the last childvar children = node.getChildren();
node = children[children.length-1];
}}else{// if this is the first child, return the parent// unless the parent is the root of a tree with a hidden rootvar parent = node.getParent();
if(!(!this.showRoot&& parent === this.rootNode)){
node = parent;
}}if(node && node.isTreeNode){this.focusNode(node);
}