Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT.Browser - Drag and Drop problem(Drag and Drop doesn't work)
SWT.Browser - Drag and Drop problem [message #548345] Wed, 21 July 2010 10:27 Go to next message
Eclipse UserFriend
I'm using SWT.Browser instance, created using xulrunner, (SWT.MOZILLA flag in constructor). If the file is dragged and dropped in it, native (I suppose xulrunner's) save as dialog appears. DropTargetEvent cannot be catched using standard swt DND classes, it looks like no event is generated.

Is there any solution for overriding default xulrunner behavior?

This is the code I've used:

final Browser browser = new Browser(getShell(), SWT.MOZILLA);
int operations = DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY;
DropTarget dt = new DropTarget(browser, operations);
Transfer[] types = new Transfer[] { FileTransfer.getInstance() };
dt.setTransfer(types);
dt.addDropListener(new DropTargetListener() {
//.. all functions from this interface are implemented, and none is executed
}
Re: SWT.Browser - Drag and Drop problem [message #549401 is a reply to message #548345] Mon, 26 July 2010 10:52 Go to previous message
Eclipse UserFriend
Hi,

There isn't currently a way to override the natively-provided drop behaviour
for Browsers. This seems like a good request, but I couldn't find an
existing bug for it, so if you want you can log one with swt at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=SWT&bug_severity=enhancement .

Grant


"vstevanovic" <vstevanovic@emisia.net> wrote in message
news:i27058$b77$1@build.eclipse.org...
> I'm using SWT.Browser instance, created using xulrunner, (SWT.MOZILLA flag
> in constructor). If the file is dragged and dropped in it, native (I
> suppose xulrunner's) save as dialog appears. DropTargetEvent cannot be
> catched using standard swt DND classes, it looks like no event is
> generated.
> Is there any solution for overriding default xulrunner behavior?
>
> This is the code I've used:
>
> final Browser browser = new Browser(getShell(), SWT.MOZILLA);
> int operations = DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY;
> DropTarget dt = new DropTarget(browser, operations);
> Transfer[] types = new Transfer[] { FileTransfer.getInstance() };
> dt.setTransfer(types);
> dt.addDropListener(new DropTargetListener() {
> //.. all functions from this interface are implemented, and none is
> executed
> }
Previous Topic:Tables with CHECK: difference between platforms
Next Topic:Possible bug during verify event
Goto Forum:
  


Current Time: Sun Jul 27 14:10:14 EDT 2025

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

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

Back to the top