Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag & Drop in GEF
Drag & Drop in GEF [message #198560] Wed, 12 October 2005 14:17 Go to next message
Sami Lakka is currently offline Sami LakkaFriend
Messages: 47
Registered: July 2009
Member
Hello,

I'm trying to implement D&D functionality from package explorer to my GEF
diagram. I'm following the article in :
http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html and somehow I'm
getting following exception when I'm dragging a file from package explorer
to the diagram:

java.lang.NullPointerException
at org.eclipse.swt.dnd.DropTarget.setEventData(DropTarget.java: 628)
at org.eclipse.swt.dnd.DropTarget.DragEnter(DropTarget.java:253 )
at org.eclipse.swt.dnd.DropTarget.access$4(DropTarget.java:247)
at org.eclipse.swt.dnd.DropTarget$3.method3(DropTarget.java:233 )
at
org.eclipse.swt.internal.ole.win32.COMObject.callback3(COMOb ject.java:90)
at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:277)
at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:267)
at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java :161)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

This exception comes immeaditely when the mouse enters the diagram area.
What is going wrong?


Best Regards,
- Sami
Re: Drag & Drop in GEF [message #198946 is a reply to message #198560] Thu, 13 October 2005 14:16 Go to previous messageGo to next message
Sami Lakka is currently offline Sami LakkaFriend
Messages: 47
Registered: July 2009
Member
The following code in the article :

getGraphicalViewer().addDropTargetListener(
new FileTransferDropTargetListener(getGraphicalViewer()));should be
replaced with:

getGraphicalViewer().addDropTargetListener(
new
FileTransferDropTargetListener(getGraphicalViewer(),FileTran sfer.getInstance()));



"Sami Lakka" <sami.lakka@tut.fi> kirjoitti
viestiss
Re: Drag & Drop in GEF [message #198962 is a reply to message #198946] Thu, 13 October 2005 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Please open a bug report.

"Sami Lakka" <sami.lakka@tut.fi> wrote in message
news:dilq8i$4qi$1@news.eclipse.org...
> The following code in the article :
>
> getGraphicalViewer().addDropTargetListener(
> new FileTransferDropTargetListener(getGraphicalViewer()));should be
> replaced with:
>
> getGraphicalViewer().addDropTargetListener(
> new
>
FileTransferDropTargetListener(getGraphicalViewer(),FileTran sfer.getInstance
()));
>
>
>
> "Sami Lakka" <sami.lakka@tut.fi> kirjoitti
> viestiss
Re: Drag & Drop in GEF [message #198979 is a reply to message #198962] Thu, 13 October 2005 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

Article that describes D&D functionality is using methods that are
deprecated. How should it be done to be done properly?
Or there is no other way of doing this just the one described in article?

Cheers, Greg

Pratik Shah wrote:
> Please open a bug report.
>
> "Sami Lakka" <sami.lakka@tut.fi> wrote in message
> news:dilq8i$4qi$1@news.eclipse.org...
>
>>The following code in the article :
>>
>>getGraphicalViewer().addDropTargetListener(
>> new FileTransferDropTargetListener(getGraphicalViewer()));should be
>>replaced with:
>>
>> getGraphicalViewer().addDropTargetListener(
>> new
>>
>
> FileTransferDropTargetListener(getGraphicalViewer(),FileTran sfer.getInstance
> ()));
>
>>
>>
>>"Sami Lakka" <sami.lakka@tut.fi> kirjoitti
>>viestissä:dij5tn$rnk$1@news.eclipse.org...
>>
>>>Hello,
>>>
>>>I'm trying to implement D&D functionality from package explorer to my
>
> GEF
>
Re: Drag & Drop in GEF [message #199037 is a reply to message #198979] Thu, 13 October 2005 17:21 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

The javadoc of the deprecated methods mentions which methods should be used
instead. They have the same name.

"Greg" <greg.gigon@tugulu.com> wrote in message
news:dim1g3$fej$1@news.eclipse.org...
> Article that describes D&D functionality is using methods that are
> deprecated. How should it be done to be done properly?
> Or there is no other way of doing this just the one described in article?
>
> Cheers, Greg
>
> Pratik Shah wrote:
> > Please open a bug report.
> >
> > "Sami Lakka" <sami.lakka@tut.fi> wrote in message
> > news:dilq8i$4qi$1@news.eclipse.org...
> >
> >>The following code in the article :
> >>
> >>getGraphicalViewer().addDropTargetListener(
> >> new FileTransferDropTargetListener(getGraphicalViewer()));should
be
> >>replaced with:
> >>
> >> getGraphicalViewer().addDropTargetListener(
> >> new
> >>
> >
> >
FileTransferDropTargetListener(getGraphicalViewer(),FileTran sfer.getInstance
> > ()));
> >
> >>
> >>
> >>"Sami Lakka" <sami.lakka@tut.fi> kirjoitti
> >>viestiss
Previous Topic:Custom view and ... ??
Next Topic:Crash with empty Labels on Linux
Goto Forum:
  


Current Time: Sun Nov 03 23:49:49 GMT 2024

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

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

Back to the top