@Override
  protected void doOKAction() {
    super.doOKAction();
    if (DumbService.isDumb(myProject)) {
      DumbModeBlockedFunctionalityCollector.INSTANCE.logFunctionalityBlocked(myProject, DumbModeBlockedFunctionality.SafeDeleteDialog);
      Messages.showMessageDialog(myProject, RefactoringBundle.message("safe.delete.not.available.indexing"),
                                 RefactoringBundle.message("refactoring.indexing.warning.title"), null);
      return;
    }

    NonProjectFileWritingAccessProvider.disableChecksDuring(() -> {
      if (myCallback != null && isSafeDelete()) {
        myCallback.run(this);
      }
    });

    final RefactoringSettings refactoringSettings = RefactoringSettings.getInstance();
    if (myCbSafeDelete != null) {
      refactoringSettings.SAFE_DELETE_WHEN_DELETE = myCbSafeDelete.isSelected();
    }
    if (isSafeDelete()) {
      if (myDelegate == null) {
        refactoringSettings.SAFE_DELETE_SEARCH_IN_COMMENTS = isSearchInComments();
        if (myCbSearchTextOccurrences != null) {
          refactoringSettings.SAFE_DELETE_SEARCH_IN_NON_JAVA = isSearchForTextOccurences();
        }
      } else {
        myDelegate.setToSearchInComments(myElements[0], isSearchInComments());

        if (myCbSearchTextOccurrences != null) {
          myDelegate.setToSearchForTextOccurrences(myElements[0], isSearchForTextOccurences());
        }
      }
    }
  }
@Override
  protected void doOKAction()