[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Dropping Java objects as text

David Huebel wrote:
Is this true?  I haven't created a new TransferData subclass.  As far as I
know, MyInternalTransfer could be chosen whenever the drop target requests
a transfer type that uses a byte array as its "native" form.  The way I
understand it is that the drag source's MyInternalTransfer instance dragT
offers up a TransferData instance td, and if the drop target mentions a
Transfer instance dropT for which dropT.isSupportedType(td) returns true,
then the drag-and-drop framework will use dragT.javaToNative and
dropT.nativeToJava.  This can happen even when dragT and dropT are
instances of different classes, or when dropT is native code in a
different, non-Eclipse application.  That's why I'm worried about the
circumstances under which isSupportedType might return true for different

I believe most of your concerns here have been answered in my other reply so there's no need to repeat myself.


types.  It makes sense that byte arrays and strings might be considered
compatible for DND purposes under some platforms.

Bytes and strings are not compatible for DND -- first they have different type ids so they will not be accepted -- isSupportedType will be false. Secondly, when bytes are converted to strings we must know the encoding (unicode, UTF-16, ASCII) and with the wrong decoding the string can become garbage.


Duong