diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java index 346fdb2b0..bece9e21c 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -1,6 +1,7 @@ package com.fr.design.fun; import com.fr.stable.fun.Level; +import com.fr.stable.fun.ReportFitAttrProvider; import java.beans.PropertyDescriptor; @@ -19,6 +20,9 @@ public interface FormElementCaseEditorProcessor extends Level{ * @param temp 传入当前操作的class * @return 返回属性表 */ - PropertyDescriptor[] createPropertyDescriptor(Class temp); + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr); + + int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index d528627d6..334b07a1c 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -1,6 +1,7 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProcessor; +import com.fr.stable.fun.ReportFitAttrProvider; import java.beans.PropertyDescriptor; @@ -19,7 +20,13 @@ public abstract class AbstractFormElementCaseEditorProcessor implements FormElem * @param temp 传入当前操作的class * @return 返回属性表 */ - public PropertyDescriptor[] createPropertyDescriptor(Class temp){ + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider formFitAttr, ReportFitAttrProvider elementcaseFitAttr) { return new PropertyDescriptor[0]; } + + @Override + public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + return 0; + } } \ 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 a181ccbf7..84ac74cf5 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -91,10 +91,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = (FitProvider) designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData()); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), fitAttr, this.toData().getReportFitAttr()); if (processor == null) { return propertyTableEditor; } + if (toData().getReportFitAttr() == null && processor.getFitStateInPC(fitAttr) != 0) { + toData().setFormFitAttr(getFitAttrProvider(fitAttr)); + } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } @@ -102,16 +105,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * 获取表单保存的自适应属性,如果没有,就用全局保存的自适应属性 * @return 返回自适应属性 */ - private ReportFitAttrProvider getFitAttrProvider () { - FitProvider wbTpl = (FitProvider) designer.getTarget(); + private ReportFitAttrProvider getFitAttrProvider (ReportFitAttrProvider fitAttr) { ReportFitAttrProvider globalFitAttr = ConfigManager.getProviderInstance().getFitAttrProvider(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); if (fitAttr != null) { return fitAttr; } return globalFitAttr; - - } @Override