Bug 84314 [Viewers] Need to allow mapping elements to multiple widgets/items
One of the projects I am working on is using an essentially graph structured dependancy model and we use TableTreeViewer for browsing (drilling down) through this graph. The nature of the model is such that the same model element can occur in multiple positions (paths) of the three. Current implementation of the TreeViewer and TableTreeViewer do not support such one-to-many mapping of model elements to widgets, leading to loads of unnecessary overhead to enshure that correct items will get updated. Suggestion: Element -> Item mapper should allow returning of more than one item per model element that is associated with this element.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
/**
	 * Associates the given element with the given widget. Sets the given item's
	 * data to be the element, and maps the element to the item in the element
	 * map (if enabled).
	 * 
	 * @param element
	 *            the element
	 * @param item
	 *            the widget
	 */
	protected void associate(Object element, Item item) {
		Object data = item.getData();
		if (data != element) {
			if (data != null)
				disassociate(item);
			item.setData(element);
		}
		
		
		
		mapElement(element, item);
	}
	/**
	 * Disassociates the given SWT item from its corresponding element. Sets the
	 * item's data to <code>null</code> and removes the element from the
	 * element map (if enabled).
	 * 
	 * @param item
	 *            the widget
	 */