void (@NotNull final UsageViewDescriptor viewDescriptor, @NotNull final UsageView usageView) { Runnable refactoringRunnable = () -> { Set<UsageInfo> usagesToRefactor = UsageViewUtil.getNotExcludedUsageInfos(usageView); final UsageInfo[] infos = usagesToRefactor.toArray(UsageInfo.EMPTY_ARRAY); if (ensureElementsWritable(infos, viewDescriptor)) { execute(infos); } }; String canNotMakeString = RefactoringBundle.message("usageView.need.reRun"); addDoRefactoringAction(usageView, refactoringRunnable, canNotMakeString); usageView.setRerunAction(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { run(); } }); }