Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » D&D in TextEditor
D&D in TextEditor [message #867364] Tue, 01 May 2012 08:53 Go to next message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 424
Registered: September 2009
Senior Member
Is TextEditor supposed to support D&D without further customization?
I do get the following error:

!ENTRY org.eclipse.ui 4 0 2012-05-01 10:33:50.865
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at org.eclipse.ui.internal.EditorSiteDragAndDropServiceImpl$1.dragLeave(EditorSiteDragAndDropServiceImpl.java:107)
at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:70)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:403)
at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at it.condarelli.writer.Writer.start(Writer.java:42)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)



I also traced the call to initializeDragAndDrop(getSourceViewer());, but
Platform.getAdapterManager().loadAdapter(this, "org.eclipse.ui.texteditor.ITextEditorDropTargetListener");
returns null.
It seems to install correctly installTextDragAndDrop(viewer).

but it doesn't work because in the DropTargetEvent data, dataTypes and currentDataType are all null.
Get ApprporiateListener() tries to return secondaryListener, but that is also null.

What do I miss?

TiA
Mauro
Re: D&D in TextEditor [message #868991 is a reply to message #867364] Wed, 02 May 2012 20:24 Go to previous message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 424
Registered: September 2009
Senior Member
On 01/05/2012 10:53, Mauro Condarelli wrote:
> Is TextEditor supposed to support D&D without further customization?
> I do get the following error:
>
> !ENTRY org.eclipse.ui 4 0 2012-05-01 10:33:50.865
> !MESSAGE Unhandled event loop exception
> !STACK 0
> java.lang.NullPointerException
> at org.eclipse.ui.internal.EditorSiteDragAndDropServiceImpl$1.dragLeave(EditorSiteDragAndDropServiceImpl.java:107)
> at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:70)

I seem to have hit the same misbehavior described in:
http://www.eclipse.org/forums/index.php/m/333816/3c7da5f6adf4288d241ba57a13d72a3d/#msg_333816

The workaround described there works for me.

Can someone suggest a "more proper" fix?
That one involves ignoring "restrictions" in the lib.

I was not able to find an associated bug; should I open one?

Regards
Mauro

> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
> at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:403)
> at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258)
> at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
> at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
> at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
> at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
> at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at it.condarelli.writer.Writer.start(Writer.java:42)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 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:344)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
>
>
>
> I also traced the call to initializeDragAndDrop(getSourceViewer());, but
> Platform.getAdapterManager().loadAdapter(this, "org.eclipse.ui.texteditor.ITextEditorDropTargetListener");
> returns null.
> It seems to install correctly installTextDragAndDrop(viewer).
>
> but it doesn't work because in the DropTargetEvent data, dataTypes and currentDataType are all null.
> Get ApprporiateListener() tries to return secondaryListener, but that is also null.
>
> What do I miss?
>
> TiA
> Mauro
Previous Topic:Add .exe in a View of RCP
Next Topic:How to call data binding from a toolbar handler
Goto Forum:
  


Current Time: Sat Oct 25 00:49:39 GMT 2014

Powered by FUDForum. Page generated in 0.01622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software