Custom DropTarget

Having problems with building or using the JCEF Java binding? Ask your questions here.

Custom DropTarget

Postby LudovicG » Fri Jul 31, 2020 1:44 am

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.
LudovicG
Newbie
 
Posts: 5
Joined: Thu Jun 04, 2020 2:34 am

Re: Custom DropTarget

Postby magreenblatt » Fri Jul 31, 2020 7:57 am

CEF supports standard platform drag&drop APIs. If you want to disable dragging into the browser you can use CefDragHandler.onDragEnter.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Custom DropTarget

Postby LudovicG » Mon Aug 03, 2020 2:34 am

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?
LudovicG
Newbie
 
Posts: 5
Joined: Thu Jun 04, 2020 2:34 am

Re: Custom DropTarget

Postby magreenblatt » Mon Aug 03, 2020 11:01 am

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.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Custom DropTarget

Postby LudovicG » Tue Aug 04, 2020 3:53 am

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.
LudovicG
Newbie
 
Posts: 5
Joined: Thu Jun 04, 2020 2:34 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 7 guests