StructureView (FileEditor fileEditor, @NotNull Project project) { List<StructureViewComposite.StructureViewDescriptor> viewDescriptors = new ArrayList<>(); for (Language language : myLanguageToBuilderMap.keySet()) { StructureViewBuilder builder = myLanguageToBuilderMap.get(language); StructureView structureView = builder.createStructureView(fileEditor, project); String title = language.getDisplayName(); Icon icon = ObjectUtils.notNull(LanguageUtil.getLanguageFileType(language), FileTypes.UNKNOWN).getIcon(); viewDescriptors.add(new StructureViewComposite.StructureViewDescriptor(title, structureView, icon)); } StructureViewComposite.StructureViewDescriptor[] array = viewDescriptors.toArray(new StructureViewComposite.StructureViewDescriptor[0]); return new StructureViewComposite(array) { @Override public boolean isOutdated() { VirtualFile file = fileEditor == null ? null : fileEditor.getFile(); PsiFile psiFile = file == null || !file.isValid() ? null : PsiManager.getInstance(project).findFile(file); Set<Language> newLanguages = getLanguages(psiFile).toSet(); // think views count depends only on acceptable languages return !Comparing.equal(myLanguageToBuilderMap.keySet(), newLanguages); } }; }