|Supress drag and drop default behavior [message #1780251]
||Fri, 19 January 2018 09:51
| Amine Kechaou
Registered: April 2016
Location: Karlsruhe, Germany
[EDIT, RESOLVED] I managed to fix the problem by adding a semantic candidates expression that restrains the candidates to the direct children of the container only. For EClassifiers feature:eClassifiers and for EPackages feature:eSubpackages. I originally thought that the semantic candidates expression should be kept empty when the element is set to Not synchronized (which is needed in my case). But if you have a solution to suppress the default behavior of the drag and drop, I would still love to know it. |
I'm currently implementing a functionality in my editor that allows the user to drag elements from the project dependencies in the model explorer (e.g. an EClass) and drop them into the representation. The custom behavior that I implemented creates views for the corresponding containers (e.g. EPackage) of the dropped element and then creates a view for the element itself.
Now I noticed that per default the drag and drop will automatically create a view for the dropped element in newContainerView. Is there any way I can suppress this behavior? Because now I end up with two views. And it seems that the automatically created view is only created after that my implementation of the custom drag and drop terminates. That means I cannot access the automatically created view from within the Begin block and therefore cannot use "Delete view" to delete it.
To illustrate the problem, here is an example, where I try to drag and drop the EClass D into the inside of the container Metamodel (the root package, i.e. metamodel).
When there is still no view of the EClass D, the custom drag and drop creates the necessary containers (the EPackages P1 and P2) and then creates a view for D inside P2.
The view D at the right in the screenshot is then created automatically, which is undesired.
The VSM and the source code are available here: https://github.com/kit-sdq/MRS-Editor/tree/master/mrs.design
(Size: 3.53KB, Downloaded 248 times)
(Size: 3.43KB, Downloaded 178 times)
(Size: 1.11KB, Downloaded 170 times)
Attachment: drag and drop.PNG
(Size: 21.99KB, Downloaded 169 times)
[Updated on: Fri, 19 January 2018 10:25]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01866 seconds