Unexpected DND Error with GMF 2.1.1 [message #202119] |
Sun, 17 August 2008 23:03  |
Eclipse User |
|
|
|
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 #208637 is a reply to message #208137] |
Wed, 15 October 2008 04:31  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.30851 seconds