From 64ea8befd0b2651a72c2b7ff439bd887ee1d2434 Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Thu, 5 Sep 2019 11:50:19 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1198=20JSON=E6=8F=92=E4=BB=B6=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=B3=A2FineKit=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/api/cal/Parameter.java | 4 ++++ .../com/fanruan/api/data/TableDataKit.java | 9 +++++++++ .../api/data/impl/NameDatabaseConnection.java | 11 +++++++++++ .../ui/component/UITableEditorPane.java | 17 +++++++++++++++++ .../ui/container/AbstractTableDataPane.java | 10 ++++++++++ .../design/ui/container/UISQLEditPane.java | 11 +++++++++++ .../com/fanruan/api/util/TemplateKit.java | 19 +++++++++++++++++++ 7 files changed, 81 insertions(+) create mode 100644 src/main/java/com/fanruan/api/cal/Parameter.java create mode 100644 src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java create mode 100644 src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java create mode 100644 src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java create mode 100644 src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java create mode 100644 src/main/java/com/fanruan/api/util/TemplateKit.java diff --git a/src/main/java/com/fanruan/api/cal/Parameter.java b/src/main/java/com/fanruan/api/cal/Parameter.java new file mode 100644 index 0000000..6375a76 --- /dev/null +++ b/src/main/java/com/fanruan/api/cal/Parameter.java @@ -0,0 +1,4 @@ +package com.fanruan.api.cal; + +public class Parameter extends com.fr.base.Parameter { +} diff --git a/src/main/java/com/fanruan/api/data/TableDataKit.java b/src/main/java/com/fanruan/api/data/TableDataKit.java index 333245f..90eacfb 100644 --- a/src/main/java/com/fanruan/api/data/TableDataKit.java +++ b/src/main/java/com/fanruan/api/data/TableDataKit.java @@ -3,6 +3,7 @@ package com.fanruan.api.data; import com.fr.base.TableData; import com.fr.data.TableDataSource; import com.fr.data.api.TableDataAssist; +import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.file.TableDataConfig; import com.fr.script.Calculator; import com.fr.stable.script.CalculatorProvider; @@ -74,4 +75,12 @@ public class TableDataKit { public static void renameTableData(@NotNull String oldName, @NotNull String newName) { TableDataConfig.getInstance().renameTableData(oldName, newName); } + + /** + * 直接预览数据集,没有实际值和显示值 + * @param tableData 数据集 + */ + public static void previewTableData(TableData tableData) { + PreviewTablePane.previewTableData(tableData); + } } diff --git a/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java b/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java new file mode 100644 index 0000000..8751618 --- /dev/null +++ b/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java @@ -0,0 +1,11 @@ +package com.fanruan.api.data.impl; + +/** + * 列表数据连接组件 + */ +public class NameDatabaseConnection extends com.fr.data.impl.NameDatabaseConnection { + public NameDatabaseConnection() { super();} + public NameDatabaseConnection(String name) { + super(name); + } +} diff --git a/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java b/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java new file mode 100644 index 0000000..2c6d5c3 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java @@ -0,0 +1,17 @@ +package com.fanruan.api.design.ui.component; + +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; + +/** + * 表格编辑面板 + * @param + */ +public class UITableEditorPane extends com.fr.design.gui.itableeditorpane.UITableEditorPane { + public UITableEditorPane(UITableModelAdapter model){ + super(model); + } + + public UITableEditorPane(UITableModelAdapter model, String string){ + super(model, string); + } +} diff --git a/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java b/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java new file mode 100644 index 0000000..0ff1eab --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java @@ -0,0 +1,10 @@ +package com.fanruan.api.design.ui.container; + +import com.fr.base.TableData; + +/** + * 表格面板 + * @param + */ +public abstract class AbstractTableDataPane extends com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane { +} diff --git a/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java b/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java new file mode 100644 index 0000000..2113b93 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java @@ -0,0 +1,11 @@ +package com.fanruan.api.design.ui.container; + +/** + * SQL编辑面板 + */ +public class UISQLEditPane extends com.fr.design.data.datapane.sqlpane.SQLEditPane { + public UISQLEditPane(){ super();} + public UISQLEditPane(boolean bool) { + super(bool); + } +} diff --git a/src/main/java/com/fanruan/api/util/TemplateKit.java b/src/main/java/com/fanruan/api/util/TemplateKit.java new file mode 100644 index 0000000..1244c49 --- /dev/null +++ b/src/main/java/com/fanruan/api/util/TemplateKit.java @@ -0,0 +1,19 @@ +package com.fanruan.api.util; + +import com.fr.base.TemplateUtils; + +import java.util.Map; + +public class TemplateKit { + + /** + * 根据参数, 来计算文档字符串 + * @param tpl 文档来源 + * @param context 参数map + * @return 计算后结果 + * @throws Exception + */ + public static String renderParameter4Tpl(String tpl, Map context) throws Exception { + return TemplateUtils.renderParameter4Tpl(tpl, context); + } +}