@Override
 public void drop(DnDEvent aEvent) {
   final Object object = aEvent.getAttachedObject();
   if (object instanceof PackagingElementDraggingObject) {
     final PackagingElementDraggingObject draggingObject = (PackagingElementDraggingObject) object;
     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<PackagingElement<?>>();
     editLayout(
         new Runnable() {
           @Override
           public void run() {
             draggingObject.beforeDrop();
             final CompositePackagingElement<?> parent =
                 getOrCreateModifiableParent(targetElement, targetNode);
             for (PackagingElement<?> element :
                 draggingObject.createPackagingElements(myContext)) {
               toSelect.add(element);
               parent.addOrFindChild(element);
             }
           }
         });
     updateAndSelect(targetNode, toSelect);
     myArtifactsEditor.getSourceItemsTree().rebuildTree();
   }
 }
 @Override
 public boolean update(DnDEvent aEvent) {
   aEvent.setDropPossible(false);
   aEvent.hideHighlighter();
   final Object object = aEvent.getAttachedObject();
   if (object instanceof PackagingElementDraggingObject) {
     final DefaultMutableTreeNode parent =
         findParentCompositeElementNode(aEvent.getRelativePoint().getPoint(myTree));
     if (parent != null) {
       final PackagingElementDraggingObject draggingObject =
           (PackagingElementDraggingObject) object;
       final PackagingElementNode node = getNode(parent);
       if (node != null && draggingObject.canDropInto(node)) {
         final PackagingElement element = node.getFirstElement();
         if (element instanceof CompositePackagingElement) {
           draggingObject.setTargetNode(node);
           draggingObject.setTargetElement((CompositePackagingElement<?>) element);
           final Rectangle bounds = myTree.getPathBounds(TreeUtil.getPathFromRoot(parent));
           aEvent.setHighlighting(
               new RelativeRectangle(myTree, bounds),
               DnDEvent.DropTargetHighlightingType.RECTANGLE);
           aEvent.setDropPossible(true);
         }
       }
     }
   }
   return false;
 }