| [news.eclipse.platform.swt] Re: Dropping Java objects as text |
Duong
David Huebel wrote:
Thanks for the reply. The reason I'm confused is that I don't know how to
reliably distinguish between the two cases in dragSetData. I don't want to
create my own TransferData implementation (since that would require
learning native drag-and-drop implementation details on every target
platform) so my ByteArrayTransfer subclass acts just like ByteArrayTransfer
with respect to TransferData instances.
I have no idea (and the documentation gives no hint) whether TextTransfer.isSupportedType will reliably return false for the TransferData offered by a ByteArrayTransfer -- and the code here is platform-dependent. Do native drag-and-drop implementations consider byte arrays and strings to be completely incompatible? I don't even know the answer to that on my *own* preferred platform. So I'd like to set the same data regardless and let Eclipse pick the Transfer instance using whatever native voodoo it uses for that....
I guess I should create my own TransferData class so I could rely on isSupportedType to distinguish between the two cases, but writing platform-specific code seems pretty onerous for a simple drag-and-drop task.
-David