I'm developing custom project views that displays only project's files that correspond some condition: for example, containing some specific text/have some extension/etc. And for now I probably achieved filtering project's files, but also have run in a problem with sorting trees.
As I could see in default views, the files are firstly sorted by the predicate like if VirtualFile is a directory, and then by names. Such an example could be found in the official sdk samples (https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/project_view_pane/src/main/java/org/intellij/sdk/view/pane/ImagesProjectNode.java) and as I could see, we perform sorting node's children looking up if some of them are directories.
However, repeating such an action didn't help me and I'm getting children in tree sorted only by name. Moreover, in debug mode I saw that even if I sort them like in the example, later children are re-sorted (in StructureTreeModel.java, getValidChildren method) with some comparator.
The comparator type is probably GroupByTypeComparator, and I haven't found any places when I could somehow affect re-sorting by concretizing any info from my class for such a comparator. Moreover, I haven't found any information about in docs.
I suppose that this problem could be solved easier that affecting that comporator - probably specifying some methods of my ProjectView implementation. Could you please give me some tips how could I achive similar file sorting to that I could see in default project views?
In addition: few words about my implementation of Project Views: its fully alike samples given in linked github page. Thats a pity that link, given on the corresponding readme for that extension, forwards to the page that doesn't contain any information about implementing Project Views at all (https://plugins.jetbrains.com/docs/intellij/project-view.html). Modifying Project View Structure page is helpful, but I consider that couldn't be used in my purpose because of it always filters files, but I need it only in some time segments.
Thank in advance for any help!