Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » DND between Jface Tree View and GraphicalEditorWithPalette
DND between Jface Tree View and GraphicalEditorWithPalette [message #878594] Tue, 29 May 2012 15:21 Go to next message
ModelGeek Mising name is currently online ModelGeek Mising name
Messages: 519
Registered: June 2011
Senior Member
In my RCP application i am trying to have DnD between TreeView and GraphicalEditor(GEF). I am able to add Drag Support on treeview but graphical editor does not call drop method.

treeView.addDragSupport(DND.DROP_COPY, new Transfer[] { TemplateTransfer.getInstance() }, new DragSourceListener() {

@Override
public void dragStart(DragSourceEvent event) {
event.doit = true;

}

@Override
public void dragSetData(DragSourceEvent event) {
IStructuredSelection selection = (IStructuredSelection)treeView.getSelection();
Object obj = selection.getFirstElement();
event.data = obj;
}

@Override
public void dragFinished(DragSourceEvent event) {
IStructuredSelection selection = (IStructuredSelection)treeView.getSelection();
Object obj = selection.getFirstElement();
event.data = obj;

}
});

---------------------
protected void initializeGraphicalViewer() {
.....
.....
viewer.addDropTargetListener(new test(viewer));
}
--------------

private class test extends TemplateTransferDropTargetListener {

public test(EditPartViewer viewer) {
super(viewer);
// TODO Auto-generated constructor stub
}

@Override
public void drop(DropTargetEvent event) {
System.out.println("drop");
super.drop(event);
}
}

thanks!

cheers,
Re: DND between Jface Tree View and GraphicalEditorWithPalette [message #887298 is a reply to message #878594] Sat, 16 June 2012 11:00 Go to previous message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi,

did you look at this article?
http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
Previous Topic:Eclipse 4 Application Tutorial available (for Eclipse 4.2 M5)
Next Topic:Help with RCP from existing .jars
Goto Forum:
  


Current Time: Thu Oct 30 14:46:03 GMT 2014

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

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