|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.fr.design.mainframe.template.info; |
|
|
|
package com.fr.design.mainframe.template.info; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.iofile.attr.ExtendSharableAttrMark; |
|
|
|
import com.fr.base.iofile.attr.ExtendSharableAttrMark; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.chart.chartattr.ChartCollection; |
|
|
|
import com.fr.chart.chartattr.ChartCollection; |
|
|
|
import com.fr.form.FormElementCaseProvider; |
|
|
|
import com.fr.form.FormElementCaseProvider; |
|
|
|
import com.fr.form.main.Form; |
|
|
|
import com.fr.form.main.Form; |
|
|
@ -61,12 +62,21 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
|
|
|
|
|
|
|
|
// 获取模板控件数
|
|
|
|
// 获取模板控件数
|
|
|
|
public int getWidgetCount() { |
|
|
|
public int getWidgetCount() { |
|
|
|
int widgetCount = 0; |
|
|
|
final int[] widgetCount = {0}; |
|
|
|
for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { |
|
|
|
Form.traversalWidget(this.template.getContainer(), new WidgetGather() { |
|
|
|
WLayout wl = (WLayout) template.getContainer().getWidget(i); |
|
|
|
@Override |
|
|
|
widgetCount += wl.getWidgetCount(); |
|
|
|
public void dealWith(Widget widget) { |
|
|
|
} |
|
|
|
if (ComponentOperate.ComponentType.supportComponent(widget)) { |
|
|
|
return widgetCount; |
|
|
|
widgetCount[0]++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean dealWithAllCards() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, null); |
|
|
|
|
|
|
|
return widgetCount[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -167,7 +177,7 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
public boolean useParaPane() { |
|
|
|
public boolean useParaPane() { |
|
|
|
return this.template.getParaContainer() != null; |
|
|
|
return this.template.getParaContainer() != null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public JSONArray getComponentsInfo() { |
|
|
|
public JSONArray getComponentsInfo() { |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
@ -177,10 +187,10 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
this.componentProcessInfoMap.clear(); |
|
|
|
this.componentProcessInfoMap.clear(); |
|
|
|
return ja; |
|
|
|
return ja; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public JSONArray getReuseCmpList() { |
|
|
|
public JSONArray getReuseCmpList() { |
|
|
|
|
|
|
|
|
|
|
|
final JSONArray jo = JSONArray.create(); |
|
|
|
final JSONArray jo = JSONArray.create(); |
|
|
|
WLayout container = this.template.getContainer(); |
|
|
|
WLayout container = this.template.getContainer(); |
|
|
|
WidgetUtil.bfsTraversalWidget(container, new WidgetUtil.BfsWidgetGather<AbstractBorderStyleWidget>() { |
|
|
|
WidgetUtil.bfsTraversalWidget(container, new WidgetUtil.BfsWidgetGather<AbstractBorderStyleWidget>() { |
|
|
@ -197,7 +207,7 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
}, AbstractBorderStyleWidget.class); |
|
|
|
}, AbstractBorderStyleWidget.class); |
|
|
|
return jo; |
|
|
|
return jo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateTemplateOperationInfo(TemplateOperate templateOperate) { |
|
|
|
public void updateTemplateOperationInfo(TemplateOperate templateOperate) { |
|
|
|
if (ComparatorUtils.equals(ComponentCreateOperate.OPERATE_TYPE, templateOperate.getOperateType())) { |
|
|
|
if (ComparatorUtils.equals(ComponentCreateOperate.OPERATE_TYPE, templateOperate.getOperateType())) { |
|
|
@ -207,7 +217,7 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
addComponentRemoveInfo(templateOperate.toJSONObject()); |
|
|
|
addComponentRemoveInfo(templateOperate.toJSONObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addComponentCreateInfo(JSONObject jsonObject) { |
|
|
|
private void addComponentCreateInfo(JSONObject jsonObject) { |
|
|
|
String componentID = jsonObject.getString("componentID"); |
|
|
|
String componentID = jsonObject.getString("componentID"); |
|
|
|
componentProcessInfoMap.put(componentID, jsonObject); |
|
|
|
componentProcessInfoMap.put(componentID, jsonObject); |
|
|
|