void (@NotNull Project project, @NotNull Editor editor, @NotNull PsiClass aClass, boolean toImplement, @Nullable JavaOverrideImplementMemberChooserContainer container) { JavaOverrideImplementMemberChooser showedChooser = showJavaOverrideImplementChooser(container, editor, aClass); if (showedChooser == null) return; final List<PsiMethodMember> selectedElements = showedChooser.getSelectedElements(); if (selectedElements == null || selectedElements.isEmpty()) return; PsiUtilCore.ensureValid(aClass); final ThrowableRunnable<RuntimeException> performImplementOverrideRunnable = () -> overrideOrImplementMethodsInRightPlace(editor, aClass, selectedElements, showedChooser.getOptions()); if (Registry.is("run.refactorings.under.progress")) { if (!FileModificationService.getInstance().preparePsiElementsForWrite(aClass)) { return; } final String commandName = CommandProcessor.getInstance().getCurrentCommandName(); String title = ObjectUtils.notNull(commandName, getChooserTitle(toImplement, false)); Runnable runnable = () -> ApplicationManagerEx.getApplicationEx() .runWriteActionWithCancellableProgressInDispatchThread(title, project, null, indicator -> performImplementOverrideRunnable.run()); if (commandName == null) { CommandProcessor.getInstance().executeCommand(project, runnable, title, null); } else { runnable.run(); } } else { WriteCommandAction.writeCommandAction(project, aClass.getContainingFile()).run(performImplementOverrideRunnable); } }