void (final RadRootContainer rootContainer, final String fieldName, final Object undoGroupId) { final PsiField oldBindingField = findBoundField(rootContainer, fieldName); if (oldBindingField == null) { return; } final Project project = oldBindingField.getProject(); final PsiClass aClass = oldBindingField.getContainingClass(); Boolean result = checkFieldReferences(fieldName, oldBindingField, project); if (result == null) return; if (result) { if (!CommonRefactoringUtil.checkReadOnlyStatus(project, aClass)) { return; } ApplicationManager.getApplication().runWriteAction( () -> CommandProcessor.getInstance().executeCommand( project, () -> { try { oldBindingField.delete(); } catch (IncorrectOperationException e) { Messages.showErrorDialog(project, UIDesignerBundle.message("error.cannot.delete.unused.field", e.getMessage()), CommonBundle.getErrorTitle()); } }, UIDesignerBundle.message("command.delete.unused.field"), undoGroupId ) ); } }