[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Drag n Drop Problem for TextTransfer in CompilationUnitEditor

I solved the problem now, the CompilationUnitEditor obviously only accepts TextTransfers when I add DND.DROP_MOVE to the supported Drag operations (I only used DND.DROP_COPY before, now DND.DROP_COPY | DND.DROP_MOVE - though I never really would move the snippet)

Now there's another problem:

I would like to support both TextTransfer and FileTransfer: first one for dropping into TextEditor, latter for dropping into Navigator Folder (I create the file in tmp folder and pass the file name as dropevent.data).

works very nicely, only some (most) editors make problems as they somehow prefer FileTransfer over TextTransfer - with the result that only the filepath will be dropped into the editor.

I'm afraid there will be no real solution to it (i debugged into the swt source and got lost in OS and COM native calls....) so I will have to provide a seperate drag source widget explicitly for file dragging. That's not sexy but in times of need....

if anyone works on similar things and has found a better solution - please help

regards
paxdei

paxdei1975 wrote:

Hello everyone,

I'm developing a Plug In for snippet generation, the snippets should be dragged from a tree into a TextEditor.

This works perfectly for editors displaying xml or js, the CompilationUnitEditor refuses to accept TextTransfers though (Eclipse 3.3)

I tried to use PluginTransfer instead with a DropActionAdapter extension, which is meant to be the most flexible way to let different Views interact with DND, but no luck. Non of the standard views seem to have an idea of this Transfer type.

I also tried to read into the source code of the Snippet View in the WST Plugin, which does practically the same thing, it somehow makes the ComplationUnitEditor accept TextTransfers, but I could not figure out how and when it does that magic.

Has anybody got experience with that? Help would be desperately appreciated!

thanks in advance