<AWT Dev> 4899516: Transferable has no DataFlavors when dragging from Gnome window to Swing
damjan.jov at gmail.com
Sun Sep 30 23:41:46 PDT 2007
On 9/27/07, Denis S. Fokin <Denis.Fokin at sun.com> wrote:
> Hi Damjan,
> personally, I like the idea to implement a set of predefined DataFlavours. In particular to provide predefined DataFlavor represented a List of URI is very good idea.
> But I do not like idea to modify the handling of DataFlavor.javaFileListFlavor flavor.
> There are two issues bothering me.
> 1. list of Files could be empty.
> 2. the question how to convert URI in File is open. How we should interpret "ftp:///" protocol in this case? Would be our new interpretation compatible with existing applications and so on.
> Another solution which I see is to keep the current handling of DataFlavor.javaFileListFlavor flavor unchangeable. But mark it as deprecated. Like it is done whith the DataFlavor.plainTextFlavor. And suggest to use the new URI list data flavor instead of the deprecated one.
> The new data flavor will contain list of URI and will cover all protocols. On Windows all returned URI will be URI of files.
> In that case, another question that should be answered is if we will convert native uri-list mime type at the same time in DataFlavor.javaFileListFlavor and a list of URI, should we do the same conversation when transfer is local or intra-jvm? In case of transfer between two java applications, user could provide only URI list flavor. Should we provide DataFlavor.javaFileListFlavor to target as well in that case?
> So the second solution has it's own issues but looks much more appropriate for me.
Ok I'm sorry for arguing so much. Less talk more code :-).
This weekend I started writing code for URIListFlavor, but I quickly
realized another problem. If you deprecate javaFileListFlavor and use
URIListFlavor, the problem still exists in the opposite direction:
when Java is the drag source and a native application the drop target,
on non-XDnD implementations you still have to do lossy conversion from
URIs to Files and somehow disregard non-local-file URIs, and possibly
provide the native application with an empty file list.
> Thank you,
More information about the awt-dev