From 2e34e07f24bc86e4c5e6da85a7a703f62927f03b Mon Sep 17 00:00:00 2001 From: Kalven Date: Mon, 2 Sep 2019 17:13:26 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1117=20=E4=BF=AE=E6=94=B9=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E5=92=8C=E5=8F=82=E6=95=B0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fanruan/api/cal/ParameterKit.java | 2 +- src/main/java/com/fanruan/api/design/DesignKit.java | 10 ++++++++++ .../design/ui/container/HistoryTemplateListPane.java | 7 ------- .../java/com/fanruan/api/cal/ParameterKitTest.java | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/design/ui/container/HistoryTemplateListPane.java diff --git a/src/main/java/com/fanruan/api/cal/ParameterKit.java b/src/main/java/com/fanruan/api/cal/ParameterKit.java index e3c3f92..a8db2f1 100644 --- a/src/main/java/com/fanruan/api/cal/ParameterKit.java +++ b/src/main/java/com/fanruan/api/cal/ParameterKit.java @@ -42,7 +42,7 @@ public class ParameterKit { * @param name 参数名 * @return 参数对象 */ - public static @NotNull ParameterProvider createNewParameter(String name) { + public static @NotNull ParameterProvider newParameter(String name) { return new Parameter(name); } diff --git a/src/main/java/com/fanruan/api/design/DesignKit.java b/src/main/java/com/fanruan/api/design/DesignKit.java index ce6be5d..194234a 100644 --- a/src/main/java/com/fanruan/api/design/DesignKit.java +++ b/src/main/java/com/fanruan/api/design/DesignKit.java @@ -2,9 +2,11 @@ package com.fanruan.api.design; import com.fr.base.TableData; import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.JTemplate; public class DesignKit { /** @@ -41,4 +43,12 @@ public class DesignKit { public static DesignerFrame getDesignerFrame() { return DesignerContext.getDesignerFrame(); } + + /** + * 得到当前在修改的模板 + * @return 返回当前正在编辑的模板 + */ + public static JTemplate getCurrentEditingTemplate(){ + return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + } } diff --git a/src/main/java/com/fanruan/api/design/ui/container/HistoryTemplateListPane.java b/src/main/java/com/fanruan/api/design/ui/container/HistoryTemplateListPane.java deleted file mode 100644 index 50f6f81..0000000 --- a/src/main/java/com/fanruan/api/design/ui/container/HistoryTemplateListPane.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.fanruan.api.design.ui.container; - -/** - * 存放历史模板的列表容器 - */ -public class HistoryTemplateListPane extends com.fr.design.file.HistoryTemplateListPane { -} diff --git a/src/test/java/com/fanruan/api/cal/ParameterKitTest.java b/src/test/java/com/fanruan/api/cal/ParameterKitTest.java index 1c66498..4093687 100644 --- a/src/test/java/com/fanruan/api/cal/ParameterKitTest.java +++ b/src/test/java/com/fanruan/api/cal/ParameterKitTest.java @@ -109,8 +109,8 @@ public class ParameterKitTest extends Prepare { } @Test - public void createNewParameter() { - ParameterProvider provider = ParameterKit.createNewParameter("p1"); + public void newParameter2() { + ParameterProvider provider = ParameterKit.newParameter("p1"); Assert.assertEquals(provider.getName(),"p1"); Assert.assertEquals("", provider.getValue()); }