Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:27 Go to next message
Vladimir Stevanovic is currently offline Vladimir StevanovicFriend
Messages: 29
Registered: March 2010
Junior Member
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 14:52 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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: Thu Apr 25 05:36:42 GMT 2024

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

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

Back to the top