Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag an object from GEF and drop it in SWT composite
Drag an object from GEF and drop it in SWT composite [message #1798368] Fri, 16 November 2018 09:37 Go to next message
Shenwei Zheng is currently offline Shenwei ZhengFriend
Messages: 22
Registered: December 2016
Junior Member
Use case: click mouse on a JavaFX node, drag it to SWT composite and release mouse.
Initial condition: no element is selected. SelectionModel is empty.
Expected result: the model behind the node will be transferred to SWT composite.

Just after mouse click, a drag source listener is triggerred and drag starts. Here I check the org.eclipse.gef.mvc.fx.models.SelectionModel and it is empty. Drag will not continue. I realize that the selected IVisualPart will be added in SelectionModel after the drag starts.

Does anyone have an idea how to solve this problem? Thank you in advance.

Bests
Shenwei
Re: Drag an object from GEF and drop it in SWT composite [message #1802138 is a reply to message #1798368] Fri, 01 February 2019 18:05 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Shenwei,

GEF "solves" this problem internally by executing IOnClickHandler before IOnDragHandler. In your situation, you probably need to defer the selection-check until the mouse is moved after drag started. Alternatively, you could check the hover model instead of the selection model.

Best regards,
Matthias
Previous Topic:GEF5 And Drag And Drop
Next Topic:Change parent of child on GEF5
Goto Forum:
  


Current Time: Thu Apr 25 23:30:36 GMT 2024

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

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

Back to the top