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