Drag and Drop from outside RAP [message #1166273] |
Fri, 01 November 2013 18:24  |
Eclipse User |
|
|
|
Hello,
I would like to be able to drop images or text file from another browser window to my application.
Label image = toolkit.createLabel(header, "", SWT.NO_FOCUS);
image.setImage(DEFAULT_IMAGE);
int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT | DND.DROP_LINK;
Transfer[] tt = new Transfer[] { TextTransfer.getInstance(), FileTransfer.getInstance(), ImageTransfer.getInstance(), URLTransfer.getInstance()};
DropTarget target = new DropTarget(image, operations);
target.setTransfer(tt);
// ImageDropListener only implements DropListener methods by loggin its name.
target.addDropListener(new ImageDropListener());
The ImageDropListener implements DropTargetListener and is correctly called when drag and dropping from within the RAP application, but when I'm draging an image from the web, i get the "DROP_LINK" decoration but that's all.
I'm using Rap 2.1.0
Do I miss something ? Is there an entry point to register somewhere or is this functionality not yet implemented ?
I was full of hope until I found this message http://www.eclipse.org/forums/index.php/mv/msg/204387/653628/#msg_653628 and no bug / enhencement request in the bug tracker...
Thanks,
Bruno
|
|
|
Re: Drag and Drop from outside RAP [message #1169796 is a reply to message #1166273] |
Mon, 04 November 2013 02:39   |
Eclipse User |
|
|
|
Hi Bruno,
drag and drop is currently possible only inside RAP application.
Best,
Ivan
On 11/2/2013 12:24 AM, Bruno Sinou wrote:
> Hello,
> I would like to be able to drop images or text file from another
> browser window to my application.
>
> Label image = toolkit.createLabel(header, "", SWT.NO_FOCUS);
> image.setImage(DEFAULT_IMAGE);
>
> int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT |
> DND.DROP_LINK;
> Transfer[] tt = new Transfer[] { TextTransfer.getInstance(),
> FileTransfer.getInstance(), ImageTransfer.getInstance(),
> URLTransfer.getInstance()};
> DropTarget target = new DropTarget(image, operations);
> target.setTransfer(tt);
> // ImageDropListener only implements DropListener methods by loggin
> its name. target.addDropListener(new ImageDropListener());
>
>
> The ImageDropListener implements DropTargetListener and is correctly
> called when drag and dropping from within the RAP application, but
> when I'm draging an image from the web, i get the "DROP_LINK"
> decoration but that's all.
> I'm using Rap 2.1.0
>
> Do I miss something ? Is there an entry point to register somewhere or
> is this functionality not yet implemented ?
>
> I was full of hope until I found this message
> http://www.eclipse.org/forums/index.php/mv/msg/204387/653628/#msg_653628
> and no bug / enhencement request in the bug tracker...
>
> Thanks,
> Bruno
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
Powered by
FUDForum. Page generated in 0.28011 seconds