void (ActionEvent e) { final UsageViewPresentation presentation = new UsageViewPresentation(); final String codeUsagesString = RefactoringBundle.message("conflicts.tab.name"); presentation.setCodeUsagesString(codeUsagesString); presentation.setTabName(codeUsagesString); presentation.setTabText(codeUsagesString); presentation.setShowCancelButton(true); final ArrayList<Usage> usages = new ArrayList<>(myElementConflictDescription.values().size()); for (final PsiElement element : myElementConflictDescription.keySet()) { if (element == null) { usages.add(new DescriptionOnlyUsage()); continue; } ReadWriteAccessDetector detector = ReadWriteAccessDetector.findDetector(element); ReadWriteAccessDetector.Access access = detector != null ? detector.getExpressionAccess(element) : null; for (final @NlsContexts.Tooltip String conflictDescription : myElementConflictDescription.get(element)) { final UsagePresentation usagePresentation = new DescriptionOnlyUsage(conflictDescription).getPresentation(); Usage usage = access != null ? new ReadWriteAccessUsageInfo2UsageAdapter(new UsageInfo(element), access) { @NotNull @Override public UsagePresentation getPresentation() { return usagePresentation; } } : new UsageInfo2UsageAdapter(new UsageInfo(element)) { @NotNull @Override public UsagePresentation getPresentation() { return usagePresentation; } }; usages.add(usage); } } final UsageView usageView = UsageViewManager.getInstance(myProject) .showUsages(UsageTarget.EMPTY_ARRAY, usages.toArray(Usage.EMPTY_ARRAY), presentation); Runnable doRefactoringRunnable = getDoRefactoringRunnable(usageView); if (doRefactoringRunnable != null) { usageView.addPerformOperationAction( doRefactoringRunnable, myCommandName != null ? myCommandName : RefactoringBundle.message("retry.command"), LangBundle.message("conflicts.dialog.message.unable.to.perform.refactoring.changes.in.code.after.usages.have.been.found"), RefactoringBundle.message("usageView.doAction")); } close(SHOW_CONFLICTS_EXIT_CODE); }