|
Re: Cross Viewer Drag & Drop [message #1808672 is a reply to message #1806957] |
Fri, 28 June 2019 13:01   |
|
Hi Gerhard,
thanks to Kyle Girard, drag and drop is actually supported out of the box since 5.1.0. You can quickly test it out by adapting the MVC Logo Example as follows:
1) Bind DragDropGesture as IDomain adapter: The MvcLogoExampleModule class defines a method bindIDomainAdapters() which can be changed as follows:
@Override
protected void bindIDomainAdapters(MapBinder<AdapterKey<?>, Object> adapterMapBinder) {
super.bindIDomainAdapters(adapterMapBinder);
bindPaletteViewerAsDomainAdapter(adapterMapBinder);
adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(DragDropGesture.class);
}
2) Set breakpoint in DragDropGesture where a DragEvent is handled.
3) Drag something into the example application and observe the DragEvent when the breakpoint is hit.
Note that there might be some problems w.r.t. getting the data out of the DragEvent etc.. However, this should be a good starting point. If needed, you can always register a SWT event filter to accommodate for shortcomings w.r.t. JavaFX drag and drop. You might be able to incorporate such extensions in a subclassed DragDropGestureEx.
Best regards,
Matthias
|
|
|
Re: Cross Viewer Drag & Drop [message #1853175 is a reply to message #1808672] |
Tue, 21 June 2022 19:45  |
Gerhard Kreuzer Messages: 6 Registered: May 2019 |
Junior Member |
|
|
Hi Matthias,
I'm late, but I think it's never too late to say THANX!
Your answer put me on the right path, but there is a little subtlety that bothers me. Before I start, a small premise: due to internal restrictions (related to Java 8) we are currently bound to Eclipse 4.16 and GEF 5.3.0 and I have not checked, if my concern has vanished in the current version.
What does bother me, is the fact, that my drag/drop handler does not receive DRAG_ENTERED or DRAG_EXITED calls. I think this is due to bug in the DragDropGesture class, There, the event filters for the cited events are hooked with the scene, but the calls to the policies require, that the event target is an FX node. According to my observation, the ENTERED and EXITED events are delivered to the scene but not to nodes. Therefore I think, that not the ENTERED / EXITED events should be monitored in DragDropGesture, but DRAG_ENTERED_TARGET and DRAG_EXITED_TARGET.
Do you agree? Is this problem still existing in the current version and should I file a bug?
Regards Gerhard
|
|
|
Powered by
FUDForum. Page generated in 0.05871 seconds