private void calculateEnabledState(JoeTree tree) {
		Document doc = tree.getDocument();
		
		if (doc == Outliner.documents.getMostRecentDocumentTouched()) {
			Node node = tree.getEditingNode();
			
			if (tree.getComponentFocus() == OutlineLayoutManager.TEXT) {
				if (node.isLeaf()) {
					setEnabled(false);
				} else {
					setEnabled(true);
				}
			} else if (tree.getComponentFocus() == OutlineLayoutManager.ICON) {
				if (tree.getNumberOfSelectedNodes() == 1) {
					if (node.isLeaf()) {
						setEnabled(false);
					} else {
						setEnabled(true);
					}
				}
			}
		}
	}