boolean () { if (myLayoutTreeComponent.isSortElements()) { return false; } final PackagingElementNode<?> node = myLayoutTreeComponent.getSelection().getNodeIfSingle(); if (node == null) { return false; } final CompositePackagingElementNode parent = node.getParentNode(); if (parent == null) return false; final PackagingElement<?> element = node.getElementIfSingle(); final CompositePackagingElement<?> parentElement = parent.getElementIfSingle(); if (parentElement == null || element == null) return false; final List<PackagingElement<?>> children = parentElement.getChildren(); final int index = children.indexOf(element); return index != -1 && 0 <= index + myDirection && index + myDirection < children.size(); }