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
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.swt.custom.TableTreeItem;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetListener;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
/**
 * Abstract base implementation for structure-oriented viewers (trees, lists,
 * tables). Supports custom sorting, filtering, and rendering.
 * <p>
 * Any number of viewer filters can be added to this viewer (using
 * <code>addFilter</code>). When the viewer receives an update, it asks each
 * of its filters if it is out of date, and refilters elements as required.
 * </p>
 * 
 * @see ViewerFilter
 * @see ViewerSorter
 */
public abstract class StructuredViewer extends ContentViewer implements IPostSelectionProvider {