void (@NotNull AnActionEvent e) { final PackagingElementNode<?> node = myLayoutTreeComponent.getSelection().getNodeIfSingle(); if (node == null) return; final CompositePackagingElementNode parent = node.getParentNode(); if (parent == null) return; final PackagingElement<?> element = node.getElementIfSingle(); final CompositePackagingElement<?> parentElement = parent.getElementIfSingle(); if (parentElement == null || element == null) return; if (!myLayoutTreeComponent.checkCanModifyChildren(parentElement, parent, Collections.singletonList(node))) return; final List<PackagingElement<?>> toSelect = new ArrayList<>(); myLayoutTreeComponent.editLayout(() -> { final int index = parentElement.getChildren().indexOf(element); final PackagingElement<?> moved = parentElement.moveChild(index, myDirection); if (moved != null) { toSelect.add(moved); } }); if (!toSelect.isEmpty()) { myLayoutTreeComponent.updateAndSelect(parent, toSelect); } }