Browse Source

KERNEL-1161 更改fineKit,GeneralKit中的方法暂时没有测试

master
Kalven 5 years ago
parent
commit
6742d1e06c
  1. 16
      src/main/java/com/fanruan/api/cal/namespace/TreeLayerNameSpace.java
  2. 26
      src/main/java/com/fanruan/api/design/ui/component/UIList.java
  3. 10
      src/main/java/com/fanruan/api/design/ui/container/AbstractDataModify.java
  4. 10
      src/main/java/com/fanruan/api/design/ui/container/DictionaryPane.java
  5. 20
      src/main/java/com/fanruan/api/design/ui/container/XLayoutContainer.java
  6. 15
      src/main/java/com/fanruan/api/design/ui/editor/AccessiblePropertyEditor.java
  7. 10
      src/main/java/com/fanruan/api/design/ui/editor/CustomWriteAbleRepeatEditor.java
  8. 15
      src/main/java/com/fanruan/api/design/ui/editor/ItemCellEditor.java
  9. 15
      src/main/java/com/fanruan/api/design/ui/editor/UneditableAccessibleEditor.java
  10. 18
      src/main/java/com/fanruan/api/design/ui/editor/WidgetValueEditor.java
  11. 17
      src/main/java/com/fanruan/api/design/ui/editor/XFieldEditor.java
  12. 15
      src/main/java/com/fanruan/api/design/work/EncoderCellRenderer.java
  13. 12
      src/main/java/com/fanruan/api/design/work/Item.java
  14. 10
      src/main/java/com/fanruan/api/function/FunctionKit.java
  15. 11
      src/main/java/com/fanruan/api/macro/XCreatorConstants.java
  16. 9
      src/main/java/com/fanruan/api/util/ArrayKit.java
  17. 24
      src/main/java/com/fanruan/api/util/GeneralKit.java
  18. 4
      src/test/java/com/fanruan/api/function/FunctionKitTest.java
  19. 8
      src/test/java/com/fanruan/api/util/ArrayKitTest.java
  20. 15
      src/test/java/com/fanruan/api/util/GeneralKitTest.java

16
src/main/java/com/fanruan/api/cal/namespace/TreeLayerNameSpace.java

@ -0,0 +1,16 @@
package com.fanruan.api.cal.namespace;
import java.util.Map;
/**
* 树状控件命名空间存放相关公式和键值对
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
*/
public class TreeLayerNameSpace extends com.fr.script.TreeLayerNameSpace {
public TreeLayerNameSpace(Map layIndexMap) {
super(layIndexMap);
}
}

26
src/main/java/com/fanruan/api/design/ui/component/UIList.java

@ -0,0 +1,26 @@
package com.fanruan.api.design.ui.component;
import javax.swing.*;
import java.util.Vector;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 列表组件
*/
public class UIList extends com.fr.design.gui.ilist.UIList {
public UIList(ListModel dataModel) {
super(dataModel);
}
public UIList(Object[] listData) {
super(listData);
}
public UIList(Vector<?> listData) {
super(listData);
}
}

10
src/main/java/com/fanruan/api/design/ui/container/AbstractDataModify.java

@ -0,0 +1,10 @@
package com.fanruan.api.design.ui.container;
/**
* 抽象数据定义实现数据可序列化
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/3
*/
public abstract class AbstractDataModify<T> extends com.fr.design.widget.ui.AbstractDataModify<T> {
}

10
src/main/java/com/fanruan/api/design/ui/container/DictionaryPane.java

@ -0,0 +1,10 @@
package com.fanruan.api.design.ui.container;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 数据字典容器获取数据字典
*/
public class DictionaryPane extends com.fr.design.present.dict.DictionaryPane {
}

20
src/main/java/com/fanruan/api/design/ui/container/XLayoutContainer.java

@ -0,0 +1,20 @@
package com.fanruan.api.design.ui.container;
import com.fr.form.ui.container.WLayout;
import java.awt.*;
/**
*
* 属性设置部分布局容器
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/3
*/
public abstract class XLayoutContainer extends com.fr.design.designer.creator.XLayoutContainer {
public XLayoutContainer(WLayout widget, Dimension initSize) {
super(widget, initSize);
this.addContainerListener(this);
}
}

