This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Our module uses a BeanTreeView to display a set of Nodes which can be copied, pasted, and dragged and dropped. We are using the NodeTransfer class to manage the Transferable instances. This all works fine for copy and paste, but for drag and drop, something is changing the Transferable into a format that is not understood by NodeTransfer. In particular, NodeTransfer.node(Transferable, int) is looking for a DataFlavor with a mimetype of application/x-java-openide-nodednd and a parameter named 'mask'. However, the ExClipboard.Convertor implementation in the refactoring module (named ClipboardConvertor) is transforming every drag and drop transferable to a new instance that has a different mime type, and lacks the mask parameter. This renders our drag and drop code useless. I have found no suitable work-around to this problem. The only way I can get work done is to hide the ClipboardConvertor by creating a META-INF/services/org.openide.util.datatransfer.ExClipboard$Convertor file and adding "#-org.netbeans.modules.refactoring.ui.ClipboardConvertor", but that seems a really bad solution for the long term.
Created attachment 29840 [details] I don't understand if I get it. We intentianly replace default DnD behavior with out own - refactoring based. I did some fix, which might help. Can you check it? Thanks
Your patch looks good, I tried it and had no problems. I'm lowering the priority of this issue because I've given up on trying to implement drag and drop in the way that I think it was designed to work (i.e. by overriding AbstractNode.getDropType() and looking for DND transferables). There were other issues around the strange d'n'd implementation in NetBeans, so I've ended up with a simple copy/paste implementation, and an Index cookie, which appears to achieve all of our goals. So, the refactoring ClipboardConvertor no longer causes a problem for us. Still, seems like a reasonable patch to apply, but we won't be needing it for the 5.5 release. Thanks for your quick work.
OK. Will fix for 6.0
Checking in ClipboardConvertor.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/ClipboardConvertor.java,v <-- ClipboardConvertor.java new revision: 1.5; previous revision: 1.4 done
This should be fixed in release55 branch too, otherwise developers will not be able to create own dnd in 5.5.
Since issue 81115 has been addressed, I am now attempting to use the NB drag/drop facility as I believe it was intended to be used. However, this issue is now blocking me. I cannot get a valid paste type so my drag/drop is not working.
Checking in ClipboardConvertor.java; /cvs/refactoring/src/org/netbeans/modules/refactoring/ui/ClipboardConvertor.java,v <-- ClipboardConvertor.java new revision: 1.2.12.1.2.2; previous revision: 1.2.12.1.2.1 done Fixed in 5.5