dragging element disappears with this line [message #162250] |
Fri, 23 November 2007 05:36  |
Eclipse User |
|
|
|
Hello! Trying to port a drag&drop from the navigator view to an element on
the stage, unsuccessfully by now.
What happens is that I have this method to modify:
protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
//This line destroy the dragged element
getGraphicalViewer().addDropTargetListener(new
textTransferDropTargetListener(getGraphicalViewer(),
FileTransfer.getInstance()));
}
and I add (as happening on some tutorials, and in my old gmf1 source) the
commented line: as I do that move, no matter what, the element I was
dragging around get killed and disposed as soon as I enter the stage view
(the designer view.. if you prefer.. where the nodes are displayed anyway).
I tried to adapt some of the code portions found here but none of them
helped me to obtain a working draggable function, the cursor always
remains to "denied" state when I try to dnd. Implementing carefully line
by line the old source I have to port... as I arrive to that
"addDropTargetListener" the icon of the dragged item is no longer
denied... it disappears and returns to a normal arrow-pointer as if you
never dragged anything!
What is the matter? I've placed debug print outputs in every method of the
listener class being involved, and none of them gets printed so the
listener class isn't called. Or gets disposed before construction.
I don't know what to do, If you have an idea on how I may implement a
drag&drop under gmf2...
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.47920 seconds