public void update(@NotNull final Collection<? extends ImplementationViewElement> elements, final int index) {
    update(elements, (viewElements, fileDescriptors) -> {
      if (myEditor.isDisposed()) return false;
      if (viewElements.length == 0) return false;

      final Project project = viewElements[0].getProject();
      mySwitcher.setElements(viewElements);
      mySwitcher.setIndex(index < viewElements.length ? index : 0);
      VirtualFile virtualFile = mySwitcher.getCurrentElement().getContainingFile();

      EditorHighlighter highlighter;
      if (virtualFile != null) {
        highlighter = HighlighterFactory.createHighlighter(project, virtualFile);
        myEditor.setHighlighter(highlighter);
      }

      if (viewElements.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;
    });
  }
public void update(@NotNull final Collection<? extends ImplementationViewElement> elements, final int index)