DragAndDrop + FileDrag and drag image

Howdy, Im trying to achieve something here but fail and hope that someone has solved it, or has any ideas how to solve it.


This is what im trying to achieve.

* I have a file list where i can drag stuff from (using startDragging(...))

* I have a drop area which accepts both filesDropped(...) and itemDropped(...)

* When I drag a file I make some custom image for the drag which is properly displayed as long as im inside the application.

* When i drag outside the window the current drag is terminated (dragOperationEnded() is called) and a external drag is started. (since i overrided shouldDropFilesWhenDraggedExternally(...))

* If i then drag back to the application, I start recieving fileDragMove(...) events instead of itemDragMove(...) events (obviously), but i still want to display the image i passed in to startDragging(...)

* I would also prefer to know when the drag is completed (i.e. the user dropped some files on desktop) but i cant find something along those lines, how would i go about doing that?


So basically what happens now is that as long as im dragging inside the application, an image of what im dragging is shown, if i then leave the window and then go back to dragging over the file list, a "cannot-drop-here-icon" is shown instead of the fancy custom image.


I feel I suck at explaining myself, so if all fails, I want the behaviour that is used in the file explorer on a windows PC. Try dragging a text file from the file explorer, to visual studio for example and then back to see what i mean :)


Thanks for any input in this.