Bug 134003

Summary: TableEditor doesn't track moving of cells properly
Product: [Eclipse Project] Platform Reporter: Max Rotvel <rotvel>
Component: SWTAssignee: Veronika Irvine <veronika_irvine>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Testcase incl. workaround
none
Testcase w. better workaround none

Description Max Rotvel CLA 2006-03-30 02:24:42 EST
If a table cell, tracked by a TableEditor, is moved in a way that doesn't affect the size or position of it's TableColumn, the tacking fails and the TableEditor Control isn't moved with the cell (this is because TableEditor only tracks movement of cells by adding a ControlListener to the relevant TableColumn).

This can happen when disposing TableItems, for an example (including a workaround) compile and run the enclosed testcase.
Comment 1 Max Rotvel CLA 2006-03-30 02:34:11 EST
Created attachment 37283 [details]
Testcase incl. workaround

Compile and run the testcase. Delete rows by using the buttons. 

If deleting a row causes the underlying row to be shifted up, the button isn't moved with it. Enabling the workaround makes the button move with the row correctly (by forcing a TableEditor.resize() - all the fun stuff is in the 'selector' Listener)
Comment 2 Max Rotvel CLA 2006-04-04 16:47:51 EDT
Created attachment 37670 [details]
Testcase w. better workaround

Testcase with a much nicer workaround. 

As far as I can see it is not possible to make TableEditor track the cell correctly in the case where a TableItem moves without changing it's TableColumn (because TableItem doesn't publish the move or resize events), at least not without hacking into the paint event and doing something nasty there. A solution could be to just update the Javadoc to mention the case where it doesn't work and perhaps the workaround.
Comment 3 Steve Northover CLA 2007-03-31 11:22:47 EDT

*** This bug has been marked as a duplicate of bug 73928 ***