void () { final StringDescriptor descriptor = getStringDescriptorValue(); final Project project = myEditor.getProject(); PsiFile psiFile = myEditor.getPsiFile(); if (!JavaI18nizeQuickFixDialog.isAvailable(myEditor.getPsiFile())) { return; } String initialValue = StringUtil.escapeStringCharacters(descriptor.getValue()); final JavaI18nizeQuickFixDialog<?> dialog = new JavaI18nizeQuickFixDialog<>(project, psiFile, null, initialValue, null, false, false) { @Override protected String getDimensionServiceKey() { return "#com.intellij.codeInsight.i18n.I18nizeQuickFixDialog_Form"; } }; if (!dialog.showAndGet()) { return; } if (!myEditor.ensureEditable()) { return; } final Collection<PropertiesFile> propertiesFiles = dialog.getAllPropertiesFiles(); PropertiesFile aPropertiesFile = null; for (PropertiesFile file : propertiesFiles) { if (!FileModificationService.getInstance().prepareFileForWrite(file.getContainingFile())) return; if (aPropertiesFile == null) { aPropertiesFile = file; } } CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> { try { I18nUtil.createProperty(project, propertiesFiles, dialog.getKey(), dialog.getValue()); } catch (IncorrectOperationException e) { LOG.error(e); } }), PropertiesBundle.message("quickfix.i18n.command.name"), project); // saving files is necessary to ensure correct reload of properties files by UI Designer for (PropertiesFile file : propertiesFiles) { FileDocumentManager.getInstance().saveDocument(PsiDocumentManager.getInstance(project).getDocument(file.getContainingFile())); } if (aPropertiesFile != null) { String bundleName = getBundleName(project, aPropertiesFile); if (bundleName != null){ try { setStringDescriptorValue(new StringDescriptor(bundleName, dialog.getKey())); } catch (Exception e) { LOG.error(e); } myEditor.refreshAndSave(true); } } }