private void renderUsage(@NotNull UsageInfo info) {
    PsiElement element = info.getElement();
    PsiFile file = info.getFile();
    ProperTextRange rangeInElement = info.getRangeInElement();
    myAlreadyRenderedUsages++;
    if (element == null || file == null || rangeInElement == null) return;
    VirtualFile virtualFile = file.getVirtualFile();
    if (virtualFile == null) return;
    SnippetRenderingData data = UsageCodeSnippetComponent.calculateSnippetRenderingData(element, rangeInElement);
    if (data == null) return;
    final UsageCodeSnippetComponent codeSnippet = new UsageCodeSnippetComponent(data);
    Disposer.register(this, codeSnippet);
    JPanel headerPanelForUsage = getHeaderPanelForUsage(info, codeSnippet.getEditor().getBackgroundColor());
    if (myOriginalUsage == info) {
      final SimpleColoredComponent component = new SimpleColoredComponent();
      component.append(UsageViewBundle.message("similar.usages.the.original.usage.label"), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
      headerPanelForUsage.add(component);
    }
    add(headerPanelForUsage);
    add(codeSnippet);
  }
private void renderUsage(@NotNull UsageInfo info)