SUGGESTED FIX
Name: dsR10078 Date: 10/26/2002
Ideally we should handle the general case when the data provider uses MIME
types instead of the registered selection targets to represent the
available data formats. Anyway, we will have to do it as a part of the
fix for 4638443 (XDnD support), as XDnD protocol explicitly states
that the atom names of the data types are the corresponding MIME types.
This requires substantial changes to the Data Transfer subsystem, so
for Mantis we suggest a minimal solution: add a mapping for text/plain
format to the flavormap.properties.
Note, that this mapping should have lower priority than those for
UTF8_STRING and COMPOUND_TEXT, as this format is unable to represent
an arbitrary Unicode string.
--- flavormap.properties Sat Oct 26 11:38:42 2002
***************
*** 73,78 ****
--- 73,79 ----
TEXT=text/plain;eoln="\n";terminators=0
STRING=text/plain;charset=iso8859-1;eoln="\n";terminators=0
+ text/plain=text/plain;eoln="\n";terminators=0
FILE_NAME=application/x-java-file-list;class=java.util.List
PNG=image/x-java-image;class=java.awt.Image
JFIF=image/x-java-image;class=java.awt.Image
###@###.### 2002-10-26
======================================================================

2002-10-26

EVALUATION
Commit to fix in Mantis.
###@###.### 2002-09-22
Name: dsR10078 Date: 10/26/2002
The cause is that when an URL is dragged from Netscape 6.2, the drag
source exports the following native formats (Atom names are listed):
_NETSCAPE_URL
text/plain
text/unicode
text/x-moz-url
text/html
None of them is a registered selection target (see ICCCM 2.6.2), and
none of them is currently supported by JRE. That's why Java
applications are unable to retrieve the transfer data in this case.
###@###.### 2002-10-26
======================================================================

2002-10-26

WORK AROUND
Name: dsR10078 Date: 09/12/2002
1.Add a new mapping between native format and Java flavor to the SystemFlavorMap.
This can be done with the following static initializer for the class:
-----------------------------------------------------------------------------------
static {
final SystemFlavorMap sfm =
(SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
final String nat = "text/plain";
final DataFlavor df = new DataFlavor("text/plain; charset=ASCII; class=java.io.InputStream", "Plain Text");
sfm.addUnencodedNativeForFlavor(df, nat);
sfm.addFlavorForUnencodedNative(nat, df);
}
-----------------------------------------------------------------------------------
2.Append the following line to the lib/flavormap.properties in the JRE installation:
-----------------------------------------------------------------------------------
text/plain=text/plain;eoln="\n";terminators=0
-----------------------------------------------------------------------------------
With either of the two changes the console output looks as follows:
-----------------------------------------------------------------------------------
[Target] drop
1 flavors available
java.awt.datatransfer.DataFlavor[mimetype=text/plain;representationclass=java.io.InputStream;charset=ASCII]
-----------------------------------------------------------------------------------
and the dropped URL can be successfully retrieved using this flavor.
Note that the first solution enables URL drop support for the single program
run on any JRE installation, while the second solution enables it for any
program run on the single JRE installation.
###@###.### 2002-09-12
======================================================================