Bug 134003 - TableEditor doesn't track moving of cells properly
Summary: TableEditor doesn't track moving of cells properly
Status: RESOLVED DUPLICATE of bug 73928
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 02:24 EST by Max Rotvel CLA
Modified: 2007-03-31 11:22 EDT (History)
0 users

See Also:


Attachments
Testcase incl. workaround (3.48 KB, text/java)
2006-03-30 02:34 EST, Max Rotvel CLA
no flags Details
Testcase w. better workaround (3.07 KB, text/java)
2006-04-04 16:47 EDT, Max Rotvel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***