Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332411 - [Table] Scrolling in table viewers with DND support is broken
Summary: [Table] Scrolling in table viewers with DND support is broken
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.4 M4   Edit
Assignee: Tim Buschtoens CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-13 03:21 EST by Michael Klein CLA
Modified: 2010-12-13 06:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Klein CLA 2010-12-13 03:21:55 EST
Environment: Firefox 3.6.13/IE 8.0.7600 on Win7

The bug occurs only using RAP 1.4 (e.g. CVS HEAD). With 1.3.1 it works correctly.

Steps to reproduce:
* create a table viewer
* add drag support to the table viewer
* fill it with some items to cause a vertical scroll bar
* use the bar itself to scroll down (not the mouse wheel or the arrow keys or the scroll bar arrow buttons)
-> The table scrolls down exactly one item and then switches to item drag drag mode

Expected:
Using the scroll bar should not cause drag of an table item.


Here is a snippet to reproduce:

public class Snippet implements IEntryPoint {

	public int createUI() {
		Display display = new Display();
		Shell shell = new Shell(display, SWT.TITLE);
		createContent(shell);
		shell.layout();
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return 0;
	}

	private void createContent(Shell shell) {
		shell.setLayout(new GridLayout(1, false));

		int style = SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER;
		Table table = new Table(shell, style);
		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		TableViewer viewer = new TableViewer(table);
		viewer.setLabelProvider(new LabelProvider());
		viewer.setContentProvider(new ArrayContentProvider());

		String[] input = new String[100];
		for (int i = 0; i < input.length; i++) {
			input[i] = "Item " + i;
		}
		viewer.setInput(input);

		// drag support
		viewer.addDragSupport(DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK, new Transfer[] {TextTransfer.getInstance()}, new DragSourceAdapter());
	}

}
Comment 1 Tim Buschtoens CLA 2010-12-13 04:56:03 EST
Confirmed. Tree and List work fine since they are build differently.
Comment 2 Tim Buschtoens CLA 2010-12-13 06:21:41 EST
Fixed in CVS Head in Table.js. (It now works just as Tree.js).