15
src/main/java/com/fanruan/api/design/ui/editor/AccessiblePropertyEditor.java

@ -0,0 +1,15 @@
package com.fanruan.api.design.ui.editor;
import com.fr.design.mainframe.widget.accessibles.AccessibleEditor;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 可以通过按钮或其他方式进去编辑面板的编辑器
*/
public class AccessiblePropertyEditor extends com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor {
public AccessiblePropertyEditor(AccessibleEditor editor) {
super(editor);
}
}

10
src/main/java/com/fanruan/api/design/ui/editor/CustomWriteAbleRepeatEditor.java

@ -0,0 +1,10 @@
package com.fanruan.api.design.ui.editor;
/**
* 允许自定义值的允许直接编辑的带重复的 --- 下拉框 下拉复选框 下拉树
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
*/
public abstract class CustomWriteAbleRepeatEditor extends com.fr.form.ui.CustomWriteAbleRepeatEditor {
}

15
src/main/java/com/fanruan/api/design/ui/editor/ItemCellEditor.java

@ -0,0 +1,15 @@
package com.fanruan.api.design.ui.editor;
import com.fr.design.designer.properties.items.Item;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 用作左中右对齐设置的下拉框Editor
*/
public class ItemCellEditor extends com.fr.design.mainframe.widget.editors.ItemCellEditor {
public ItemCellEditor(Item[] items) {
super(items);
}
}

15
src/main/java/com/fanruan/api/design/ui/editor/UneditableAccessibleEditor.java

@ -0,0 +1,15 @@
package com.fanruan.api.design.ui.editor;
import com.fr.design.designer.properties.Encoder;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 无法修改的编辑器
*/
public abstract class UneditableAccessibleEditor extends com.fr.design.mainframe.widget.accessibles.UneditableAccessibleEditor {
public UneditableAccessibleEditor(Encoder enc) {
super(enc);
}
}

18
src/main/java/com/fanruan/api/design/ui/editor/WidgetValueEditor.java

@ -0,0 +1,18 @@
package com.fanruan.api.design.ui.editor;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 控件值的编辑器
*/
public class WidgetValueEditor extends com.fr.design.mainframe.widget.editors.WidgetValueEditor {
public WidgetValueEditor(Object o) {
super(o);
}
public WidgetValueEditor(Object o, boolean onlyServer) {
super(o, onlyServer);
}
}

17
src/main/java/com/fanruan/api/design/ui/editor/XFieldEditor.java

@ -0,0 +1,17 @@
package com.fanruan.api.design.ui.editor;
import com.fr.form.ui.FieldEditor;
import java.awt.*;
/**
* 控件树
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/3
*/
public abstract class XFieldEditor extends com.fr.design.designer.creator.XFieldEditor {
public XFieldEditor(FieldEditor widget, Dimension initSize) {
super(widget, initSize);
}
}

15
src/main/java/com/fanruan/api/design/work/EncoderCellRenderer.java

@ -0,0 +1,15 @@
package com.fanruan.api.design.work;
import com.fr.design.designer.properties.Encoder;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
*
*/
public class EncoderCellRenderer extends com.fr.design.mainframe.widget.renderer.EncoderCellRenderer {
public EncoderCellRenderer(Encoder encoder) {
super(encoder);
}
}

12
src/main/java/com/fanruan/api/design/work/Item.java

@ -0,0 +1,12 @@
package com.fanruan.api.design.work;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
*/
public class Item extends com.fr.design.designer.properties.items.Item {
public Item(String name, Object value) {
super(name, value);
}
}

10
src/main/java/com/fanruan/api/function/FunctionKit.java

