Bug 122756 [Viewers] Support for TreePath based content providers
Now that the JFace tree viewer supports the notion of a tree path, it would be benefitial if this information was made available to content providers and label providers. The particular scenario that requires this is team views that include change sets. A view can display multiple change sets and a single model element may be included in multiple change sets. In 3.2, we are using the common navigator framework to allow model providers to display their models in a team operation. Having a tree path based content provider would allow the logical model display to be intermixed with change sets. Without this support, team providers would most likely need to support two views, one which shows resources and change sets and another that shows the effects of the operation on the logical model.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
* @return the element, or the last segment of the tree path
     */
	private Object internalToElement(Object elementOrPath) {
		if (elementOrPath instanceof TreePath) {
			return ((TreePath)elementOrPath).getLastSegment();
		}
		return elementOrPath;
	}
    /**
	 * This method takes a tree path or an element. If the argument is not a
	 * tree path, returns the parent of the given element or <code>null</code>
	 * if the parent is not known. If the argument is a tree path with more than
	 * one segment, returns its parent tree path, otherwise returns
	 * <code>null</code>.
	 * 
	 * @param elementOrTreePath
	 * @return the parent element, or parent path, or <code>null</code>
	 */ 
    protected Object getParentElement(Object elementOrTreePath) {
    	if(elementOrTreePath instanceof TreePath) {
    		TreePath treePath = (TreePath)elementOrTreePath;
    		if(treePath.getSegmentCount() <= 1) {
    			return null;
    		}
			return (treePath).getParentPath();
    	}
        ITreeContentProvider cp = (ITreeContentProvider) getContentProvider();
        if (cp == null) {
            return null;
        }