* its children or its parent.
*
* @param where
*/
private void navigateToSide(NodeLocation where) {
Node n = _selection.getCurrentNode();
if (n.getNodeLocation() == where) {
// we are going deeper into children, f.e. moving left from a node
// that is on the left
if (n.getChildCount() <= 0)
return;
setCurrentNode(n.getChildren().iterator().next());
} else if (n.getNodeLocation() == NodeLocation.ROOT) {
// moving from the root, which has no parent and children in either
// direction
if (n.getChildCount() <= 0)
return;
for (Node child : n.getChildren()) {
if (child.getNodeLocation() == where) {
setCurrentNode(child);
return;
}
}
} else {
// moving towards the parent (moving right on left-sided node)
setCurrentNode(n.getParent());
}
}