StructureViewModel (@NotNull Project project, @NotNull FileEditor fileEditor, @NotNull StructureView structureView) { StructureViewModel treeModel; VirtualFile virtualFile = fileEditor.getFile(); if (structureView instanceof StructureViewComposite && virtualFile != null) { StructureViewComposite.StructureViewDescriptor[] views = ((StructureViewComposite)structureView).getStructureViews(); PsiFile psiFile = Objects.requireNonNull(PsiManager.getInstance(project).findFile(virtualFile)); treeModel = new StructureViewCompositeModel(psiFile, EditorUtil.getEditorEx(fileEditor), Arrays.asList(views)); Disposer.register(structureView, treeModel); } else { treeModel = structureView.getTreeModel(); } return treeModel; }