Project: Eclipse_Platform_UI
Bug 2741 [JFace] TableViewer: MapElement problem (1GITISX)
Reported: 2001-10-10 22:42:38 | Status: resolved fixed

MA (21.08.2001 19:00:55) I was setting the input of a tableviewer two times with the same input. The first time, mapElement was called for each element, the second time for none of them. 'setInput()' always unmaps all elements. So after the second setInput the map is empty. I think this is the problematic code: (StructuredViewer) protected void associate(Object element, Item item) { Object data = item.getData(); if (data == element) return; << returns without mapElement if (data != null) disassociate(item); item.setData(element); mapElement(element, item); } NOTES: MA (28.08.2001 20:32:18) Other experiment: 1. Open the package viewer, create java project proj, package 'pack' and CU 'A.java' 2. set breakpoints on mapElement and unmapElement 3. create a cu pack.B.java 4. Even A.java stays the same, is is mappes and unmapped several times. 5. set breakpoints on assiciate and disassociate 6. A.java is disassociated and assiciated again (several times)

Files changed in fix:
bundles/org.eclipse.ui/Eclipse JFace/org/eclipse/jface/viewers/AbstractTreeViewer.java bundles/org.eclipse.ui/Eclipse JFace/org/eclipse/jface/viewers/ListViewer.java bundles/org.eclipse.ui/Eclipse JFace/org/eclipse/jface/viewers/StructuredViewer.java