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.

Bug 74984 - ClipboardConvertor transforms every drag-n-drop transferable incompatibly
Summary: ClipboardConvertor transforms every drag-n-drop transferable incompatibly
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks: 77931 81655
  Show dependency tree
 
Reported: 2006-04-13 01:56 UTC by Nathan Fiedler
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
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 (4.91 KB, patch)
2006-04-13 12:38 UTC, Jan Becicka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Fiedler 2006-04-13 01:56:06 UTC
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.
Comment 1 Jan Becicka 2006-04-13 12:38:32 UTC
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
Comment 2 Nathan Fiedler 2006-04-13 22:38:16 UTC
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.
Comment 3 Jan Becicka 2006-05-26 11:31:46 UTC
OK. Will fix for 6.0
Comment 4 Jan Becicka 2006-07-03 10:35:01 UTC
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
Comment 5 Geertjan Wielenga 2006-09-11 07:57:37 UTC
This should be fixed in release55 branch too, otherwise developers will not be
able to create own dnd in 5.5.
Comment 6 Nathan Fiedler 2006-09-12 00:44:42 UTC
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.
Comment 7 Jan Becicka 2006-09-12 09:15:48 UTC
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