void (@NotNull final Collection<? extends ImplementationViewElement> elements, final int index) { update(elements, (psiElements, fileDescriptors) -> { if (myEditor.isDisposed()) return false; if (psiElements.length == 0) return false; final Project project = psiElements[0].getProject(); mySwitcher.setElements(psiElements); mySwitcher.setIndex(index < psiElements.length ? index : 0); VirtualFile virtualFile = mySwitcher.getCurrentElement().getContainingFile(); EditorHighlighter highlighter; if (virtualFile != null) { highlighter = HighlighterFactory.createHighlighter(project, virtualFile); myEditor.setHighlighter(highlighter); } if (psiElements.length > 1) { myFileChooser.setVisible(true); mySingleEntryPanel.setVisible(false); myFileChooser.setModel(new DefaultComboBoxModel<>(fileDescriptors.toArray(new FileDescriptor[0]))); updateRenderer(project); } else { myFileChooser.setVisible(false); if (virtualFile != null) { updateSingleEntryLabel(virtualFile); } } updateControls(); revalidate(); repaint(); return true; }); }