How to get the path to the destination?


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?

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));


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?


Please sign in to leave a comment.