@Override
 	public void mousePressed(MouseEvent e) {
 		textArea = (OutlinerCellRendererImpl) e.getComponent();
 		
 		// Shorthand
 		Node currentNode = textArea.node;
 		JoeTree tree = currentNode.getTree();
 		OutlineLayoutManager layout = tree.getDocument().panel.layout;
		
		// This is detection for Solaris, I think mac does this too.
		if (e.isPopupTrigger() && (currentNode.isAncestorSelected() || (tree.getEditingNode() == currentNode))) {
			//Outliner.macroPopup.show(e.getComponent(),e.getX(), e.getY());
			e.consume();
			return;
		}
		
		// This is to block clicks when a right click is generated in windows.
		if ((PlatformCompatibility.isWindows()) && e.getModifiers() == InputEvent.BUTTON3_MASK) {
			return;
		}
		
 		// Clear the selection
 		int selectionSize = tree.getSelectedNodes().size();
		tree.clearSelection();
		
		// Clear any text selection in the node that was being edited
		if ((selectionSize == 0) && (currentNode != tree.getEditingNode())) {
			OutlinerCellRendererImpl renderer = layout.getUIComponent(tree.getEditingNode());
			// [srk] bug trap
			// renderer being null has caused a crash here
			if (renderer != null) {
				renderer.setCaretPosition(0);
				renderer.moveCaretPosition(0);
			}
		}
		
		// Store the preferred caret position
		tree.getDocument().setPreferredCaretPosition(textArea.getCaretPosition());
		
		// Record the EditingNode and CursorPosition and ComponentFocus
		tree.setEditingNode(currentNode);
		tree.setCursorPosition(textArea.getCaretPosition());
		tree.setComponentFocus(OutlineLayoutManager.TEXT);
		
		// Redraw only if there is a current selection
		if (selectionSize > 0) {
			 // This doesn't use redraw() becuase it's important to do a full draw if the node 
			 // is partially visible.
			tree.getDocument().panel.layout.draw(currentNode,OutlineLayoutManager.TEXT);
		}
		
		// Freeze Undo Editing
		UndoableEdit.freezeUndoEdit(currentNode);
 	}