API for drag-and-drop

I've search the javadocs and this forum but couldn't find anything about this. What i'd like to do is to provide a new tool window that shows some elements. Then i'd like to drag some elements from the tool window into the open file(in my case it would be an HTML file). Is this supported in any way ?

Thanks.

3 comments

Hello Hugo,

HP> I've search the javadocs and this forum but couldn't find anything
HP> about this. What i'd like to do is to provide a new tool window that
HP> shows some elements. Then i'd like to drag some elements from the
HP> tool window into the open file(in my case it would be an HTML file).
HP> Is this supported in any way ?

No special API is required for that. You can use the standard Swing drag
and drop mechanism and provide data of type String in the Transferable.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Thanks, it worked great.

Have one more question though, i'd only like the drop to work if the target file was a HTML file. I can't seem to be able to control accept process of the target. How can i do this ?

0

Hello Hugo,

HP> Thanks, it worked great.
HP>
HP> Have one more question though, i'd only like the drop to work if the
HP> target file was a HTML file. I can't seem to be able to control
HP> accept process of the target. How can i do this ?

There is currently no possibility for that. You should probably file a JIRA
request to provide API for controlling the editor drop target.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.