Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag from SWT to Desktop
Drag from SWT to Desktop [message #412360] Fri, 23 January 2004 17:27 Go to next message
Eclipse UserFriend
Originally posted by: daniel.gaiottino.com

Hi there,

I am trying to work with SWT and find it much easier to work with than
Java SWING. I am having one problem though in my project. I am comverting
an application i wrote with Suns java & swing into SWT and cannot seem to
find how to drag from my SWT application to my desktop.

I had no problem dragging an image from my desktop ontop of a canvas and
then displaying the image on the canvas, but i cant seem to figure out how
to drag an image on a canvas to my desktop. I have enebled Drag from my
canvas and can Drag/Drop between two canvases but not to my desktop or any
other native folder.

Had i gotten the path of where my drop occured then i could just create a
new file there but i am not getting this either.

Could someone show me a snippet for this or let me know how to proceed?
I've read the Drag and Drop articles but didn't get any wiser. A kick in
the right direction would be great.

Thanks,
Daniel
Re: Drag from SWT to Desktop [message #412541 is a reply to message #412360] Mon, 26 January 2004 13:03 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
What type of transfer is your drag source providing? Are you using
FileTransfer or have you written your own image transfer class?


"Daniel Gaiottino" <daniel@gaiottino.com> wrote in message
news:burli4$fq6$1@eclipse.org...
> Hi there,
>
> I am trying to work with SWT and find it much easier to work with than
> Java SWING. I am having one problem though in my project. I am comverting
> an application i wrote with Suns java & swing into SWT and cannot seem to
> find how to drag from my SWT application to my desktop.
>
> I had no problem dragging an image from my desktop ontop of a canvas and
> then displaying the image on the canvas, but i cant seem to figure out how
> to drag an image on a canvas to my desktop. I have enebled Drag from my
> canvas and can Drag/Drop between two canvases but not to my desktop or any
> other native folder.
>
> Had i gotten the path of where my drop occured then i could just create a
> new file there but i am not getting this either.
>
> Could someone show me a snippet for this or let me know how to proceed?
> I've read the Drag and Drop articles but didn't get any wiser. A kick in
> the right direction would be great.
>
> Thanks,
> Daniel
>
Re: Drag from SWT to Desktop [message #415398 is a reply to message #412360] Sat, 31 January 2004 21:42 Go to previous messageGo to next message
Simon Rutishauser is currently offline Simon RutishauserFriend
Messages: 48
Registered: July 2009
Member
Daniel Gaiottino wrote:
> I am trying to work with SWT and find it much easier to work with than
> Java SWING.

Right. Swing is easier to use. But SWT seems to be better - or else you
wouldn't be using it, would you?

> I am having one problem though in my project. I am comverting
> an application i wrote with Suns java & swing into SWT and cannot seem to
> find how to drag from my SWT application to my desktop.
>
> I had no problem dragging an image from my desktop ontop of a canvas and
> then displaying the image on the canvas, but i cant seem to figure out how
> to drag an image on a canvas to my desktop. I have enebled Drag from my
> canvas and can Drag/Drop between two canvases but not to my desktop or any
> other native folder.
>
> Had i gotten the path of where my drop occured then i could just create a
> new file there but i am not getting this either.
>
> Could someone show me a snippet for this or let me know how to proceed?
> I've read the Drag and Drop articles but didn't get any wiser. A kick in
> the right direction would be great.

Well, you're doing file transfer Drag and Drop here, right?
There are lots of snippets around about this. (On the snippet page of
course)
Uh, I see I'm wrong here ;-) Never mind.

Unfortunately I don't have any simple sample. The only one I have is quite
complicated so I won't send it.

Simon
Re: Drag from SWT to Desktop [message #1050240 is a reply to message #415398] Fri, 26 April 2013 22:51 Go to previous message
Ned Twigg is currently offline Ned TwiggFriend
Messages: 9
Registered: April 2013
Junior Member
I know this is an old thread, but I've got the exact same problem. Looks like this problem has come up for a couple people, and nobody's found an answer. Looks like Simon might have one though!

I've posted some example code on StackOverflow, but I can't link to it because I don't have enough cred on the Eclipse.org forums... Here's the URL for copy-pasting:

stackoverflow.com/questions/16246242/swt-drag-to-explorer-windows-or-finder-os-x

Simon - if you've still got your complicated example, I'd be more than happy to simplify it if you don't have time.

Thanks!
-Ned
Previous Topic:Convert Image from BMP to GIF
Next Topic:Table Cell and two progress bars
Goto Forum:
  


Current Time: Thu Apr 18 08:47:43 GMT 2024

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

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

Back to the top