|
|
@ -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; |
|
|
@ -21,6 +22,7 @@ import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
|
|
@ -61,12 +63,21 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> { |
|
|
|
|
|
|
|
|
|
|
|
// 获取模板控件数
|
|
|
|
// 获取模板控件数
|
|
|
|
public int getWidgetCount() { |
|
|
|
public int getWidgetCount() { |
|
|
|
int widgetCount = 0; |
|
|
|
final AtomicInteger widgetCount = new AtomicInteger(); |
|
|
|
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.incrementAndGet(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean dealWithAllCards() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, null); |
|
|
|
|
|
|
|
return widgetCount.get(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -167,7 +178,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 +188,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 +208,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 +218,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); |
|
|
|