String (final Module module, final StringDescriptor descriptor, final Locale locale, final String editedValue, final PsiFile formFile) { final PropertiesReferenceManager manager = PropertiesReferenceManager.getInstance(module.getProject()); final PropertiesFile propFile = manager.findPropertiesFile(module, descriptor.getDottedBundleName(), locale); if (propFile != null) { final IProperty propertyByKey = propFile.findPropertyByKey(descriptor.getKey()); if (propertyByKey instanceof Property && !editedValue.equals(propertyByKey.getValue())) { final Collection<PsiReference> references = findPropertyReferences((Property)propertyByKey, module); String newKeyName = null; if (references.size() > 1) { final int rc = Messages.showYesNoCancelDialog(module.getProject(), UIDesignerBundle.message("edit.text.multiple.usages", propertyByKey.getUnescapedKey(), references.size()), UIDesignerBundle.message("edit.text.multiple.usages.title"), UIDesignerBundle.message("edit.text.change.all"), UIDesignerBundle.message("edit.text.make.unique"), CommonBundle.getCancelButtonText(), Messages.getWarningIcon()); if (rc == Messages.CANCEL) { return null; } if (rc == Messages.NO) { newKeyName = promptNewKeyName(module.getProject(), propFile, descriptor.getKey()); if (newKeyName == null) return null; } } final ReadonlyStatusHandler.OperationStatus operationStatus = ReadonlyStatusHandler.getInstance(module.getProject()).ensureFilesWritable(Collections.singletonList(propFile.getVirtualFile())); if (operationStatus.hasReadonlyFiles()) { return null; } final String newKeyName1 = newKeyName; CommandProcessor.getInstance().executeCommand( module.getProject(), () -> { UndoUtil.markPsiFileForUndo(formFile); ApplicationManager.getApplication().runWriteAction(() -> { PsiDocumentManager.getInstance(module.getProject()).commitAllDocuments(); try { if (newKeyName1 != null) { propFile.addProperty(newKeyName1, editedValue); } else { final IProperty propertyByKey1 = propFile.findPropertyByKey(descriptor.getKey()); if (propertyByKey1 != null) { propertyByKey1.setValue(editedValue); } } } catch (IncorrectOperationException e) { LOG.error(e); } }); }, UIDesignerBundle.message("command.update.property"), null); return newKeyName; } } return null; }