void (final ProblemDescriptor descriptor, final Project project) { final PsiElement psi = descriptor.getPsiElement(); final PsiFile psiFile = descriptor.getPsiElement().getContainingFile(); if (!JavaI18nizeQuickFixDialog.isAvailable(psiFile)) { return; } T uast = getEnclosingLiteral(psiFile, PsiEditorUtil.findEditor(psiFile)); final JavaI18nizeQuickFixDialog<T> dialog = createDialog(project, psiFile, uast); if (!dialog.showAndGet()) { return; } final Collection<PropertiesFile> propertiesFiles = dialog.getAllPropertiesFiles(); if (!FileModificationService.getInstance().preparePsiElementForWrite(psi)) return; for (PropertiesFile file : propertiesFiles) { if (file.findPropertyByKey(dialog.getKey()) == null && !FileModificationService.getInstance().prepareFileForWrite(file.getContainingFile())) return; } CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> { try { performI18nization(psiFile, PsiEditorUtil.findEditor(psiFile), dialog.getLiteralExpression(), propertiesFiles, dialog.getKey(), dialog.getValue(), dialog.getI18nizedText(), dialog.getParameters(), dialog.getPropertyCreationHandler()); } catch (IncorrectOperationException e) { LOG.error(e); } }), PropertiesBundle.message("quickfix.i18n.command.name"), project); }