public static void paste(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
		Node currentNode = textArea.node;

		// Abort if node is not editable
		if (!tree.getOldestInSelection().isEditable()) {
			return;
		}
			
		// Get the text from the clipboard and turn it into a tree
		boolean isNodeSet = false;
		String text = "";
		NodeSet nodeSet = new NodeSet();
		try {
			Transferable selection = (Transferable) Outliner.clipboard.getContents(null);
			if (selection != null) {
				if (selection instanceof NodeSetTransferable) {
					nodeSet = (NodeSet) selection.getTransferData(NodeSetTransferable.nsFlavor);
					isNodeSet = true;
				} else {
					text = (String) selection.getTransferData(DataFlavor.stringFlavor);
				}
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		// Figure out where to do the insert
		Node oldestNode = tree.getOldestInSelection();
		Node parentForNewNode = oldestNode.getParent();
		int indexForNewNode = oldestNode.currentIndex() + 1;
		int depth = oldestNode.getDepth();

		tree.clearSelection();
		tree.setSelectedNodesParent(parentForNewNode);

		// Put the Undoable onto the UndoQueue
		CompoundUndoableInsert undoable = new CompoundUndoableInsert(parentForNewNode);
		
		int pasteCount = 0;
		if (isNodeSet) {
			for (int i = nodeSet.getSize() - 1; i >= 0; i--) {
				Node node = nodeSet.getNode(i);
				node.setTree(tree, true);
				parentForNewNode.insertChild(node, indexForNewNode);
				node.setDepthRecursively(depth);
				tree.insertNode(node);

				// Record the Insert in the undoable
				int index = node.currentIndex() + i;
				undoable.addPrimitive(new PrimitiveUndoableInsert(parentForNewNode, node, index));

				tree.addNodeToSelection(node);
				pasteCount++;
			}
		} else {
			Node tempRoot = PadSelection.pad(text, tree, depth, Preferences.LINE_END_STRING);
		
			for (int i = tempRoot.numOfChildren() - 1; i >= 0; i--) {
				Node node = tempRoot.getChild(i);
				parentForNewNode.insertChild(node, indexForNewNode);
				tree.insertNode(node);

				// Record the Insert in the undoable
				int index = node.currentIndex() + i;
				undoable.addPrimitive(new PrimitiveUndoableInsert(parentForNewNode, node, index));

				tree.addNodeToSelection(node);
				pasteCount++;
			}
		}

		if (pasteCount == 1) {
			undoable.setName("Paste Node");
		} else {
			undoable.setName(new StringBuffer().append("Paste ").append(pasteCount).append(" Nodes").toString());
		}
		
		tree.getDocument().getUndoQueue().add(undoable);

		Node nodeThatMustBeVisible = tree.getYoungestInSelection();

		// Record the EditingNode and CursorPosition and ComponentFocus
		tree.setEditingNode(nodeThatMustBeVisible);

		// Redraw and Set Focus
		layout.draw(nodeThatMustBeVisible, OutlineLayoutManager.ICON);
	}