Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » Drag'n'Drop copies object instead of moving it
Drag'n'Drop copies object instead of moving it [message #1749491] Wed, 07 December 2016 10:47 Go to next message
Roman Zimmer is currently offline Roman ZimmerFriend
Messages: 27
Registered: November 2010
Junior Member
Hey @ll,

in our e4 RCP application we use EMF Parsley for displaying structured data in a tree viewer. Thanks to the ViewerDragAndDropHelper, we get nice a nice drag'n'drop experience out of the box:

ViewerDragAndDropHelper dragAndDropHelper = injector.getInstance(ViewerDragAndDropHelper.class);
EditingDomain editingDomain = injector.getInstance(EditingDomain.class);
dragAndDropHelper.addDragAndDrop(structuredViewer, editingDomain);


(structuredViewer is a normal JFace TreeViewer)

Given the following data:

index.php/fa/27806/0/

When I drag Child 1 "inside" Parent 1, it works just fine and as expected, i.e. I can move it before or after Child 2, holding CTRL I can copy the object.

When I drag Child 1 inside Parent 2, it allows me only to copy the element, i.e. moving (=changing Child 1's parent from Parent 1 to Parent 2) is not possible.

Any idea, what I might doing wrong? Should this be supported out of the box? Might this result from a problem in my ecore-model? Can I workaround the issue or is this a bug?

Any help is appreciated, thanks a lot in advance!
Re: Drag'n'Drop copies object instead of moving it [message #1749852 is a reply to message #1749491] Tue, 13 December 2016 09:05 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1814
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi Roman

I would tend to say that this is due to some constraint in your ecore model, since the default implementation of drag and drop in Parsley is simply delegating to the default one of EMF.
If you open your model with the standard EMF editor do you get the same behavior?


Re: Drag'n'Drop copies object instead of moving it [message #1750298 is a reply to message #1749852] Mon, 19 December 2016 17:12 Go to previous messageGo to next message
Roman Zimmer is currently offline Roman ZimmerFriend
Messages: 27
Registered: November 2010
Junior Member
Hey Lorenzo,
thanks for your reply! It resulted that we used the EditingDomain returned by the injector and not the one assigned to our domain model. Using the latter one, drag'n'drop seems to work flawless now.
Re: Drag'n'Drop copies object instead of moving it [message #1750343 is a reply to message #1750298] Tue, 20 December 2016 08:25 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1814
Registered: July 2009
Location: Firenze, Italy
Senior Member
Yes, indeed if the model has already an EditingDomain it's better to use that one Smile

Just for future references for other users, could you please post how you fixed your code?

thanks
Lorenzo


Previous Topic:Support for StyledLabelProvider or how to use StyledStrings in LabelProviders
Next Topic:EMF Parsley 1.1.0 Released
Goto Forum:
  


Current Time: Mon Oct 14 02:41:14 GMT 2024

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

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

Back to the top