From b93860d213cfcdee1471db0f88a7b8d1729b2c69 Mon Sep 17 00:00:00 2001 From: richie Date: Tue, 17 Sep 2019 12:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/report/form/BaseWidget.java | 3 +- .../api/report/form/value/InitializerKit.java | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/fanruan/api/report/form/value/InitializerKit.java diff --git a/src/main/java/com/fanruan/api/report/form/BaseWidget.java b/src/main/java/com/fanruan/api/report/form/BaseWidget.java index c9100c2..703fad3 100644 --- a/src/main/java/com/fanruan/api/report/form/BaseWidget.java +++ b/src/main/java/com/fanruan/api/report/form/BaseWidget.java @@ -1,6 +1,7 @@ package com.fanruan.api.report.form; import com.fr.data.act.Describer; +import com.fr.data.act.Producer; import com.fr.form.ui.Widget; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -14,7 +15,7 @@ import com.fr.stable.web.Repository; * Created by richie on 2019-09-10 * 控件的插件接口 */ -public abstract class BaseWidget extends Widget implements Describer { +public abstract class BaseWidget extends Widget implements Describer, Producer { @Override public boolean isEditor() { diff --git a/src/main/java/com/fanruan/api/report/form/value/InitializerKit.java b/src/main/java/com/fanruan/api/report/form/value/InitializerKit.java new file mode 100644 index 0000000..50b3bf7 --- /dev/null +++ b/src/main/java/com/fanruan/api/report/form/value/InitializerKit.java @@ -0,0 +1,32 @@ +package com.fanruan.api.report.form.value; + +import com.fr.form.ui.WidgetValue; +import com.fr.form.ui.concept.data.ValueInitializer; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019/9/17 + * 初始化工具类 + */ +public class InitializerKit { + + /** + * 初始化化一个控件值对象 + * + * @return 控件值 + */ + public static ValueInitializer newValue() { + return new WidgetValue(); + } + + /** + * 初始化一个控件值对象 + * + * @param value 控件值的值 + * @return 控件值 + */ + public static ValueInitializer newValue(Object value) { + return new WidgetValue(value); + } +}