How to drag and drop an item from a view to the diagram #555
-
i have a view that has elements from an ecore model, instead of using the palette I wanted to do DnD from the view to the diagram editor. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no generic base implementation for DnD from other views outside of the diagram, because those other views define their custom transfer objects. However, you can of course implement that based on plain browser technologies; we've done that in a customer project. Roughly speaking, you need to put your custom object into the data transfer from the drag source and react to the drop event on the diagram element and process your transfer object. Most of it is not really GLSP-specific but more related to HTML drag and drop. The GLSP specific thing is then just to dispatch a GLSP action on drop of your object. |
Beta Was this translation helpful? Give feedback.
There is no generic base implementation for DnD from other views outside of the diagram, because those other views define their custom transfer objects. However, you can of course implement that based on plain browser technologies; we've done that in a customer project.
Roughly speaking, you need to put your custom object into the data transfer from the drag source and react to the drop event on the diagram element and process your transfer object. Most of it is not really GLSP-specific but more related to HTML drag and drop. The GLSP specific thing is then just to dispatch a GLSP action on drop of your object.