// replace ui-field type
AstEditor formEditor = newComponent.getContext().getFormEditor();
if (!StringUtils.isEmpty(uiFieldName) && formEditor != null) {
//NameSupport.setName(newComponent, uiFieldName);
TypeDeclaration typeDeclaration = formEditor.getPrimaryType();
VariableDeclaration variableDeclaration =
NameSupport.getBinderField(typeDeclaration, uiFieldName);
if (variableDeclaration != null) {
formEditor.replaceVariableType(
variableDeclaration,
ReflectionUtils.getCanonicalName(newComponent.getDescription().getComponentClass()));