How to get the path to the destination?

Answered

I create a plugin, there have a tree component in tool window, I want drag tree node to project tool window tree component. How to get the path to the destination?

2 comments
Comment actions Permalink

DnD event contains a component and a mouse location.

If a component is JTree, you can find corresponding TreePath by using the getPathForLocation method. Then you could extract ProjectViewNode with the following code snippet:

ProjectViewNode<?> node = TreeUtil.getLastUserObject(ProjectViewNode.class, tree.getPathForLocation(x,y));

 

0
Comment actions Permalink

Project View does not allow receiving objects of any kind. You can find implementation details in the ProjectViewDropTarget#update method.

What are you trying to achieve?

0

Please sign in to leave a comment.