Project: SWT
Bug 325241 Table checkbox column moves on drag & drop
Reported: 2010-09-14 08:50:12 | Status: resolved fixed

public class Snippet_bug { public static void main (String [] args) { Display display = new Display (); String[] titles = {"Information", "Error", "Question", "Warning"}; String[] questions = {"who?", "what?", "where?", "when?", "why?"}; Shell shell = new Shell (display); shell.setLayout(new GridLayout()); Table table = new Table (shell, SWT.MULTI | SWT.CHECK|SWT.BORDER); GridData data = new GridData (SWT.FILL, SWT.FILL, true, true); data.heightHint = 200; table.setLayoutData (data); table.setLinesVisible (true); table.setHeaderVisible (true); for (int i=0; i<titles.length; i++) { TableColumn column = new TableColumn (table, SWT.NONE); column.setText (titles [i]); column.setMoveable(true); } int count = 128; for (int i=0; i<count; i++) { TableItem item = new TableItem (table, SWT.NONE); item.setText (0, "some info"); item.setText (1, "error #" + i); item.setText (2, questions [i % questions.length]); item.setText (3, "look out!"); } for (int i=0; i<titles.length; i++) { table.getColumn (i).pack (); } shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } Steps: 1) Run the snippet 2) Try to drag the first column header (by clicking above check box column). I'm unable to drag, but the cursor changes to hand cursor. 3) Now try to drag & drop any column over the first column, the dropped column gets inserted before the checkbox column.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java