TreeStructureProvider to wrap folders


I'd like to wrap specific folders in the project view in custom nodes. I'm using a TreeStructureProvider [1] and everything works fine, but I'd like those custom nodes to "represent" their child folder, i.e. I would like to have access to the "New" submenu when I right-click on my custom nodes.

The "New" submenu is always disabled because every New action extend CreateTemplateInPackageAction, which is only enabled if the node is a PsiDirectoryNode or if its value is a PsiDirectory.

If I change the value of my custom node to be its containing directory, I can create new file from this node, but then I get StackOverflowExceptions when I use "Scroll from Source" because basically the node contains itself (the tree fails to expand correctly).

Can you think of any other solution that could fix my issue?



1 comment
Comment actions Permalink

Any idea, please?


Please sign in to leave a comment.