I'm trying to implement a plugin for a pure Java (Swing) application.
The plugin modifies the behavior of one of the host windows by allowing
it to accept private data flavors dragged from a native app.
The plugin works fine on Windows, but not on OSX (Java 1.4.2_05)...
Adding private DataFlavor(s) to the SystemFlavorMap doesn't work.
putting appropriate mappings directly into the flavormap.properties (or
a separate file pointed to by the AWT.DnD.flavorMapFileURL property)
seems to have no effect, either.
Various posts on this list indicate it's a well known problem, so it's
time for me to look for the solution elsewhere - including the Cocoa
API...
Well, getting data from the general pasteboard (clipboard) is a breeze,
but the default drag pasteboard is not being used for inter-app dnd -
so something like this won't work:
// java.awt.dnd.DropTarget
public void dragEnter (DropTargetDragEvent evt) {
NSPasteboard pb =
NSPasteboard.pasteboardWithName(NSPasteboard.DragPboard);
int count = pb.types().count(); // returns 0
}
Presumably, a custom responder added at the end of the window's
responder chain can be notified of the drag events and get passed a
reference to the pasteboard... But this doesn't seem to be happening
here - my NSDraggingDestination subclass receives mouse events, but
none of the draggingEntered/Exited/etc. methods get called.
So here are the questions:
1. Can a private data flavor dropped from a native app be accessed
without resorting to Cocoa or JNI/Carbon?
2. If Cocoa is the only answer, how can the dragged data be accessed
from a pure java app?
3. Also, what correponding mime format should used for identifying
native 'XXXX' flavor in Java 1.4.2 on OSX?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden