private void createDragSource() { if (dragSource != null) { dragSource.dispose(); } dragSource = new DragSource(tree, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK); dragSource.setTransfer(new Transfer[] {XPathTransfer.getInstance()}); DragSourceListener sourceListener = new TreeDragSourceListener(); dragSource.addDragListener(sourceListener); }
private void createDropTarget() { if (loopDropTarget != null) { loopDropTarget.dispose(); } loopDropTarget = new DropTarget(table, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK); loopDropTarget.setTransfer(new Transfer[] {XPathTransfer.getInstance()}); DropTargetListener targetListener = new TableDropTargetListener(); loopDropTarget.addDropListener(targetListener); }
public Transfer getTransfer() { return XPathTransfer.getInstance(); }