public static void insertText(Node node, JoeTree tree, OutlineLayoutManager layout) {

		// Abort if node is not editable
		if (!node.isEditable()) {
			return;
		}
		
		Node newNode = new NodeImpl(tree,"");
		int newNodeIndex = 0;
		Node newNodeParent = null;
		
		if ((!node.isLeaf()) && (node.isExpanded())) {
			newNodeParent = node;
			newNode.setDepth(node.getDepth() + 1);
			node.insertChild(newNode, newNodeIndex);
		} else {
			newNodeIndex = node.currentIndex() + 1;
			newNodeParent = node.getParent();
			newNode.setDepth(node.getDepth());
			newNodeParent.insertChild(newNode, newNodeIndex);
		}
		
		int visibleIndex = tree.insertNodeAfter(node, newNode);

		// Record the EditingNode and CursorPosition and ComponentFocus
		tree.setEditingNode(newNode);
		tree.setCursorPosition(0);
		tree.getDocument().setPreferredCaretPosition(0);
		tree.setComponentFocus(OutlineLayoutManager.TEXT);

		// Put the Undoable onto the UndoQueue
		CompoundUndoableInsert undoable = new CompoundUndoableInsert(newNodeParent);
		undoable.setName("Insert Node Below");
		undoable.addPrimitive(new PrimitiveUndoableInsert(newNodeParent, newNode, newNodeIndex));
		tree.getDocument().getUndoQueue().add(undoable);
		
		// Redraw and Set Focus
		layout.draw(newNode, visibleIndex, OutlineLayoutManager.TEXT);	
	}