|
|
|
@ -22,29 +22,12 @@ abstract class ModelUtil {
|
|
|
|
|
|
|
|
|
|
private static void recursiveRenameWidgetName(Form form, XCreator xCreator, Set<String> duplicated) { |
|
|
|
|
|
|
|
|
|
//有可能并不需要对自己处理,而是对其他的组件处理。所以要找到目标值
|
|
|
|
|
XCreator target = xCreator.getXCreator(); |
|
|
|
|
String uniqueName = uniqueName(form, target, duplicated); |
|
|
|
|
|
|
|
|
|
int componentCount = target.getComponentCount(); |
|
|
|
|
//如果没有子类,说明是刚创建的,直接对自己处理就好啦
|
|
|
|
|
if (componentCount == 0) { |
|
|
|
|
target.toData().setWidgetName(uniqueName); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//专属容器,直接返回啦
|
|
|
|
|
if (target.isDedicateContainer()) { |
|
|
|
|
Set<XCreator> nameRelatedCreators = new HashSet<>(); |
|
|
|
|
//直接遍历出来目标值,然后按需处理
|
|
|
|
|
xCreator.traversalNameRelatedXCreators(nameRelatedCreators); |
|
|
|
|
for (XCreator target : nameRelatedCreators) { |
|
|
|
|
String uniqueName = uniqueName(form, target, duplicated); |
|
|
|
|
target.resetCreatorName(uniqueName); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
target.resetCreatorName(uniqueName); |
|
|
|
|
|
|
|
|
|
int count = target.getComponentCount(); |
|
|
|
|
for (int a = 0; a < count; a++) { |
|
|
|
|
if (target.getComponent(a) instanceof XCreator) { |
|
|
|
|
XCreator child = (XCreator) target.getComponent(a); |
|
|
|
|
recursiveRenameWidgetName(form, child, duplicated); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|