From f340f302ac47b8cecc9f5f9abe2843e89d41a7d4 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Thu, 3 Nov 2016 18:07:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-745=20designer=5Fbase=E5=92=8Cform?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=85=B3=E7=B3=BB=E5=86=85=E5=AE=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormElementCaseEditorProvider.java | 9 +++---- ...AbstractFormElementCaseEditorProvider.java | 14 +++-------- .../design/designer/creator/XElementCase.java | 24 +++++++++++++++---- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java index 191f7fa998..4ad5699fdd 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java @@ -1,11 +1,11 @@ package com.fr.design.fun; -import com.fr.form.ui.ElementCaseEditor; +import com.fr.stable.fun.IOFileAttrMark; import com.fr.stable.fun.ReportFitAttrProvider; -import com.fr.form.main.Form; import com.fr.stable.fun.mark.Mutable; import java.beans.PropertyDescriptor; +import java.util.Map; /** * Created by zhouping on 2015/9/10. @@ -16,10 +16,7 @@ public interface FormElementCaseEditorProvider extends Mutable { int CURRENT_LEVEL = 1; - - //加个provider返回tab的接口 - //design_base依赖了form - PropertyDescriptor[] createPropertyDescriptor (Class temp, Form form, ElementCaseEditor editor); + PropertyDescriptor[] createPropertyDescriptor (Class temp, Map attrMarkMap, ReportFitAttrProvider reportFitAttr); /** * 生成属性表 diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java index bcd39d8f52..e6d4621aff 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java @@ -1,12 +1,12 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProvider; -import com.fr.form.main.Form; -import com.fr.form.ui.ElementCaseEditor; +import com.fr.stable.fun.IOFileAttrMark; import com.fr.stable.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.API; import java.beans.PropertyDescriptor; +import java.util.Map; /** * Created by zhouping on 2015/9/10. @@ -24,7 +24,7 @@ public abstract class AbstractFormElementCaseEditorProvider implements FormEleme } @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, Form reportAttr, ElementCaseEditor editor) { + public PropertyDescriptor[] createPropertyDescriptor(Class temp, Map attrMarkMap, ReportFitAttrProvider reportFitAttr) { return new PropertyDescriptor[0]; } @@ -48,12 +48,4 @@ public abstract class AbstractFormElementCaseEditorProvider implements FormEleme public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { return 0; } - - @Override - public boolean equals(Object obj) { - if(obj == null) { - return false; - } - return true; - } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 39caec435c..37919ead96 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -22,11 +22,13 @@ import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.general.Inter; +import com.fr.plugin.ExtraClassManager; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.form.main.Form; +import com.fr.stable.fun.ExtraAttrMapProvider; import com.fr.stable.fun.FitProvider; +import com.fr.stable.fun.IOFileAttrMark; import com.fr.stable.fun.ReportFitAttrProvider; import javax.swing.*; @@ -100,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; //这边有个插件兼容问题,之后还是要改回process才行 @@ -110,8 +112,22 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme continue; } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - Form form = designer.getTarget(); - PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), form, this.toData()); + ElementCaseEditor editor = this.toData(); + Set setAttr = ExtraClassManager.getInstance().getArray(ExtraAttrMapProvider.XML_TAG); + for (ExtraAttrMapProvider attrProvider:setAttr) { + if (attrProvider == null) { + continue; + } + editor.addAttrMark((IOFileAttrMark) attrProvider); + } + FitProvider fitProvider = (FitProvider) designer.getTarget(); + ReportFitAttrProvider fitAttr = fitProvider.getFitAttr(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), editor.getAttrMarkMap(), reportFitAttr); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); }