void (DnDEvent aEvent) { final Object object = aEvent.getAttachedObject(); if (object instanceof PackagingElementDraggingObject draggingObject) { final PackagingElementNode<?> targetNode = draggingObject.getTargetNode(); final CompositePackagingElement<?> targetElement = draggingObject.getTargetElement(); if (targetElement == null || targetNode == null || !draggingObject.checkCanDrop()) return; if (!checkCanAdd(targetElement, targetNode)) { return; } final List<PackagingElement<?>> toSelect = new ArrayList<>(); editLayout(() -> { final CompositePackagingElement<?> parent = getOrCreateModifiableParent(targetElement, targetNode); for (PackagingElement<?> element : draggingObject.createPackagingElements(myContext)) { toSelect.add(element); parent.addOrFindChild(element); } draggingObject.beforeDrop(); }); updateAndSelect(targetNode, toSelect); myArtifactsEditor.getSourceItemsTree().rebuildTree(); } }