void (final SafeDeleteDialog dialog) { if (!CommonRefactoringUtil.checkReadOnlyStatusRecursively(project, Arrays.asList(elements), true)) return; SafeDeleteProcessor processor = SafeDeleteProcessor.createInstance(project, () -> { exit.set(true); dialog.close(DialogWrapper.OK_EXIT_CODE); }, elements, dialog.isSearchInComments(), dialog.isSearchForTextOccurences(), true); processor.run(); }