Bug 243739 - [DND] RHEL 5.0 : In "ViewerDropAdapter # public boolean performDrop(Object data) " data is "null" when a file is dragged and dropped from a mounted drive in RHEL 5.0
Summary: [DND] RHEL 5.0 : In "ViewerDropAdapter # public boolean performDrop(Object da...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: Other Linux-GTK
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-08-11 08:16 EDT by Janash CLA
Modified: 2009-04-24 10:24 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janash CLA 2008-08-11 08:16:30 EDT
Build ID: I20080617-2000

Steps To Reproduce:
Please note that this issue is reproducible only in RHEL 5.0.

1) Create a table viewer
2) Set the content provider and label provider for the viewer
3) Implement a class "MyDropAdapter" which extends "org.eclipse.jface.viewers.ViewerDropAdapter"
4) Implement the method "public boolean performDrop(Object data)" in "MyDropAdapter" 
5) Set "MyDropAdapter" as the drop target listener in the viewer created in step 1.
6) Mount a shared network drive in RHEL 5.0
7) Drag and drop a file from the mounted drive in to the viewer.

Bug : In performDrop(Object data) method of "MyDropAdapter", data is coming as NULL.


Following code can be used to reproduce the problem. Please use appropriate content provider, label provider, sorter and input. 


	TableViewer viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	viewer.setContentProvider(....);
	viewer.setLabelProvider(....);
	viewer.setSorter(...);
	viewer.setInput(...);
		
	MyDropAdapter dropAdapter = new MyDropAdapter(viewer);
		
	int ops = DND.DROP_COPY | DND.DROP_MOVE; 
	Transfer[] transfers = new Transfer[] {FileTransfer.getInstance()};
		
	viewer.addDropSupport(ops, transfers, dropAdapter);







	class MyDropAdapter extends ViewerDropAdapter {

		protected MyDropAdapter(Viewer viewer) {
			super(viewer);			
		}

		public boolean performDrop(Object data) {
			System.out.println("data="+data);			
			return true;
		}
		
		public boolean validateDrop(Object target, int operation,
				TransferData transferType) {
			return true;
		}
		
	}



More information:
Comment 1 Eric Moffatt CLA 2008-08-18 15:33:00 EDT
Janash, is this an NFS mount?

Also, what happens if you drag a file onto the Package and/or the Project Explorer?
Comment 2 Janash CLA 2008-12-09 05:48:01 EST
Yes. This is an NFS mount.

I tried to drag and drop a file from a mounted drive (mounted NFS drive) into Eclipse Project Explorer. The file was not added.
Comment 3 Mike Wilson CLA 2009-04-16 10:37:38 EDT
Paul, have you seen this behavior? (Note that it doesn't work even in the Project Explorer.)
Comment 4 Paul Webster CLA 2009-04-16 12:29:29 EDT
(In reply to comment #3)
> Paul, have you seen this behavior? (Note that it doesn't work even in the
> Project Explorer.)

I can drag a file from an NFS mount from Nautilus 2.16.2 into the eclipse Project Explorer or Package Explorer (to either the project or folder level).  My system is RHEL based:

Red Hat Enterprise Linux Client release 5.3 (Tikanga)
gtk2-2.10.4-20.el5


If you drag the file in the Project Explorer, do we log an exception in <workspace>/.metadata/.log

PW
Comment 5 Eric Moffatt CLA 2009-04-16 13:10:11 EDT
Paul, do you think I should pass this on to Francis for a look?
Comment 6 Boris Bokowski CLA 2009-04-24 09:46:36 EDT
What's the status of this bug? (It is marked as "critical" - is that accurate?)
Comment 7 Eric Moffatt CLA 2009-04-24 10:10:03 EDT
I'm not sure, Paul ?
Comment 8 Paul Webster CLA 2009-04-24 10:24:45 EDT
Please re-open if this is still a problem.

PW