break;
}
}
private void focusGoUp(Treerow treerow, int position) {
Treeitem parent = (Treeitem) treerow.getParent();
@SuppressWarnings("unchecked")
List<Treeitem> treeItems = parent.getParent().getChildren();
int myPosition = parent.indexOf();
if (myPosition > 0) {
// the current node is not the first brother
Treechildren treechildren = treeItems.get(myPosition - 1)
.getTreechildren();
if (treechildren == null
|| treechildren.getChildren().size() == 0) {
// the previous brother doesn't have children,
// or it has children but they are unloaded
Treerow upTreerow = treeItems.get(myPosition - 1)
.getTreerow();
focusCorrectBox(upTreerow, position, Navigation.LEFT);
} else {
// we have to move to the last child of the previous
// brother
Treerow upTreerow = findLastTreerow(treeItems
.get(myPosition - 1));
while (!upTreerow.isVisible()) {
upTreerow = ((Treeitem) upTreerow.getParent()
.getParent().getParent()).getTreerow();
}
focusCorrectBox(upTreerow, position, Navigation.LEFT);
}
} else {
// the node is the first brother
if (parent.getParent().getParent() instanceof Treeitem) {
// the node has a parent, so we move up to it
Treerow upTreerow = ((Treeitem) parent.getParent()
.getParent()).getTreerow();
focusCorrectBox(upTreerow, position, Navigation.LEFT);
}
}