Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Drag File out a View to Package Explorer
Drag File out a View to Package Explorer [message #325548] Thu, 21 February 2008 13:44 Go to next message
Eclipse UserFriend
Originally posted by: andy.auyeung.3ds.com

I want to drag an item from my View to the Package Explorer as a file. The
code below doesn't do the job. Does anyone know how to correct it ?

class MyDragSource implements DragSourceListener
{ .
.
.
public void dragSetData(DragSourceEvent event)
{
if (FileTransfer.getInstance().isSupportedType(event.dataType))
{
event.data = new File("c:\\abc.txt");
}
}
}
Re: Drag File out a View to Package Explorer [message #325557 is a reply to message #325548] Thu, 21 February 2008 18:10 Go to previous message
Eclipse UserFriend
You could check FileTransfer checkFile only accept String array.
So, you set data = new String[]{thefilename...} is ok


Andy 写道:
> I want to drag an item from my View to the Package Explorer as a file.
> The code below doesn't do the job. Does anyone know how to correct it ?
>
> class MyDragSource implements DragSourceListener
> { .
> .
> .
> public void dragSetData(DragSourceEvent event)
> {
> if (FileTransfer.getInstance().isSupportedType(event.dataType))
> {
> event.data = new File("c:\\abc.txt"); }
> }
> }
>
Previous Topic:Opening an editor without bringing it to top
Next Topic:getProject().getRawLocation() returns null
Goto Forum:
  


Current Time: Sun May 11 09:16:55 EDT 2025

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

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

Back to the top