Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325241

Summary: Table checkbox column moves on drag & drop
Product: [Eclipse Project] Platform Reporter: Lakshmi P Shanmugam <lshanmug>
Component: SWTAssignee: Scott Kovatch <skovatch>
Status: RESOLVED FIXED QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: skovatch
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Lakshmi P Shanmugam CLA 2010-09-14 08:50:12 EDT
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.
Comment 1 Scott Kovatch CLA 2011-02-11 12:20:19 EST
Fixed > 20110211, in Tree and Table. Check column can no longer be moved, or attempted to be moved, and nothing can go to the left of the check column.