Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Unexpected DND Error with GMF 2.1.1
Unexpected DND Error with GMF 2.1.1 [message #202119] Mon, 18 August 2008 03:03 Go to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi,

I just upgraded from Eclipse 3.3 to 3.4, and GMF 2.0.1 to 2.1.1. I have
the structure of my model automatically generated into the Project
Explorer so they may be drag-dropped into an open window to
automatically create shortcuts.

However, I now get this exception when I try to copy across a node:

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.FileTransfer.javaToNative(FileTransfer.j ava:68)
at org.eclipse.swt.dnd.DragSource.GetData(DragSource.java:469)
at org.eclipse.swt.dnd.DragSource.access$7(DragSource.java:435)
at ...

It was working fine in GMF 2.0.1/Eclipse 3.3 - has something changed? Is
there something additional that I now need to do to make this work?

Thanks

Jevon
Re: Unexpected DND Error with GMF 2.1.1 [message #202140 is a reply to message #202119] Mon, 18 August 2008 10:23 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Jevon,

Nothing was intentionally changed in this area.
Can you please check the same situation with Ecore diagram example? In case
you have this problem in both diagrams then this looks like a bug in GMF..
Otherwise I suggest totally regenerating .gmfgen model + code from changed
..gmfmap model.

-----------------
Alex Shatalin
Re: Unexpected DND Error with GMF 2.1.1 [message #205148 is a reply to message #202140] Wed, 10 September 2008 22:59 Go to previous messageGo to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi,

Sorry for the delay in replying. I still haven't had any luck getting
this to work.

I tried regenerating all of my diagram and edit code from .gmfgen with
no success.

I then created a new project with a really basic metamodel:
- Container; contains containers, elements; has attribute title
- Element; has attribute title

Went through the steps to create both Diagram Partitioning (to have
Containers containing Containers) and creating shortcuts (Containers
contain Elements), and I still get the same error:

> 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.FileTransfer.javaToNative(FileTransfer.j ava:68)

One thing I noticed is that even before I enabled shortcuts (by setting
..gmfgen > Editor > Diagram > Contains Shortcuts To and Shortcuts
Provided For) is that I could still drag elements onto the Container,
and it would also get the same error.

GMF allows for the elements to be dragged (with a drag-drop mouse icon)
but once I let go of the mouse button it throws the unhandled loop
exception.

Any ideas? The full exception stack trace is provided below.

Thanks

Jevon
--

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.FileTransfer.javaToNative(FileTransfer.j ava:68)
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(COMOb ject.java:92)
at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
at
org.eclipse.swt.internal.ole.win32.IDataObject.GetData(IData Object.java:25)
at org.eclipse.swt.dnd.FileTransfer.nativeToJava(FileTransfer.j ava:120)
at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:442)
at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:257 )
at
org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMOb ject.java:119)
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.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.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: 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)


Alex Shatalin wrote:
> Hello Jevon,
>
> Nothing was intentionally changed in this area.
> Can you please check the same situation with Ecore diagram example? In
> case you have this problem in both diagrams then this looks like a bug
> in GMF.. Otherwise I suggest totally regenerating .gmfgen model + code
> from changed .gmfmap model.
>
> -----------------
> Alex Shatalin
>
>
>
Re: Unexpected DND Error with GMF 2.1.1 [message #205308 is a reply to message #205148] Thu, 11 September 2008 11:47 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Jevon,

Can you reproduce this problem with Ecore diagram editor on latest GMF (2.1)?

-----------------
Alex Shatalin
Re: Unexpected DND Error with GMF 2.1.1 [message #207835 is a reply to message #205308] Mon, 06 October 2008 02:00 Go to previous messageGo to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hi Alex,

Yes, I can reproduce this error with the latest GMF 2.1.2. I have
submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=249718.

Jevon

Alex Shatalin wrote:
> Hello Jevon,
>
> Can you reproduce this problem with Ecore diagram editor on latest GMF
> (2.1)?
>
> -----------------
> Alex Shatalin
>
>
Re: Unexpected DND Error with GMF 2.1.1 [message #208137 is a reply to message #202119] Thu, 09 October 2008 09:13 Go to previous messageGo to next message
Hugues Rérolle is currently offline Hugues RérolleFriend
Messages: 60
Registered: July 2009
Member
Hi,

Since I've upgraded in GMF 2.1, I have the same problem with drag and
drop object from model (into project explorer) to diagram.

My application can't work without this feature!

Thanks in advance

Hugues
Re: Unexpected DND Error with GMF 2.1.1 [message #208637 is a reply to message #208137] Wed, 15 October 2008 08:31 Go to previous message
Hugues Rérolle is currently offline Hugues RérolleFriend
Messages: 60
Registered: July 2009
Member
Hi,

I found a solution to authorize drag and drop between navigator and diagram

You have to Modify "inputChanged" method of
XXXDomainNavigatorContentProvider like this :

public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
myViewer = viewer;
if (myViewer != null) {
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
Control myControl = myViewer.getControl();
DragSource dragSource = (DragSource) myControl
.getData(DND.DRAG_SOURCE_KEY);
dragSource.setTransfer(transfers);
dragSource.addDragListener(new ViewerDragAdapter(myViewer));
DropTarget dropTarget = (DropTarget) myControl
.getData(DND.DROP_TARGET_KEY);
dropTarget.setTransfer(transfers);
dropTarget.addDropListener(new EditingDomainViewerDropAdapter(
myEditingDomain, myViewer));
}
}

I don't know if it's a proper solution but it's working for me

Hugues


Hugues Rérolle wrote:
> Hi,
>
> Since I've upgraded in GMF 2.1, I have the same problem with drag and
> drop object from model (into project explorer) to diagram.
>
> My application can't work without this feature!
>
> Thanks in advance
>
> Hugues
Previous Topic:Phatom node keep referencing a deleted element => save impossible !
Next Topic:XXXViewFactory.decorateView -> different behavior in GMF 2.1 vs. GMF 2.1.1
Goto Forum:
  


Current Time: Tue Jan 26 13:37:43 GMT 2021

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

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

Back to the top