@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;
 }
    @Override
    public void drop(DnDEvent aEvent) {
      Object attached = aEvent.getAttachedObject();
      if (!(attached instanceof ChangeListDragBean)) return;

      final ChangeListDragBean dragBean = (ChangeListDragBean) attached;
      final ChangesBrowserNode changesBrowserNode = dragBean.getTargetNode();
      if (changesBrowserNode != null) {
        changesBrowserNode.acceptDrop(myDragOwner, dragBean);
      }
    }
  @Override
  public boolean update(final DnDEvent aEvent) {
    Object object = aEvent.getAttachedObject();
    boolean possible = false;
    if (object instanceof XValueNodeImpl[]) {
      possible = true;
    } else if (object instanceof EventInfo) {
      possible = ((EventInfo) object).getTextForFlavor(DataFlavor.stringFlavor) != null;
    }

    aEvent.setDropPossible(possible, XDebuggerBundle.message("xdebugger.drop.text.add.to.watches"));

    return true;
  }
 @Override
 public void drop(final DnDEvent aEvent) {
   Object object = aEvent.getAttachedObject();
   if (object instanceof XValueNodeImpl[]) {
     final XValueNodeImpl[] nodes = (XValueNodeImpl[]) object;
     for (XValueNodeImpl node : nodes) {
       String expression = node.getValueContainer().getEvaluationExpression();
       if (expression != null) {
         addWatchExpression(expression, -1, false);
       }
     }
   } else if (object instanceof EventInfo) {
     String text = ((EventInfo) object).getTextForFlavor(DataFlavor.stringFlavor);
     if (text != null) {
       addWatchExpression(text, -1, false);
     }
   }
 }
    @Override
    public boolean update(DnDEvent aEvent) {
      aEvent.hideHighlighter();
      aEvent.setDropPossible(false, "");

      Object attached = aEvent.getAttachedObject();
      if (!(attached instanceof ChangeListDragBean)) return false;

      final ChangeListDragBean dragBean = (ChangeListDragBean) attached;
      if (dragBean.getSourceComponent() != ChangesListView.this) return false;
      dragBean.setTargetNode(null);

      RelativePoint dropPoint = aEvent.getRelativePoint();
      Point onTree = dropPoint.getPoint(ChangesListView.this);
      final TreePath dropPath = getPathForLocation(onTree.x, onTree.y);

      if (dropPath == null) return false;

      ChangesBrowserNode dropNode = (ChangesBrowserNode) dropPath.getLastPathComponent();
      while (!((ChangesBrowserNode) dropNode.getParent()).isRoot()) {
        dropNode = (ChangesBrowserNode) dropNode.getParent();
      }

      if (!dropNode.canAcceptDrop(dragBean)) {
        return false;
      }

      final Rectangle tableCellRect = getPathBounds(new TreePath(dropNode.getPath()));
      if (fitsInBounds(tableCellRect)) {
        aEvent.setHighlighting(
            new RelativeRectangle(ChangesListView.this, tableCellRect),
            DnDEvent.DropTargetHighlightingType.RECTANGLE);
      }

      aEvent.setDropPossible(true);
      dragBean.setTargetNode(dropNode);

      return false;
    }