How to override/manipulate the context menu in "Structure" tool window.

I need to provide completely different features to the Structure context menu for a given file type. I use StructureViewModel to provide the structure view for it.
There seems to be a way to add menu items, at least I see that PsiViewer managed to do it. Is there a way to completely override this for certain file types?

Please sign in to leave a comment.