Community
Participate
Working Groups
Created attachment 144648 [details] Error Log Build ID: M20090211-1700 Steps To Reproduce: 1. An extension extends the CommonDragAdapterAssistant. 2. Get Transfer types returns a Text transfer object. 3. setDragData method in the CommonDragAdatperAssistant returns event.doIt false under some conditions.But still the drag continues for those conditions which results the attached log. More information: org.eclipse.swt.SWTException: Data does not have correct format for type at org.eclipse.swt.dnd.DND.error(DND.java:277) at org.eclipse.swt.dnd.DND.error(DND.java:228) at org.eclipse.swt.dnd.TextTransfer.javaToNative(TextTransfer.java:61) at org.eclipse.swt.dnd.DragSource.GetData(DragSource.java:469) at org.eclipse.swt.dnd.DragSource.access$7(DragSource.java:435) at org.eclipse.swt.dnd.DragSource$4.method3(DragSource.java:258) at org.eclipse.swt.internal.ole.win32.COMObject.callback3(COMObject.java:92) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:362) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:288) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:171) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
This is very likely fixed in 3.5. Can you review the list of bugs in the link below [1] and see if one of them matches what you are reporting? Alternatively, can you try your scenario in 3.5? [1] https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=CommonNavigator&classification=Eclipse&product=Platform&component=UI&target_milestone=3.5&target_milestone=3.5+M1&target_milestone=3.5+M2&target_milestone=3.5+M3&target_milestone=3.5+M4&target_milestone=3.5+M5&target_milestone=3.5+M6&target_milestone=3.5+M7&target_milestone=3.5+RC1&target_milestone=3.5+RC2&target_milestone=3.5+RC3&target_milestone=3.5+RC4&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=dnd&keywords_type=allwords&keywords=&bug_status=RESOLVED&resolution=FIXED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=
(In reply to comment #1) > This is very likely fixed in 3.5. Can you review the list of bugs in the link > below [1] and see if one of them matches what you are reporting? > Alternatively, can you try your scenario in 3.5? > [1] > https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=CommonNavigator&classification=Eclipse&product=Platform&component=UI&target_milestone=3.5&target_milestone=3.5+M1&target_milestone=3.5+M2&target_milestone=3.5+M3&target_milestone=3.5+M4&target_milestone=3.5+M5&target_milestone=3.5+M6&target_milestone=3.5+M7&target_milestone=3.5+RC1&target_milestone=3.5+RC2&target_milestone=3.5+RC3&target_milestone=3.5+RC4&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=dnd&keywords_type=allwords&keywords=&bug_status=RESOLVED&resolution=FIXED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= Hi Francis, Thanks for the comments.Unfortunately i am not able to test in 3.5 as our productized IDE has not still migrated to 3.5.But i do not the see this bug being reported before.Could you please confirm or let me know if i need to provide any further details. Best Regards, Saurav
(In reply to comment #2) Unfortunately i am not able to test in 3.5 as our > productized IDE has not still migrated to 3.5. You are aware I hope that even if this is a bug in 3.5 (or 3.6) there are no further releases of 3.4.x, a fix will be provided only in 3.6 (and possibly 3.5.1 or 2).
Make sure you return "true" from setDragData() if you are setting event.doIt to false, this should cancel the drag. If you are returning false from setDragData() it will continue looking for another way to set the data, which is probably not what you want. I'm going to close this; if my suggestion does not fix your problem, please reopen this, and please provide your CommonDragAdapterAssistant subclass.
(In reply to comment #4) > Make sure you return "true" from setDragData() if you are setting event.doIt to > false, this should cancel the drag. If you are returning false from > setDragData() it will continue looking for another way to set the data, which > is probably not what you want. > I'm going to close this; if my suggestion does not fix your problem, please > reopen this, and please provide your CommonDragAdapterAssistant subclass. I tried everything it did not work. Below is the Code from the CommonDragAdapter [code] if(assistants[i].setDragData(event, (IStructuredSelection) selection)) { return; } } catch (RuntimeException re) { NavigatorPlugin.logError(0, re.getMessage(), re); } } } } event.doit = false; [/code] My case it returns false so it sets event.doit=false; there is no checkingfor event.doit done in CNF acc. to me which is done in DelegatingDragAdpater in normal JFace viewer. I am not very sure so could you please provide your inputs on this. So reopening the bug. cheers, Saurav
(In reply to comment #5) > > My case it returns false so it sets event.doit=false; Your implementation of the method setDragData() should return true if you want to have event.doit used. If you return false from setDragData() whatever you set event.doit to will be ignored. > > there is no checkingfor event.doit done in CNF acc. to me Look at the CommonDragAdapter.dragSetData() where it calls setDragData(), note that it returns if you return true, and if you have set event.doit to false, then that should apply. Again, I'm closing. If you are still having trouble please reopen and please provide your complete implementation of your CommonDragAdaptorAssistant subclass (you did not provide that as far as I can see).
Created attachment 145511 [details] Implementaion fo CommonDragAdapter
(In reply to comment #6) > (In reply to comment #5) > > > > My case it returns false so it sets event.doit=false; > Your implementation of the method setDragData() should return true if you want > to have event.doit used. If you return false from setDragData() whatever you > set event.doit to will be ignored. > > > > there is no checkingfor event.doit done in CNF acc. to me > Look at the CommonDragAdapter.dragSetData() where it calls setDragData(), note > that it returns if you return true, and if you have set event.doit to false, > then that should apply. > Again, I'm closing. If you are still having trouble please reopen and please > provide your complete implementation of your CommonDragAdaptorAssistant > subclass (you did not provide that as far as I can see). In the attachement you could find the condition having the comments. I returned true as well as have set the event.doit=false.But still getting the same error.Any other variable of the event object i need to set?
Ok, now I'm remembering this. The problem is that event.doit has no effect on a setDragData call. Once you have agreed to start the drag, it must finish. You can't cancel it at setDragData time. See SWT DragSourceEvent (the description of the doit flag). Also see the SWT DragSourceListener. I'm remembering in 3.5 we had some conversations with the SWT about doing someting about this because sometimes it's desirable to be able to cancel the drag if you don't like the data that you have, but I have been unable to find any of the bug reports that touched this area. I'm going to transfer this to SWT for comment to see if they remember anything.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.