JTree to display project structure. Follow
Hi I am trying to display my project tree in a tool window through JTree using something like this-
FileSystemTreeFactory treeFactory = new FileSystemTreeFactoryImpl();
FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false);
tree1 = treeFactory.createFileSystemTree(project,descriptor).getTree();
This ends up showing my entire system file structure instead of just my project's. Any hints?
Please sign in to leave a comment.
I managed to solve it. But now i am facing another issue. I am not sure how to open the file in the editor after i click on the file in my Jtree.
Thanks for your help!
This API is meant to be used with File Chooser dialog only. Could you please explain the use-case of having your project's file structure in additional toolwindow to existing Project View toolwindow? Maybe adding a dedicated pane in Project View toolwindow would be possible (com.intellij.ide.projectView.impl.AbstractProjectViewPane)?
com.intellij.ide.projectView.impl.AbstractProjectViewPane This worked thanks.