rich client 2.0

Drag and Drop from JFace-Viewer to GEF-Editor


4. October 2006
Tom Seidel @ 19:15

jface_gef_title.pngDo you know the palette from GEF?- It is THE Creation Tool for graphical Editors based on GEF. Unfortunately the requirement is often to drag and drop already created objects into the graphical viewer, e.g from a navigation view, or another JFace-Viewer. Therefore you have to implement your own Drag’n Drop mechanism that is also compatible with the EditPart concept and your Commands. Today I want to show you a way how to drag elements from a TableViewer and drop them on my EditParts. Before dropping the elements you have the possibility to hook in your own code for showing an additional wizard/dialog or if you want to manipulate/replace/adapt the dragged model-object. I have written a small manager and that decides when and how a drop is allowed and how to process the dropped data.

Let me tell the truth. It’s not as difficult as it sounds. :)

(more…)

Powered by WordPress