public static Node goToLineAndColumn(OutlinerDocument doc, int lineNumber, int columnNumber, boolean countDepth, boolean gotoColumn) {
		// Get a valid line number
		if (lineNumber < 1) {
			lineNumber = 1;
		}

		// Find the nth node.
		Node currentNode = doc.tree.getRootNode();
		Node nextNode;
		for (int i = 0; i < lineNumber; i++) {
			nextNode = currentNode.nextNode();
			if (nextNode.isRoot()) {
				break;
			} else {
				currentNode = nextNode;
			}
		}

		// Geta a valid column number
		if (countDepth) {
			columnNumber -= currentNode.getDepth();
		}
		
		if (columnNumber < 0) {
			columnNumber = 0;
		}

		// Insert the node into the visible nodes.
		doc.tree.insertNode(currentNode);

		doc.tree.setEditingNode(currentNode);
		
		if (gotoColumn) {
			// Select the node
			doc.tree.clearSelection();
			
			// Correct the columnNumber if it's larger than the nodes text
			if (columnNumber > currentNode.getValue().length()) {
				columnNumber = currentNode.getValue().length();
			}
			
			// Record the EditingNode and CursorPosition and ComponentFocus
			doc.tree.setCursorPosition(columnNumber);
			doc.setPreferredCaretPosition(columnNumber);
			doc.tree.setComponentFocus(OutlineLayoutManager.TEXT);
		} else {
			// Select the node
			doc.tree.setSelectedNodesParent(currentNode.getParent());
			doc.tree.addNodeToSelection(currentNode);
			
			// Record the EditingNode and CursorPosition and ComponentFocus
			doc.tree.setComponentFocus(OutlineLayoutManager.ICON);
		}
		
		return currentNode;
	}