How to populate a project with a new virtual file system? Follow
I'm trying to describe what I aim to achieve, and I need advise if this is feasable and how.
So I have my `ProjectTemplate` and my `ModuleBuilder`. I would like my project root not to be a 1:1 reflection of the project's root directory, but instead be populated with items from a particular file I'm creating inside that root. This file is a database that contains the objects of my project. For example, let's say there is a physical directory `root.db` corresponding to that database, inside are the binary files of the database back end. This is nothing that the user should see or even try to manipulate. So instead of showing ` root.db` in the project tree view, I would like to provide tree nodes from objects stored in that database instead.
I can assign a particular file extension for that directory, if it helps, e.g. I'm actually using `root.mllt`. Perhaps I can override the behaviour of representing `root.mllt` as a directory branch node in the tree view, instead making it an "opaque" special object, and either it expands to my custom tree leaves, or I have a custom editor taking over when I double click on this.
Please sign in to leave a comment.
You could try to implement own com.intellij.ide.projectView.TreeStructureProvider
It allows to modify children of the given parent. For example, you may replace a PsiDirectoryNode with you custom node that provides own child nodes.