Page 1 of 1

Custom DropTarget

PostPosted: Fri Jul 31, 2020 1:44 am
by LudovicG
Hi,

I've been trying to override the standard CEF drag & drop behaviour but couldn't find a way.
Is there any way to define your own custom DropTarget to the component from the browser?
And if not, is there a way to disable the standard drag & drop behaviour completely?

Thank you for the help.
Cheers.

Re: Custom DropTarget

PostPosted: Fri Jul 31, 2020 7:57 am
by magreenblatt
CEF supports standard platform drag&drop APIs. If you want to disable dragging into the browser you can use CefDragHandler.onDragEnter.

Re: Custom DropTarget

PostPosted: Mon Aug 03, 2020 2:34 am
by LudovicG
Thanks for the reply.

Yes I noticed that, but I wasn't able to receive any of the drop events by accessing the UI component as if they were consumed before getting to me.
Should I be handling the drag&drop events using javascript instead?

Re: Custom DropTarget

PostPosted: Mon Aug 03, 2020 11:01 am
by magreenblatt
What are you dragging from? What are you dropping into? Any drag/drop events that originate from or terminate within the browser view can be handled via JavaScript.

Re: Custom DropTarget

PostPosted: Tue Aug 04, 2020 3:53 am
by LudovicG
Yes you're right I should have been more precise.

I am trying to drag custom data from swing components to inside the browser.
I would've liked to be able to use the swing DropTarget mechanism to handle the drop into the browser UI component but if that's not possible, then javascript will also work.