void (@Nullable final List<? extends UsageInfo> infos) { if (ContainerUtil.isEmpty(infos)) { removeAll(); JComponent titleComp = new JLabel(UsageViewBundle.message("select.the.usage.to.preview"), SwingConstants.CENTER); add(titleComp, BorderLayout.CENTER); } else { PsiElement element = getElementToSliceOn(infos); if (element == null) return; if (myPanel != null) { Disposer.dispose((Disposable)myPanel); } PsiElement restored = JavaSliceUsage.createRootUsage(element, createParams(element, isDataflowToThis())).getElement(); if (restored == null || restored.getContainingFile() == null) return; JComponent panel = createPanel(element, isDataflowToThis()); myPanel = panel; Disposer.register(this, (Disposable)panel); removeAll(); add(panel, BorderLayout.CENTER); } revalidate(); }