Skip to main content



      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 04:37 Go to next message
Eclipse UserFriend
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 13:05 Go to previous message
Eclipse UserFriend
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: Tue Apr 22 13:33:40 EDT 2025

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

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

Back to the top