void (ComponentTree tree, EditableArea area, ToolProvider provider) { TreeDropListener listener = new TreeDropListener(area, provider); if (!ApplicationManager.getApplication().isHeadlessEnvironment()) { tree.setDragEnabled(true); tree.setTransferHandler(new TreeTransfer(TreeDropListener.class)); tree.setDropTarget(new DropTarget(tree, listener)); } }