void (@NotNull final Project project, @NotNull final RadContainer rootContainer, @NotNull final PsiClass boundClass, @NotNull final String fieldClassName, @NotNull final String fieldName, final boolean showErrors, @Nullable final Object undoGroupId) { ApplicationManager.getApplication().assertReadAccessAllowed(); PsiDocumentManager.getInstance(project).commitAllDocuments(); // Do nothing if file becomes invalid if(!boundClass.isValid()){ return; } if(!boundClass.isWritable()){ if(showErrors) { if (!CommonRefactoringUtil.checkReadOnlyStatus(boundClass, project, UIDesignerBundle.message("error.cannot.create.field", fieldClassName))) { return; } } else return; } final PsiClass fieldClass = JavaPsiFacade.getInstance(project) .findClass(fieldClassName.replace('$', '.'), GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(rootContainer.getModule())); if(fieldClass == null){ if(showErrors){ Messages.showErrorDialog( project, UIDesignerBundle.message("error.cannot.create.field.no.class", fieldName, fieldClassName), CommonBundle.getErrorTitle() ); } return; } CommandProcessor.getInstance().executeCommand( project, () -> ApplicationManager.getApplication().runWriteAction( () -> createField(project, fieldClass, fieldName, boundClass, showErrors, rootContainer) ), UIDesignerBundle.message("command.create.field"), undoGroupId ); }