From fe1260db0f250d4f1218d2ab0ed3d25717c564ef Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 12 Sep 2019 17:26:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E8=AE=A1=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{XFieldEditor.java => XFieldCreator.java} | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) rename src/main/java/com/fanruan/api/design/work/form/creator/{XFieldEditor.java => XFieldCreator.java} (76%) diff --git a/src/main/java/com/fanruan/api/design/work/form/creator/XFieldEditor.java b/src/main/java/com/fanruan/api/design/work/form/creator/XFieldCreator.java similarity index 76% rename from src/main/java/com/fanruan/api/design/work/form/creator/XFieldEditor.java rename to src/main/java/com/fanruan/api/design/work/form/creator/XFieldCreator.java index 8c13bb5..7f48514 100644 --- a/src/main/java/com/fanruan/api/design/work/form/creator/XFieldEditor.java +++ b/src/main/java/com/fanruan/api/design/work/form/creator/XFieldCreator.java @@ -4,6 +4,7 @@ import com.fanruan.api.design.DesignKit; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.form.ui.Widget; +import com.fr.form.ui.concept.Blankable; import java.awt.*; @@ -13,9 +14,9 @@ import java.awt.*; * Created by richie on 2019-09-10 * 控件的UI展示和设计类 */ -public abstract class XFieldEditor extends XOpenCreator { +public abstract class XFieldCreator extends XOpenCreator { - public XFieldEditor(Widget fieldEditor, Dimension dimension) { + public XFieldCreator(Widget fieldEditor, Dimension dimension) { super(fieldEditor, dimension); } @@ -33,9 +34,16 @@ public abstract class XFieldEditor extends XOpenCreator { .i18n(DesignKit.i18nText("Fine-Design_Form_Font_Size")) .keyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); + Widget widget = toData(); + if (widget instanceof Blankable && ((Blankable) widget).isAllowBlank()) { + return new Attribute[]{ + allowBlank, blankErrorMsg, fontSize + }; + } return new Attribute[]{ - allowBlank, blankErrorMsg, fontSize + allowBlank, fontSize }; + } }