| [news.eclipse.platform.swt] Re: Drag and drop woes |
If you have some code, I can take a look and try to help you out.
Duong
David Huebel wrote:
Hi,
I am attempting to add drag and drop functionality to a TableViewer. I
subclassed DragSourceAdapter and overrode the dragSetData method. In
dragSetData(), I format the current selection as a String and set
dragSourceEvent.data. After creating the TableViewer, I call
tableViewer.addDragSupport, passing DND.DROP_COPY, new Transfer[] {
TextTransfer.getInstance() }, and an instance of my DragSourceAdapter.
Under Linux, there is evidence that the drag data is set correctly. When I select some rows and drag, I see a properly formatted version of the rows being dragged along with the mouse cursor. None of the applications I've tried to drop the data in have accepted it, though they accept drops from each other. Emacs rejected the drop immediately and provided an explanation: "Selection owner couldn't convert: UTF8_STRING". So, my application is at least offering to perform a UTF8_STRING drop. However, Gedit, which is said to accept drops of that type, does not accept drops from my app either.
Under Windows, again I see from the mouse cursor that my application at
least offers to drop something (though I can't see the actual text). And
again I can't find any applications that accept the drop, though they
accept drops from each other.
Any idea what I might be doing wrong?
-David