@ -7,6 +7,7 @@ import com.fr.file.FunctionManager;
import com.fr.file.FunctionManagerProvider; import com.fr.file.FunctionManagerProvider;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.fun.FunctionHelper;
import com.fr.stable.script.FunctionDef; import com.fr.stable.script.FunctionDef;
import java.util.ArrayList; import java.util.ArrayList;
@ -84,4 +85,13 @@ public class FunctionKit {
public static com.fr.file.FunctionManager getInstance() { public static com.fr.file.FunctionManager getInstance() {
return com.fr.file.FunctionManager.getInstance(); return com.fr.file.FunctionManager.getInstance();
} }
/**
* 根据插件ID生成整数类型的标识符
* @param stringID
* @return
*/
public static int generateFunctionID(String stringID) {
return FunctionHelper.generateFunctionID(stringID);
}
} }

11
src/main/java/com/fanruan/api/macro/XCreatorConstants.java

@ -0,0 +1,11 @@
package com.fanruan.api.macro;
/**
* 存放XCreator的常量
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/3
*/
public class XCreatorConstants {
public static final String PROPERTY_CATEGORY = com.fr.design.form.util.XCreatorConstants.PROPERTY_CATEGORY;
}

9
src/main/java/com/fanruan/api/util/ArrayKit.java

@ -102,4 +102,13 @@ public class ArrayKit {
public static <T> List<T> toList(T[] array) { public static <T> List<T> toList(T[] array) {
return ArrayUtils.toList(array); return ArrayUtils.toList(array);
} }
/**
* 求数组长度
* @param array 数组
* @return 长度
*/
public static int getLength(Object array) {
return ArrayUtils.getLength(array);
}
} }

24
src/main/java/com/fanruan/api/util/GeneralKit.java

@ -3,8 +3,12 @@ package com.fanruan.api.util;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
import com.fr.third.guava.base.Objects; import com.fr.third.guava.base.Objects;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -93,4 +97,24 @@ public class GeneralKit {
return FRContext.getLocale(); return FRContext.getLocale();
} }
/**
* 从输入源中读取xml
* @param reader 输入源
* @return xml文件
*/
public static XMLable readXMLable(XMLableReader reader) {
return GeneralXMLTools.readXMLable(reader);
}
/**
* 写XMLable
* @param writer 输出源
* @param xml xml文件
* @param tagName 标签名
*/
public static void writeXMLable(XMLPrintWriter writer, XMLable xml, String tagName) {
GeneralXMLTools.writeXMLable(writer, xml, tagName);
}
} }

4
src/test/java/com/fanruan/api/function/FunctionKitTest.java

@ -42,4 +42,8 @@ public class FunctionKitTest extends Prepare {
assertNotEquals("OK", result); assertNotEquals("OK", result);
} }
@Test
public void generateFunctionID() {
assertEquals(FunctionKit.generateFunctionID("com.fr.plugin.widget.ztree"),169608572);
}
} }

8
src/test/java/com/fanruan/api/util/ArrayKitTest.java

@ -110,4 +110,12 @@ public class ArrayKitTest extends Prepare {
Assert.assertEquals(ArrayKit.toList(array),result); Assert.assertEquals(ArrayKit.toList(array),result);
} }
@Test
public void getLength() {
int[] a = new int[0];
int[] b = new int[2];
Assert.assertEquals(ArrayKit.getLength(a),0);
Assert.assertEquals(ArrayKit.getLength(null),0);
Assert.assertEquals(ArrayKit.getLength(b),2);
}
} }

15
src/test/java/com/fanruan/api/util/GeneralKitTest.java

@ -3,6 +3,7 @@ package com.fanruan.api.util;
import com.fanruan.api.Prepare; import com.fanruan.api.Prepare;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.stable.xml.XMLableReader;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
@ -53,4 +54,18 @@ public class GeneralKitTest extends Prepare {
public void getLocale() { public void getLocale() {
Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA); Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA);
} }
@Test
public void readXMLable() {
try {
XMLableReader xmLableReader = XMLableReader.createXMLableReader("<x>asd<x>");
GeneralKit.readXMLable(xmLableReader);
} catch (Exception e) {
}
}
@Test
public void writeXMLable() {
}
} }
Loading…
Cancel
Save