Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Supress drag and drop default behavior(delete automatically created view when dragging from model explorer)
Supress drag and drop default behavior [message #1780251] Fri, 19 January 2018 09:51 Go to next message
Amine Kechaou is currently offline Amine KechaouFriend
Messages: 32
Registered: April 2016
Location: Karlsruhe, Germany
Member
[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.

Hi everyone,

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).

index.php/fa/31853/0/

index.php/fa/31855/0/

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.

index.php/fa/31854/0/

The view D at the right in the screenshot is then created automatically, which is undesired.

index.php/fa/31856/0/

The VSM and the source code are available here: https://github.com/kit-sdq/MRS-Editor/tree/master/mrs.design

Kind regards,
Amine
  • Attachment: metamodel.PNG
    (Size: 3.53KB, Downloaded 305 times)
  • Attachment: after.PNG
    (Size: 3.43KB, Downloaded 235 times)
  • Attachment: before.PNG
    (Size: 1.11KB, Downloaded 260 times)
  • Attachment: drag and drop.PNG
    (Size: 21.99KB, Downloaded 229 times)

[Updated on: Fri, 19 January 2018 10:25]

Report message to a moderator

Re: Supress drag and drop default behavior [message #1780294 is a reply to message #1780251] Fri, 19 January 2018 16:24 Go to previous message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi Amine,

There is no better soluton than your solution to modify the semantic candidate expression.
You can create a bugzillia (feature request) to purpose to have a new user possibility to say, no create vIew after drag and drop.

Regards,
Previous Topic:Updating EEF from 1.5 to 1.9
Next Topic:How to add keyboard shortcut for Operation Action
Goto Forum:
  


Current Time: Fri Apr 26 18:14:16 GMT 2024

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

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

Back to the top