From b9b9c7042a06f8f4ff373ae26ffb3bad478de5e7 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 4 Sep 2019 10:56:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update:=20=E6=96=B0=E5=A2=9E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=BC=82=E5=B8=B8=E5=8F=8ApluginKit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/err/TableDataException.java | 14 ++++++++++ .../com/fanruan/api/plugin/PluginKit.java | 26 +++++++++++++++++++ .../com/fanruan/api/plugin/PluginKitTest.java | 13 ++++++++++ .../fanruan/api/plugin/TestExtraClass.java | 12 +++++++++ .../com/fanruan/api/util/ArrayKitTest.java | 1 - 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/fanruan/api/err/TableDataException.java create mode 100644 src/main/java/com/fanruan/api/plugin/PluginKit.java create mode 100644 src/test/java/com/fanruan/api/plugin/PluginKitTest.java create mode 100644 src/test/java/com/fanruan/api/plugin/TestExtraClass.java diff --git a/src/main/java/com/fanruan/api/err/TableDataException.java b/src/main/java/com/fanruan/api/err/TableDataException.java new file mode 100644 index 0000000..aa222be --- /dev/null +++ b/src/main/java/com/fanruan/api/err/TableDataException.java @@ -0,0 +1,14 @@ +package com.fanruan.api.err; + +/** + * 和数据集工具有关的异常 + * */ +public class TableDataException extends com.fr.general.data.TableDataException{ + public TableDataException(String msg){ + super(msg); + } + + public TableDataException (String msg, Throwable error){ + super(msg, error); + } +} diff --git a/src/main/java/com/fanruan/api/plugin/PluginKit.java b/src/main/java/com/fanruan/api/plugin/PluginKit.java new file mode 100644 index 0000000..d591197 --- /dev/null +++ b/src/main/java/com/fanruan/api/plugin/PluginKit.java @@ -0,0 +1,26 @@ +package com.fanruan.api.plugin; + +import com.fr.plugin.ExtraClassManager; +import com.fr.stable.fun.mark.Mutable; + +import java.util.Set; + +public class PluginKit { + /** + * 返回指定集合的不可变数组 + * @param string 字符串 + * @return 数组 + * */ + public Set getArray(String string) { + return ExtraClassManager.getInstance().getArray(string); + } + + /** + * 返回指定集合的不可变数组 + * @param string 字符串 + * @return 数组 + * */ + public Set getArray(String string, Mutable m) { + return ExtraClassManager.getInstance().getArray(string, m); + } +} diff --git a/src/test/java/com/fanruan/api/plugin/PluginKitTest.java b/src/test/java/com/fanruan/api/plugin/PluginKitTest.java new file mode 100644 index 0000000..4c8a72f --- /dev/null +++ b/src/test/java/com/fanruan/api/plugin/PluginKitTest.java @@ -0,0 +1,13 @@ +package com.fanruan.api.plugin; + +import org.junit.Assert; +import org.junit.Test; + +public class PluginKitTest { + @Test + public void getArray(){ + PluginKit p1 = new PluginKit(); + TestExtraClass p2 = new TestExtraClass(); + Assert.assertEquals(p1.getArray("abcd"), p2.getArray("abcd")); + } +} diff --git a/src/test/java/com/fanruan/api/plugin/TestExtraClass.java b/src/test/java/com/fanruan/api/plugin/TestExtraClass.java new file mode 100644 index 0000000..f81ed57 --- /dev/null +++ b/src/test/java/com/fanruan/api/plugin/TestExtraClass.java @@ -0,0 +1,12 @@ +package com.fanruan.api.plugin; +import com.fr.plugin.injectable.PluginSingleInjection; + +public class TestExtraClass extends com.fr.plugin.AbstractExtraClassManager{ + protected boolean mountSpecific(PluginSingleInjection injection){ + return true; + } + + protected boolean demountSpecific(PluginSingleInjection injection){ + return true; + } +} diff --git a/src/test/java/com/fanruan/api/util/ArrayKitTest.java b/src/test/java/com/fanruan/api/util/ArrayKitTest.java index 054ae22..715ecfd 100644 --- a/src/test/java/com/fanruan/api/util/ArrayKitTest.java +++ b/src/test/java/com/fanruan/api/util/ArrayKitTest.java @@ -3,7 +3,6 @@ package com.fanruan.api.util; import com.fanruan.api.Prepare; import java.util.*; -import com.fr.third.org.apache.poi.hssf.record.formula.functions.Int; import org.junit.Assert; import org.junit.Test; From efbe7a04604548a94b2435e35b2c63914a51ba3b Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 4 Sep 2019 11:41:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?update:=20=E6=96=B0=E5=A2=9Eequals=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=8A=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/api/util/GeneralKit.java | 13 +++++++++- .../com/fanruan/api/util/GeneralKitTest.java | 24 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fanruan/api/util/GeneralKit.java b/src/main/java/com/fanruan/api/util/GeneralKit.java index 9e13593..8c3e3f6 100644 --- a/src/main/java/com/fanruan/api/util/GeneralKit.java +++ b/src/main/java/com/fanruan/api/util/GeneralKit.java @@ -4,6 +4,7 @@ import com.fr.base.FRContext; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.stable.CommonUtils; +import com.fr.stable.StringUtils; import com.fr.third.guava.base.Objects; import com.fr.stable.StableUtils; import org.jetbrains.annotations.NotNull; @@ -83,7 +84,7 @@ public class GeneralKit { public static String join(Object[] array, String se) { return StableUtils.join(array, se); } - /* + /** * 返回国际化区属 * @return 国际化后区域属性 */ @@ -91,4 +92,14 @@ public class GeneralKit { public static Locale getLocale() { return FRContext.getLocale(); } + + /** + * 检测两个数组是否相等 + * @param array1 数组1 + * @param array2 数组2 + * @return 判断的结果 + * */ + public static boolean equals(T[] array1, T[] array2){ + return ComparatorUtils.equals(array1, array2); + } } diff --git a/src/test/java/com/fanruan/api/util/GeneralKitTest.java b/src/test/java/com/fanruan/api/util/GeneralKitTest.java index c8057ec..0d4e275 100644 --- a/src/test/java/com/fanruan/api/util/GeneralKitTest.java +++ b/src/test/java/com/fanruan/api/util/GeneralKitTest.java @@ -52,4 +52,28 @@ public class GeneralKitTest extends Prepare { public void getLocale() { Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA); } + @Test + public void equals(){ + Object objArray[] = {1,2,3}; + Integer intArray[] = {1,2,3}; + Long[] longArray = {1L,2L,3L}; + Double doubleArray[] = {1.1,2.2,3.3}; + Byte[] byteArray = {1,2,3}; + Character[] charArray = {'a', 'b', 'c'}; + Boolean booleanArray[] = {true,true,false}; + Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3}), true); + Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3,4}), false); + Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3}), true); + Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3,4}), false); + Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L}), true); + Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L,4L}), false); + Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3}), true); + Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3,4.4}), false); + Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3}), true); + Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3,4}), false); + Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c'}), true); + Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c','d'}), false); + Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false}), true); + Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false,false}), false); + } } \ No newline at end of file From 3ba7c372b10934b81d5f61fb727bcad924ff01a1 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 4 Sep 2019 14:16:53 +0800 Subject: [PATCH 3/5] =?UTF-8?q?update:=20UI=E7=BB=84=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/design/ui/container/BasicBeanPane.java | 6 ++++++ .../api/design/ui/editor/ValueEditorPaneFactory.java | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java diff --git a/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java b/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java index 2ffc211..9fdfdaa 100644 --- a/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java +++ b/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java @@ -1,4 +1,10 @@ package com.fanruan.api.design.ui.container; +/** + * 基础的pane类 + * */ public abstract class BasicBeanPane extends com.fr.design.beans.BasicBeanPane { + public BasicBeanPane(){ + + } } diff --git a/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java b/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java new file mode 100644 index 0000000..a55b66f --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java @@ -0,0 +1,10 @@ +package com.fanruan.api.design.ui.editor; + +/** + * 生成ValueEditorPane的工厂方法 + * */ +public class ValueEditorPaneFactory extends com.fr.design.editor.ValueEditorPaneFactory{ + public ValueEditorPaneFactory(){ + + } +} From e8973b8cf3e1f96ee0731b844957752d66967d07 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 4 Sep 2019 14:42:00 +0800 Subject: [PATCH 4/5] =?UTF-8?q?update:=20ui=E7=BB=84=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/design/ui/container/DialogActionAdapter.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java diff --git a/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java b/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java new file mode 100644 index 0000000..7b0a02a --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java @@ -0,0 +1,10 @@ +package com.fanruan.api.design.ui.container; + +/** + * 用来给dialog增加一些固定的方法 + * */ +public class DialogActionAdapter extends com.fr.design.dialog.DialogActionAdapter{ + public DialogActionAdapter(){ + + } +} From 0e6219e9e11b0b9583ae0f76f3ec0fa71f035b2e Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 4 Sep 2019 16:10:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=94=B9=E5=8A=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/ui/container/BasicBeanPane.java | 10 ------- .../ui/container/DialogActionAdapter.java | 10 ------- .../ui/editor/ValueEditorPaneFactory.java | 10 ------- .../design/work/DatabaseConnectionPane.java | 3 +-- .../com/fanruan/api/plugin/PluginKit.java | 26 ------------------- .../java/com/fanruan/api/util/GeneralKit.java | 9 ------- .../com/fanruan/api/util/GeneralKitTest.java | 25 +----------------- 7 files changed, 2 insertions(+), 91 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java delete mode 100644 src/main/java/com/fanruan/api/plugin/PluginKit.java diff --git a/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java b/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java deleted file mode 100644 index 9fdfdaa..0000000 --- a/src/main/java/com/fanruan/api/design/ui/container/BasicBeanPane.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.fanruan.api.design.ui.container; - -/** - * 基础的pane类 - * */ -public abstract class BasicBeanPane extends com.fr.design.beans.BasicBeanPane { - public BasicBeanPane(){ - - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java b/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java deleted file mode 100644 index 7b0a02a..0000000 --- a/src/main/java/com/fanruan/api/design/ui/container/DialogActionAdapter.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.fanruan.api.design.ui.container; - -/** - * 用来给dialog增加一些固定的方法 - * */ -public class DialogActionAdapter extends com.fr.design.dialog.DialogActionAdapter{ - public DialogActionAdapter(){ - - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java b/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java deleted file mode 100644 index a55b66f..0000000 --- a/src/main/java/com/fanruan/api/design/ui/editor/ValueEditorPaneFactory.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.fanruan.api.design.ui.editor; - -/** - * 生成ValueEditorPane的工厂方法 - * */ -public class ValueEditorPaneFactory extends com.fr.design.editor.ValueEditorPaneFactory{ - public ValueEditorPaneFactory(){ - - } -} diff --git a/src/main/java/com/fanruan/api/design/work/DatabaseConnectionPane.java b/src/main/java/com/fanruan/api/design/work/DatabaseConnectionPane.java index 4d6d086..9d2854a 100644 --- a/src/main/java/com/fanruan/api/design/work/DatabaseConnectionPane.java +++ b/src/main/java/com/fanruan/api/design/work/DatabaseConnectionPane.java @@ -4,7 +4,6 @@ package com.fanruan.api.design.work; import com.fanruan.api.design.ui.component.UIButton; import com.fanruan.api.design.ui.component.UIComboBox; import com.fanruan.api.design.ui.component.UILabel; -import com.fanruan.api.design.ui.container.BasicBeanPane; import com.fanruan.api.log.LogKit; import com.fanruan.api.macro.EncodeConstants; import com.fanruan.api.util.ArrayKit; @@ -31,7 +30,7 @@ import java.awt.event.WindowEvent; * * @param 数据连接类型 */ -public abstract class DatabaseConnectionPane extends BasicBeanPane { +public abstract class DatabaseConnectionPane extends com.fr.design.beans.BasicBeanPane { private UILabel message; private UIButton okButton; diff --git a/src/main/java/com/fanruan/api/plugin/PluginKit.java b/src/main/java/com/fanruan/api/plugin/PluginKit.java deleted file mode 100644 index d591197..0000000 --- a/src/main/java/com/fanruan/api/plugin/PluginKit.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fanruan.api.plugin; - -import com.fr.plugin.ExtraClassManager; -import com.fr.stable.fun.mark.Mutable; - -import java.util.Set; - -public class PluginKit { - /** - * 返回指定集合的不可变数组 - * @param string 字符串 - * @return 数组 - * */ - public Set getArray(String string) { - return ExtraClassManager.getInstance().getArray(string); - } - - /** - * 返回指定集合的不可变数组 - * @param string 字符串 - * @return 数组 - * */ - public Set getArray(String string, Mutable m) { - return ExtraClassManager.getInstance().getArray(string, m); - } -} diff --git a/src/main/java/com/fanruan/api/util/GeneralKit.java b/src/main/java/com/fanruan/api/util/GeneralKit.java index 8c3e3f6..e5df970 100644 --- a/src/main/java/com/fanruan/api/util/GeneralKit.java +++ b/src/main/java/com/fanruan/api/util/GeneralKit.java @@ -93,13 +93,4 @@ public class GeneralKit { return FRContext.getLocale(); } - /** - * 检测两个数组是否相等 - * @param array1 数组1 - * @param array2 数组2 - * @return 判断的结果 - * */ - public static boolean equals(T[] array1, T[] array2){ - return ComparatorUtils.equals(array1, array2); - } } diff --git a/src/test/java/com/fanruan/api/util/GeneralKitTest.java b/src/test/java/com/fanruan/api/util/GeneralKitTest.java index 0d4e275..23a11f9 100644 --- a/src/test/java/com/fanruan/api/util/GeneralKitTest.java +++ b/src/test/java/com/fanruan/api/util/GeneralKitTest.java @@ -2,6 +2,7 @@ package com.fanruan.api.util; import com.fanruan.api.Prepare; import com.fr.general.GeneralUtils; +import com.fr.stable.AssistUtils; import org.junit.Assert; import org.junit.Test; @@ -52,28 +53,4 @@ public class GeneralKitTest extends Prepare { public void getLocale() { Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA); } - @Test - public void equals(){ - Object objArray[] = {1,2,3}; - Integer intArray[] = {1,2,3}; - Long[] longArray = {1L,2L,3L}; - Double doubleArray[] = {1.1,2.2,3.3}; - Byte[] byteArray = {1,2,3}; - Character[] charArray = {'a', 'b', 'c'}; - Boolean booleanArray[] = {true,true,false}; - Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3}), true); - Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3,4}), false); - Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3}), true); - Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3,4}), false); - Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L}), true); - Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L,4L}), false); - Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3}), true); - Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3,4.4}), false); - Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3}), true); - Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3,4}), false); - Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c'}), true); - Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c','d'}), false); - Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false}), true); - Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false,false}), false); - } } \ No newline at end of file