Browse Source

Merge pull request #1 in SL/plugin-ztree from ~KALVEN/plugin-ztree:master to master

* commit '4ff92a31958ac13acef4a84a1c3ba1302124d768':
  KERNEL-1161 删除iml配置文件
  KERNEL-1161 根据pr进行改进
  KERNEL-1161 图片再改
  KERNEL-1161 根据fineKit变化修改,同时修复之前图片加载路径问题
  KERNEL-1161 更改目录结构,同时使之与fineKit适配
master
richie 5 years ago
parent
commit
1267c166ed
  1. 32
      build.xml
  2. 29
      pom.xml
  3. 14
      readme.md
  4. 26
      src/com/fr/plugin/widget/ztree/core/ZTreeFunctionProcessor.java
  5. 0
      src/main/java/com/fr/plugin/widget/ztree/CssFileLoader.java
  6. 0
      src/main/java/com/fr/plugin/widget/ztree/JavaScriptFileLoader.java
  7. 0
      src/main/java/com/fr/plugin/widget/ztree/ZTreeLocaleFinder.java
  8. 90
      src/main/java/com/fr/plugin/widget/ztree/core/ZTree.java
  9. 10
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeAttr.java
  10. 8
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeCascade.java
  11. 0
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeConstants.java
  12. 13
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeMarkInCell.java
  13. 11
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeMarkInForm.java
  14. 39
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeNode.java
  15. 8
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeStyle.java
  16. 0
      src/main/java/com/fr/plugin/widget/ztree/tools/ZTreeConstants.java
  17. 12
      src/main/java/com/fr/plugin/widget/ztree/tools/ZTreeHelper.java
  18. 37
      src/main/java/com/fr/plugin/widget/ztree/ui/XZTree.java
  19. 7
      src/main/java/com/fr/plugin/widget/ztree/ui/ZTreeDefinePane.java
  20. 33
      src/main/java/com/fr/plugin/widget/ztree/ui/control/ZTreeControlPane.java
  21. 10
      src/main/java/com/fr/plugin/widget/ztree/ui/control/ZTreeNodePane.java
  22. 10
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/AccessibleZTreeModelEditor.java
  23. 8
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeEditor.java
  24. 2
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeWrapper.java
  25. 2
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelEditor.java
  26. 7
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelWrapper.java
  27. 9
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleEditor.java
  28. 5
      src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleWrapper.java
  29. 2
      src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeCascadeRenderer.java
  30. 2
      src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeModelRenderer.java
  31. 2
      src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeStyleRenderer.java
  32. 0
      src/main/resources/com/fr/plugin/widget/ztree/images/add.png
  33. 0
      src/main/resources/com/fr/plugin/widget/ztree/images/drop_down_tree.png
  34. 0
      src/main/resources/com/fr/plugin/widget/ztree/images/remove.png
  35. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/css/zTreeStyle.css
  36. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/1_close.png
  37. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/1_open.png
  38. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/2.png
  39. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/3.png
  40. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/4.png
  41. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/5.png
  42. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/6.png
  43. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/7.png
  44. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/8.png
  45. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/9.png
  46. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/line_conn.gif
  47. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/loading.gif
  48. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.gif
  49. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.png
  50. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.all-3.5.js
  51. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.core-3.5.js
  52. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.excheck-3.5.js
  53. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exedit-3.5.js
  54. 0
      src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exhide-3.5.js
  55. 0
      src/main/resources/com/fr/plugin/widget/ztree/locale/ztree.properties
  56. 0
      src/main/resources/com/fr/plugin/widget/ztree/locale/ztree_zh_CN.properties
  57. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/check.png
  58. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_result.png
  59. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_set.png
  60. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_ui.png
  61. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/properties.png
  62. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/radio.png
  63. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/styles.png
  64. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/web_ui.png
  65. 0
      src/main/resources/com/fr/plugin/widget/ztree/screenshots/widget.png
  66. 0
      src/main/resources/com/fr/plugin/widget/ztree/web/widget.ztree.css
  67. 0
      src/main/resources/com/fr/plugin/widget/ztree/web/widget.ztree.js

32
build.xml

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="plugin"> <project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改--> <!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home"/> <property name="jdk.home" value="C:\Program Files\Java\jdk1.8.0_211"/>
<property name="libs" value="${basedir}/lib"/> <property name="libs" value="${basedir}/lib"/>
<property name="publicLibs" value=""/> <property name="publicLibs" value=""/>
<property name="reportLibs" value="${basedir}/../webroot/WEB-INF/lib"/>
<property name="destLoc" value="."/> <property name="destLoc" value="."/>
<property name="classes" value="classes"/> <property name="classes" value="classes"/>
<xmlproperty file="${basedir}/plugin.xml"/> <xmlproperty file="${basedir}/plugin.xml"/>
<property name="current-version" value="${plugin.version}"/> <property name="current-version" value="${plugin.version}"/>
<!-- 插件版本--> <!-- 插件版本-->
<property name="plugin-version" value="${current-version}"/> <property name="plugin-version" value="${current-version}"/>
<!-- 插件名字--> <!-- 插件名字-->
<property name="plugin-name" value="ztree"/> <property name="plugin-name" value="function-test"/>
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/> <property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/>
<target name="prepare"> <target name="prepare">
@ -30,6 +30,9 @@
<fileset dir="${publicLibs}"> <fileset dir="${publicLibs}">
<include name="**/*.jar"/> <include name="**/*.jar"/>
</fileset> </fileset>
<fileset dir="${reportLibs}">
<include name="**/*.jar"/>
</fileset>
</path> </path>
<patternset id="resources4Jar"> <patternset id="resources4Jar">
<exclude name="**/.settings/**"/> <exclude name="**/.settings/**"/>
@ -45,7 +48,7 @@
<echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/> <echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/>
<delete dir="tmp"/> <delete dir="tmp"/>
<copy todir="tmp"> <copy todir="tmp">
<fileset dir="${resources_from}\src"> <fileset dir="${resources_from}/src/main/resources">
<patternset refid="resources4Jar"/> <patternset refid="resources4Jar"/>
</fileset> </fileset>
</copy> </copy>
@ -60,11 +63,15 @@
target="${target_jdk_version}" target="${target_jdk_version}"
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}" fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}"
executable="${compile_jdk_version}/bin/javac"> executable="${compile_jdk_version}/bin/javac">
<src path="${basedir}/src"/> <src path="${basedir}/src/main/java"/>
<exclude name="**/.svn/**"/> <exclude name="**/.svn/**"/>
<compilerarg line="-encoding UTF8 "/> <compilerarg line="-encoding UTF8 "/>
<classpath refid="compile.classpath"/> <classpath refid="compile.classpath"/>
</javac> </javac>
<taskdef name="pretreatment" classname="com.fr.plugin.pack.PluginPretreatmentTask">
<classpath refid="compile.classpath"/>
</taskdef>
<pretreatment baseDir="${basedir}"/>
</target> </target>
<target name="jar_classes"> <target name="jar_classes">
@ -81,8 +88,8 @@
<param name="resources_from" value="${basedir}"/> <param name="resources_from" value="${basedir}"/>
</antcall> </antcall>
<antcall target="compile_javas"> <antcall target="compile_javas">
<param name="source_jdk_version" value="1.6"/> <param name="source_jdk_version" value="1.8"/>
<param name="target_jdk_version" value="1.6"/> <param name="target_jdk_version" value="1.8"/>
<param name="compile_jdk_version" value="${jdk.home}"/> <param name="compile_jdk_version" value="${jdk.home}"/>
<param name="compile_files" value="${basedir}/src"/> <param name="compile_files" value="${basedir}/src"/>
</antcall> </antcall>
@ -94,6 +101,7 @@
<delete dir="${classes}"/> <delete dir="${classes}"/>
</target> </target>
<target name="jar" depends="super_jar"> <target name="jar" depends="super_jar">
<antcall target="zip"/> <antcall target="zip"/>
</target> </target>
@ -107,12 +115,16 @@
<include name="${plugin-jar}"/> <include name="${plugin-jar}"/>
<include name="plugin.xml"/> <include name="plugin.xml"/>
</fileset> </fileset>
<fileset dir="${libs}">
<include name="*.jar"/>
<include name="*.dll"/>
</fileset>
</copy> </copy>
<zip destfile="${basedir}/${plugin-folder}.zip" basedir="."> <zip destfile="${basedir}/${plugin-folder}.zip" basedir=".">
<include name="${plugin-folder}/*.jar"/> <include name="${plugin-folder}/*.jar"/>
<include name="${plugin-folder}/*.dll"/>
<include name="${plugin-folder}/plugin.xml"/> <include name="${plugin-folder}/plugin.xml"/>
</zip> </zip>
<xmlproperty file="${basedir}/plugin.xml"/> <move file="${plugin-folder}.zip" todir="${destLoc}/install"/>
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/>
</target> </target>
</project> </project>

29
pom.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.fr.plugin</groupId>
<artifactId>starter</artifactId>
<version>10.0</version>
</parent>
<packaging>jar</packaging>
<artifactId>plugin-ztree</artifactId>
<build>
<!---如果要更改调试插件,改这里的配置就可以了-->
<outputDirectory>../../../webroot/WEB-INF/plugins/plugin-com.fr.solution.plugin.design.formula.script-1.0/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

14
readme.md

@ -7,7 +7,7 @@
三种类型的截图如下 三种类型的截图如下
![widget](screenshots/styles.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/styles.png)
## 控件数据设置方式 ## 控件数据设置方式
**注意:**该控件仅支持手动添加层级的方式作为树的数据 **注意:**该控件仅支持手动添加层级的方式作为树的数据
@ -19,14 +19,14 @@
## 使用方式(示例模板见reportlets目录下的ztree.cpt) ## 使用方式(示例模板见reportlets目录下的ztree.cpt)
1. 安装插件(安装了插件才能打开ztree.cpt,否则打开会报错,如果要查看使用数据查询的实例,查看ztree4db.cpt,所使用的数据结构在tree.sql中) 1. 安装插件(安装了插件才能打开ztree.cpt,否则打开会报错,如果要查看使用数据查询的实例,查看ztree4db.cpt,所使用的数据结构在tree.sql中)
2. 打开报表参数界面,可以看到多了一个"ZTree的下拉树"控件 2. 打开报表参数界面,可以看到多了一个"ZTree的下拉树"控件
![widget](screenshots/widget.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/widget.png)
3. 将控件拖到参数界面上,选中该控件可以看到该控件的各种属性,如果需要多选树,把模式属性更改为"多选"即可 3. 将控件拖到参数界面上,选中该控件可以看到该控件的各种属性,如果需要多选树,把模式属性更改为"多选"即可
![widget](screenshots/properties.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/properties.png)
4. 点击"数据"项,可以看到点击数据设置的地方 4. 点击"数据"项,可以看到点击数据设置的地方
![widget](screenshots/data_set.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_set.png)
5. 点击上图圆圈的地方,会弹出树控件的数据设置界面,默认会添加一个层级,选择适合的数据字典类型 5. 点击上图圆圈的地方,会弹出树控件的数据设置界面,默认会添加一个层级,选择适合的数据字典类型
![widget](screenshots/data_ui.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_ui.png)
6. 需要添加多层级的时候,点击工具栏上的"添加"图标,如下图示例,添加了4层的树 6. 需要添加多层级的时候,点击工具栏上的"添加"图标,如下图示例,添加了4层的树
![widget](screenshots/data_result.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_result.png)
7. 预览该报表就可以看到下拉树的效果了 7. 预览该报表就可以看到下拉树的效果了
![widget](screenshots/web_ui.png) ![widget](src/main/resources/com/fr/plugin/widget/ztree/screenshots/web_ui.png)

26
src/com/fr/plugin/widget/ztree/core/ZTreeFunctionProcessor.java

@ -1,26 +0,0 @@
package com.fr.plugin.widget.ztree.core;
import com.fr.plugin.widget.ztree.tools.ZTreeConstants;
import com.fr.stable.fun.FunctionHelper;
import com.fr.stable.fun.impl.AbstractFunctionProcessor;
/**
* Created by richie on 15/12/2.
*/
public class ZTreeFunctionProcessor extends AbstractFunctionProcessor {
private static ZTreeFunctionProcessor instance = new ZTreeFunctionProcessor();
public static ZTreeFunctionProcessor getInstance() {
return instance;
}
public int getId() {
return FunctionHelper.generateFunctionID(ZTreeConstants.PLUGIN_ID);
}
@Override
public String getLocaleKey() {
return "Plugin-ZTree_Widget_Name";
}
}

0
src/com/fr/plugin/widget/ztree/CssFileLoader.java → src/main/java/com/fr/plugin/widget/ztree/CssFileLoader.java

0
src/com/fr/plugin/widget/ztree/JavaScriptFileLoader.java → src/main/java/com/fr/plugin/widget/ztree/JavaScriptFileLoader.java

0
src/com/fr/plugin/widget/ztree/ZTreeLocaleFinder.java → src/main/java/com/fr/plugin/widget/ztree/ZTreeLocaleFinder.java

90
src/com/fr/plugin/widget/ztree/core/ZTree.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTree.java

@ -1,32 +1,39 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fanruan.api.design.DesignKit;
import com.fr.form.ui.DataControl; import com.fanruan.api.net.NetworkKit;
import com.fr.form.ui.WidgetValue; import com.fanruan.api.report.form.CustomWriteAbleRepeatEditor;
import com.fr.general.Inter; import com.fanruan.api.runtime.PluginKit;
import com.fr.general.ModuleContext; import com.fanruan.api.xml.XmlKit;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.intelli.record.Focus;
import com.fr.json.JSONObject; import com.fr.record.analyzer.EnableMetrics;
import com.fr.plugin.ExtraClassManager; import com.fr.stable.fun.FunctionProcessor;//过时
import com.fr.plugin.PluginLicense; import com.fr.general.ModuleContext;//过时方法
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.widget.ztree.tools.ZTreeConstants; import com.fr.form.ui.WidgetValue;//DataControl中定义了抽象方法,参数为WidgetValue,无法重写
import com.fr.script.Calculator; import com.fr.json.JSONArray;//抽象方法
import com.fr.stable.core.NodeVisitor; import com.fr.json.JSONException;//抽象方法
import com.fr.stable.fun.FunctionProcessor; import com.fr.json.JSONObject;//抽象方法
import com.fr.stable.web.Repository; import com.fr.stable.core.NodeVisitor;//抽象方法
import com.fr.web.core.TemplateSessionIDInfo;//抽象方法
//open
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.web.core.SessionIDInfor; import com.fr.script.Calculator;
import com.fr.web.utils.WebUtils; import com.fr.stable.web.Repository;
//接口
import com.fr.form.ui.DataControl;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.fr.plugin.ExtraClassManager;
/** /**
* Created by richie on 15/11/17. * Created by richie on 15/11/17.
*/ */
@EnableMetrics
public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl { public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
private WidgetValue widgetValue; private WidgetValue widgetValue;
@ -36,6 +43,16 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
private ZTreeAttr treeAttr = new ZTreeAttr(); private ZTreeAttr treeAttr = new ZTreeAttr();
@Override
public String getFormatText() {
return null;
}
@Override
public String getDataBindDefaultValue(Calculator calculator) {
return null;
}
/** /**
* 控件初始值的可能类型 * 控件初始值的可能类型
* *
@ -103,31 +120,32 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
return "ztree"; return "ztree";
} }
@Override @Override
public JSONObject createJSONConfig(Repository repo, Calculator c, NodeVisitor toFindChart) throws JSONException { public JSONObject createJSONConfig(Repository repo, Calculator c, NodeVisitor toFindChart) throws JSONException {
JSONObject conf = super.createJSONConfig(repo, c, toFindChart); JSONObject conf = super.createJSONConfig(repo, c, toFindChart);
if (treeAttr != null) { if (treeAttr != null) {
treeAttr.mixConfig(conf); treeAttr.mixConfig(conf);
} }
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor(); // FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) { // if (processor != null) {
processor.recordFunction(ZTreeFunctionProcessor.getInstance()); // processor.recordFunction(ZTreeFunctionProcessor.getInstance());
} // }
return conf; return conf;
} }
@Override @Override
public JSONArray createJSONData(SessionIDInfor sessionIDInfor, Calculator c, HttpServletRequest req) throws Exception { public JSONArray createJSONData(TemplateSessionIDInfo sessionIDInfor, Calculator c, HttpServletRequest req) throws Exception {
if (treeNode == null) { if (treeNode == null) {
return new JSONArray(); return new JSONArray();
} }
PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(ZTreeConstants.PLUGIN_ID); // PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(ZTreeConstants.PLUGIN_ID);
if ((pluginLicense != null && pluginLicense.isAvailable()) || isDesign()) { if ((PluginKit.isCurrentPluginAvailable() || isDesign())) {
String pv = WebUtils.getHTTPRequestParameter(req, "pv"); String pv = NetworkKit.getHTTPRequestParameter(req, "pv");
int level = WebUtils.getHTTPRequestIntParameter(req, "level", ZTreeNode.ROOT_LEVEL); int level = NetworkKit.getHTTPRequestIntParameter(req, "level", ZTreeNode.ROOT_LEVEL);
String text = WebUtils.getHTTPRequestParameter(req, "text"); String text = NetworkKit.getHTTPRequestParameter(req, "text");
String value = WebUtils.getHTTPRequestParameter(req, "value"); String value = NetworkKit.getHTTPRequestParameter(req, "value");
boolean checked = WebUtils.getHTTPRequestBoolParameter(req, "checked"); boolean checked = NetworkKit.getHTTPRequestBoolParameter(req, "checked");
ZTreeNode node = treeNode.findNode(level); ZTreeNode node = treeNode.findNode(level);
if (node != null) { if (node != null) {
return node.toJSONArray(c, level, text, value, pv, checked && treeAttr.getCascade().isCascade()); return node.toJSONArray(c, level, text, value, pv, checked && treeAttr.getCascade().isCascade());
@ -136,7 +154,7 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
} }
} else { } else {
JSONArray errorMsg = new JSONArray(); JSONArray errorMsg = new JSONArray();
errorMsg.put(new JSONObject().put("text", Inter.getLocText("Plugin-ZTree_License_Expired")).put("value", Inter.getLocText("Plugin-ZTree_License_Expired"))); errorMsg.put(new JSONObject().put("text", DesignKit.i18nText("Plugin-ZTree_License_Expired")).put("value", DesignKit.i18nText("Plugin-ZTree_License_Expired")));
return errorMsg; return errorMsg;
} }
} }
@ -153,9 +171,9 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
if (reader.isChildNode()) { if (reader.isChildNode()) {
String tagName = reader.getTagName(); String tagName = reader.getTagName();
if (ZTreeNode.XML_TAG.equals(tagName)) { if (ZTreeNode.XML_TAG.equals(tagName)) {
treeNode = (ZTreeNode) GeneralXMLTools.readXMLable(reader); treeNode = (ZTreeNode) XmlKit.readXMLable(reader);
} else if (ZTreeAttr.XML_TAG.equals(tagName)) { } else if (ZTreeAttr.XML_TAG.equals(tagName)) {
treeAttr = (ZTreeAttr) GeneralXMLTools.readXMLable(reader); treeAttr = (ZTreeAttr) XmlKit.readXMLable(reader);
} }
} }
} }
@ -164,10 +182,10 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
super.writeXML(writer); super.writeXML(writer);
if (treeNode != null) { if (treeNode != null) {
GeneralXMLTools.writeXMLable(writer, treeNode, ZTreeNode.XML_TAG); XmlKit.writeXMLable(writer, treeNode, ZTreeNode.XML_TAG);
} }
if (treeAttr != null) { if (treeAttr != null) {
GeneralXMLTools.writeXMLable(writer, treeAttr, ZTreeAttr.XML_TAG); XmlKit.writeXMLable(writer, treeAttr, ZTreeAttr.XML_TAG);
} }
} }
} }

10
src/com/fr/plugin/widget/ztree/core/ZTreeAttr.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeAttr.java

@ -1,11 +1,15 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.json.JSONException; import com.fr.json.JSONException;//抽象
import com.fr.json.JSONObject; import com.fr.json.JSONObject;//这个换ZTree也要换,所以不能动
//open
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
//接口
import com.fr.stable.xml.XMLable;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.
*/ */

8
src/com/fr/plugin/widget/ztree/core/ZTreeCascade.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeCascade.java

@ -1,7 +1,7 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.general.ComparatorUtils; import com.fanruan.api.i18n.I18nKit;
import com.fr.general.Inter; import com.fanruan.api.util.StringKit;
/** /**
* Created by richie on 15/12/10. * Created by richie on 15/12/10.
@ -21,7 +21,7 @@ public enum ZTreeCascade {
} }
public String toLocaleText() { public String toLocaleText() {
return Inter.getLocText(localeKey); return I18nKit.getLocText(localeKey);
} }
public String toLocaleKey() { public String toLocaleKey() {
@ -39,7 +39,7 @@ public enum ZTreeCascade {
public static ZTreeCascade parser(String type) { public static ZTreeCascade parser(String type) {
for (ZTreeCascade style : values()) { for (ZTreeCascade style : values()) {
if (ComparatorUtils.equals(type, style.type)) { if (StringKit.equals(type, style.type)) {
return style; return style;
} }
} }

0
src/com/fr/plugin/widget/ztree/core/ZTreeConstants.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeConstants.java

13
src/com/fr/plugin/widget/ztree/core/ZTreeMarkInCell.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeMarkInCell.java

@ -1,12 +1,13 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.CellWidgetOptionProvider; import com.fanruan.api.i18n.I18nKit;
import com.fr.design.fun.impl.AbstractCellWidgetOptionProvider; import com.fr.design.fun.impl.AbstractCellWidgetOptionProvider;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import com.fr.plugin.widget.ztree.ui.XZTree;
import com.fr.plugin.widget.ztree.ui.ZTreeDefinePane; import com.fr.plugin.widget.ztree.ui.ZTreeDefinePane;
//open
import com.fr.design.beans.BasicBeanPane;
import com.fr.form.ui.Widget;//抽象
/** /**
* Created by richie on 15/11/17. * Created by richie on 15/11/17.
@ -35,6 +36,6 @@ public class ZTreeMarkInCell extends AbstractCellWidgetOptionProvider {
@Override @Override
public String nameForWidget() { public String nameForWidget() {
return Inter.getLocText("Plugin-ZTree_Widget_Name"); return I18nKit.getLocText("Plugin-ZTree_Widget_Name");
} }
} }

11
src/com/fr/plugin/widget/ztree/core/ZTreeMarkInForm.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeMarkInForm.java

@ -1,13 +1,12 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fanruan.api.i18n.I18nKit;
import com.fr.design.fun.ParameterWidgetOptionProvider; import com.fr.design.fun.ParameterWidgetOptionProvider;
import com.fr.design.fun.impl.AbstractFormWidgetOptionProvider; import com.fr.design.fun.impl.AbstractFormWidgetOptionProvider;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import com.fr.plugin.widget.ztree.tools.*;
import com.fr.plugin.widget.ztree.tools.ZTreeConstants;
import com.fr.plugin.widget.ztree.ui.XZTree; import com.fr.plugin.widget.ztree.ui.XZTree;
import com.fr.stable.fun.Authorize;
//抽象
import com.fr.form.ui.Widget;
/** /**
* Created by richie on 15/11/17. * Created by richie on 15/11/17.
@ -36,6 +35,6 @@ public class ZTreeMarkInForm extends AbstractFormWidgetOptionProvider implements
@Override @Override
public String nameForWidget() { public String nameForWidget() {
return Inter.getLocText("Plugin-ZTree_Widget_Name"); return I18nKit.getLocText("Plugin-ZTree_Widget_Name");
} }
} }

39
src/com/fr/plugin/widget/ztree/core/ZTreeNode.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeNode.java

@ -1,20 +1,25 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.data.Dictionary;
import com.fr.general.GeneralUtils; import com.fanruan.api.cal.CalculatorKit;
import com.fr.general.xml.GeneralXMLTools; import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.xml.XmlKit;
import com.fr.plugin.widget.ztree.tools.ZTreeHelper;
//需要用子类传入时用CalculatorProvider出错
import com.fr.script.Calculator;
//open
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
//放下
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.plugin.widget.ztree.tools.ZTreeHelper; //接口
import com.fr.script.Calculator; import com.fr.data.Dictionary;
import com.fr.script.TreeLayerNameSpace;
import com.fr.stable.StableUtils;
import com.fr.stable.script.NameSpace; import com.fr.stable.script.NameSpace;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
import com.fr.web.core.SessionIDInfor;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -85,11 +90,11 @@ public class ZTreeNode implements XMLable {
if (pv != null) { if (pv != null) {
String[] parentValues = pv.split("\\$\\$"); String[] parentValues = pv.split("\\$\\$");
for (int i = 0, len = parentValues.length; i < len; i ++) { for (int i = 0, len = parentValues.length; i < len; i ++) {
layerMap.put(GeneralUtils.objectToString(i + 1), parentValues[i]); layerMap.put(GeneralKit.objectToString(i + 1), parentValues[i]);
} }
} }
layerMap.put(GeneralUtils.objectToString(level + 1), value); layerMap.put(GeneralKit.objectToString(level + 1), value);
NameSpace ns = new TreeLayerNameSpace(layerMap); NameSpace ns = CalculatorKit.createTreeLayerNameSpace(layerMap);
c.pushNameSpace(ns); c.pushNameSpace(ns);
JSONArray data = new JSONArray(); JSONArray data = new JSONArray();
@ -114,9 +119,9 @@ public class ZTreeNode implements XMLable {
if (reader.isChildNode()) { if (reader.isChildNode()) {
String tagName = reader.getTagName(); String tagName = reader.getTagName();
if (tagName.equals(Dictionary.XML_TAG)) { if (tagName.equals(Dictionary.XML_TAG)) {
dictionary = (Dictionary) GeneralXMLTools.readXMLable(reader); dictionary = (Dictionary) XmlKit.readXMLable(reader);
} else if (tagName.equals(ZTreeNode.XML_TAG)) { } else if (tagName.equals(ZTreeNode.XML_TAG)) {
child = (ZTreeNode) GeneralXMLTools.readXMLable(reader); child = (ZTreeNode) XmlKit.readXMLable(reader);
} }
} }
} }
@ -124,10 +129,10 @@ public class ZTreeNode implements XMLable {
@Override @Override
public void writeXML(XMLPrintWriter writer) { public void writeXML(XMLPrintWriter writer) {
if (dictionary != null) { if (dictionary != null) {
GeneralXMLTools.writeXMLable(writer, dictionary, Dictionary.XML_TAG); XmlKit.writeXMLable(writer, dictionary, Dictionary.XML_TAG);
} }
if (child != null) { if (child != null) {
GeneralXMLTools.writeXMLable(writer, child, ZTreeNode.XML_TAG); XmlKit.writeXMLable(writer, child, ZTreeNode.XML_TAG);
} }
} }

8
src/com/fr/plugin/widget/ztree/core/ZTreeStyle.java → src/main/java/com/fr/plugin/widget/ztree/core/ZTreeStyle.java

@ -1,7 +1,7 @@
package com.fr.plugin.widget.ztree.core; package com.fr.plugin.widget.ztree.core;
import com.fr.general.ComparatorUtils; import com.fanruan.api.i18n.I18nKit;
import com.fr.general.Inter; import com.fanruan.api.util.StringKit;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.
@ -21,7 +21,7 @@ public enum ZTreeStyle {
} }
public String toLocaleText() { public String toLocaleText() {
return Inter.getLocText(localeKey); return I18nKit.getLocText(localeKey);
} }
public String toLocaleKey() { public String toLocaleKey() {
@ -34,7 +34,7 @@ public enum ZTreeStyle {
public static ZTreeStyle parser(String type) { public static ZTreeStyle parser(String type) {
for (ZTreeStyle style : values()) { for (ZTreeStyle style : values()) {
if (ComparatorUtils.equals(type, style.type)) { if (StringKit.equals(type, style.type)) {
return style; return style;
} }
} }

0
src/com/fr/plugin/widget/ztree/tools/ZTreeConstants.java → src/main/java/com/fr/plugin/widget/ztree/tools/ZTreeConstants.java

12
src/com/fr/plugin/widget/ztree/tools/ZTreeHelper.java → src/main/java/com/fr/plugin/widget/ztree/tools/ZTreeHelper.java

@ -1,7 +1,7 @@
package com.fr.plugin.widget.ztree.tools; package com.fr.plugin.widget.ztree.tools;
import com.fr.stable.ArrayUtils; import com.fanruan.api.util.ArrayKit;
import com.fr.stable.StringUtils; import com.fanruan.api.util.StringKit;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.
@ -9,13 +9,13 @@ import com.fr.stable.StringUtils;
public class ZTreeHelper { public class ZTreeHelper {
public static String join(String[] arr, String delimiter) { public static String join(String[] arr, String delimiter) {
if (ArrayUtils.isEmpty(arr)) { if (ArrayKit.isEmpty(arr)) {
return StringUtils.EMPTY; return StringKit.EMPTY;
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0, len = ArrayUtils.getLength(arr); i < len ; i++) { for (int i = 0, len = ArrayKit.getLength(arr); i < len ; i++) {
String segment = arr[i]; String segment = arr[i];
if (StringUtils.isNotEmpty(segment)) { if (StringKit.isNotEmpty(segment)) {
sb.append(segment); sb.append(segment);
if (i != len - 1) { if (i != len - 1) {
sb.append(delimiter); sb.append(delimiter);

37
src/com/fr/plugin/widget/ztree/ui/XZTree.java → src/main/java/com/fr/plugin/widget/ztree/ui/XZTree.java

@ -1,11 +1,17 @@
package com.fr.plugin.widget.ztree.ui; package com.fr.plugin.widget.ztree.ui;
import com.fr.design.designer.creator.*; import com.fanruan.api.design.ui.component.UITextField;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.itextfield.UITextField; //import com.fr.design.designer.creator.*;
import com.fr.design.layout.FRGUIPaneFactory; import com.fanruan.api.design.util.GUICoreKit;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fanruan.api.design.work.form.creator.XFieldEditor;
import com.fr.general.Inter; import com.fanruan.api.design.work.form.editor.WidgetValueEditor;
import com.fanruan.api.design.work.form.macro.XCreatorConstants;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.util.ArrayKit;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.plugin.widget.ztree.core.ZTree; import com.fr.plugin.widget.ztree.core.ZTree;
import com.fr.plugin.widget.ztree.ui.editor.ZTreeCascadeEditor; import com.fr.plugin.widget.ztree.ui.editor.ZTreeCascadeEditor;
import com.fr.plugin.widget.ztree.ui.editor.ZTreeModelEditor; import com.fr.plugin.widget.ztree.ui.editor.ZTreeModelEditor;
@ -13,7 +19,10 @@ import com.fr.plugin.widget.ztree.ui.editor.ZTreeStyleEditor;
import com.fr.plugin.widget.ztree.ui.renderer.ZTreeCascadeRenderer; import com.fr.plugin.widget.ztree.ui.renderer.ZTreeCascadeRenderer;
import com.fr.plugin.widget.ztree.ui.renderer.ZTreeModelRenderer; import com.fr.plugin.widget.ztree.ui.renderer.ZTreeModelRenderer;
import com.fr.plugin.widget.ztree.ui.renderer.ZTreeStyleRenderer; import com.fr.plugin.widget.ztree.ui.renderer.ZTreeStyleRenderer;
import com.fr.stable.ArrayUtils; //import com.fr.stable.ArrayUtils;
//有问题
import com.fr.design.designer.creator.CRPropertyDescriptor;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -34,30 +43,30 @@ public class XZTree extends XFieldEditor {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[]{ CRPropertyDescriptor[] crp = new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.toData().getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.toData().getClass()).setI18NName(
Inter.getLocText("Plugin-ZTree_Widget_Value")).setEditorClass(WidgetValueEditor.class), I18nKit.getLocText("Plugin-ZTree_Widget_Value")).setEditorClass(WidgetValueEditor.class),
new CRPropertyDescriptor("treeNode", this.toData().getClass()).setI18NName( new CRPropertyDescriptor("treeNode", this.toData().getClass()).setI18NName(
Inter.getLocText("Plugin-ZTree_Widget_Data")).setEditorClass(ZTreeModelEditor.class).setRendererClass( I18nKit.getLocText("Plugin-ZTree_Widget_Data")).setEditorClass(ZTreeModelEditor.class).setRendererClass(
ZTreeModelRenderer.class), ZTreeModelRenderer.class),
new CRPropertyDescriptor("popupHeight", this.data.getClass()) new CRPropertyDescriptor("popupHeight", this.data.getClass())
.setI18NName(Inter.getLocText("Plugin-ZTree_Widget_Popup_Height")) .setI18NName(I18nKit.getLocText("Plugin-ZTree_Widget_Popup_Height"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("selectStyle", this.toData().getClass()) new CRPropertyDescriptor("selectStyle", this.toData().getClass())
.setI18NName(Inter.getLocText("Plugin-ZTree_Mode")) .setI18NName(I18nKit.getLocText("Plugin-ZTree_Mode"))
.setEditorClass(ZTreeStyleEditor.class) .setEditorClass(ZTreeStyleEditor.class)
.setRendererClass(ZTreeStyleRenderer.class) .setRendererClass(ZTreeStyleRenderer.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("cascade", this.data.getClass()) new CRPropertyDescriptor("cascade", this.data.getClass())
.setI18NName(Inter.getLocText("Plugin-ZTree_Cascade")) .setI18NName(I18nKit.getLocText("Plugin-ZTree_Cascade"))
.setEditorClass(ZTreeCascadeEditor.class) .setEditorClass(ZTreeCascadeEditor.class)
.setRendererClass(ZTreeCascadeRenderer.class) .setRendererClass(ZTreeCascadeRenderer.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
}; };
return (CRPropertyDescriptor[])ArrayUtils.addAll(super.supportedDescriptor(), crp); return (CRPropertyDescriptor[]) ArrayKit.addAll(super.supportedDescriptor(), crp);
} }
protected JComponent initEditor() { protected JComponent initEditor() {
if (editor == null) { if (editor == null) {
editor = FRGUIPaneFactory.createBorderLayout_S_Pane(); editor = GUICoreKit.createBorderLayoutPane();
UITextField textField = new UITextField(5); UITextField textField = new UITextField(5);
textField.setOpaque(false); textField.setOpaque(false);
editor.add(textField, BorderLayout.CENTER); editor.add(textField, BorderLayout.CENTER);

7
src/com/fr/plugin/widget/ztree/ui/ZTreeDefinePane.java → src/main/java/com/fr/plugin/widget/ztree/ui/ZTreeDefinePane.java

@ -1,9 +1,8 @@
package com.fr.plugin.widget.ztree.ui; package com.fr.plugin.widget.ztree.ui;
import com.fr.design.widget.ui.AbstractDataModify; import com.fanruan.api.design.work.form.container.AbstractDataModify;
import com.fr.general.Inter; import com.fanruan.api.i18n.I18nKit;
import com.fr.plugin.widget.ztree.core.ZTree; import com.fr.plugin.widget.ztree.core.ZTree;
/** /**
* Created by richie on 15/11/17. * Created by richie on 15/11/17.
*/ */
@ -20,6 +19,6 @@ public class ZTreeDefinePane extends AbstractDataModify<ZTree> {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ZTree_Widget_Name"); return I18nKit.getLocText("Plugin-ZTree_Widget_Name");
} }
} }

33
src/com/fr/plugin/widget/ztree/ui/control/ZTreeControlPane.java → src/main/java/com/fr/plugin/widget/ztree/ui/control/ZTreeControlPane.java

@ -1,14 +1,19 @@
package com.fr.plugin.widget.ztree.ui.control; package com.fr.plugin.widget.ztree.ui.control;
import com.fr.base.BaseUtils; import com.fanruan.api.design.ui.action.UpdateAction;
import com.fr.design.actions.UpdateAction; import com.fanruan.api.design.ui.component.UIList;
import com.fanruan.api.design.ui.toolbar.ToolBarDef;
import com.fanruan.api.design.util.GUICoreKit;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.util.IOKit;
import com.fr.plugin.widget.ztree.core.ZTreeNode;
//open
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilist.UIList;
//com.fr包中方法返回该类,无法封装,父类对象无法赋值给子类
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.plugin.widget.ztree.core.ZTreeNode;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
@ -21,7 +26,7 @@ import java.awt.event.ActionEvent;
*/ */
public class ZTreeControlPane extends BasicPane { public class ZTreeControlPane extends BasicPane {
private static final Dimension N_D = new Dimension(200, 24); private static final Dimension N_D = new Dimension(200, 24);
private static final String LAYER_NAME = Inter.getLocText("Plugin-ZTree_Layer"); private static final String LAYER_NAME = I18nKit.getLocText("Plugin-ZTree_Layer");
private ZTreeNodePane treeNodePane; private ZTreeNodePane treeNodePane;
private DefaultListModel listModel; private DefaultListModel listModel;
@ -64,7 +69,7 @@ public class ZTreeControlPane extends BasicPane {
}); });
JPanel westPane = GUICoreUtils.createBorderLayoutPane( JPanel westPane = GUICoreKit.createBorderLayoutPane(
toolbar, BorderLayout.NORTH, toolbar, BorderLayout.NORTH,
list, BorderLayout.CENTER list, BorderLayout.CENTER
); );
@ -74,7 +79,7 @@ public class ZTreeControlPane extends BasicPane {
treeNodePane = new ZTreeNodePane(); treeNodePane = new ZTreeNodePane();
JLabel label = new JLabel(); JLabel label = new JLabel();
label.setPreferredSize(N_D); label.setPreferredSize(N_D);
add(GUICoreUtils.createBorderLayoutPane( add(GUICoreKit.createBorderLayoutPane(
label, BorderLayout.NORTH, label, BorderLayout.NORTH,
treeNodePane, BorderLayout.CENTER treeNodePane, BorderLayout.CENTER
), BorderLayout.CENTER); ), BorderLayout.CENTER);
@ -135,9 +140,9 @@ public class ZTreeControlPane extends BasicPane {
private class AddNodeAction extends UpdateAction { private class AddNodeAction extends UpdateAction {
public AddNodeAction() { public AddNodeAction() {
this.setName(Inter.getLocText("Plugin-ZTree_Add_Node")); this.setName(I18nKit.getLocText("Plugin-ZTree_Add_Node"));
this.setMnemonic('A'); this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/plugin/widget/ztree/images/add.png")); this.setSmallIcon(IOKit.readIcon("/com/fr/plugin/widget/ztree/images/add.png"));
} }
@Override @Override
@ -151,9 +156,9 @@ public class ZTreeControlPane extends BasicPane {
private class RemoveNodeAction extends UpdateAction { private class RemoveNodeAction extends UpdateAction {
public RemoveNodeAction() { public RemoveNodeAction() {
this.setName(Inter.getLocText("Plugin-ZTree_Remove_Node")); this.setName(I18nKit.getLocText("Plugin-ZTree_Remove_Node"));
this.setMnemonic('R'); this.setMnemonic('R');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/plugin/widget/ztree/images/remove.png")); this.setSmallIcon(IOKit.readIcon("/com/fr/plugin/widget/ztree/images/remove.png"));
} }
@Override @Override

10
src/com/fr/plugin/widget/ztree/ui/control/ZTreeNodePane.java → src/main/java/com/fr/plugin/widget/ztree/ui/control/ZTreeNodePane.java

@ -1,11 +1,13 @@
package com.fr.plugin.widget.ztree.ui.control; package com.fr.plugin.widget.ztree.ui.control;
import com.fr.data.Dictionary;
import com.fanruan.api.design.ui.component.present.DictionaryPane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.plugin.widget.ztree.core.ZTreeNode; import com.fr.plugin.widget.ztree.core.ZTreeNode;
//接口
import com.fr.data.Dictionary;
import java.awt.*; import java.awt.*;
/** /**
@ -20,7 +22,7 @@ public class ZTreeNodePane extends BasicBeanPane<ZTreeNode> {
} }
private void initComponents(){ private void initComponents(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
dataRadioPane = new DictionaryPane(); dataRadioPane = new DictionaryPane();
this.add(dataRadioPane, BorderLayout.CENTER); this.add(dataRadioPane, BorderLayout.CENTER);
} }

10
src/com/fr/plugin/widget/ztree/ui/editor/AccessibleZTreeModelEditor.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/AccessibleZTreeModelEditor.java

@ -1,11 +1,15 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fanruan.api.design.work.form.basic.UneditableAccessibleEditor;
import com.fr.design.mainframe.widget.accessibles.UneditableAccessibleEditor;
import com.fr.plugin.widget.ztree.core.ZTreeNode; import com.fr.plugin.widget.ztree.core.ZTreeNode;
import com.fr.plugin.widget.ztree.ui.control.ZTreeControlPane; import com.fr.plugin.widget.ztree.ui.control.ZTreeControlPane;
//接口
import com.fr.design.dialog.DialogActionAdapter;
//open
import com.fr.design.dialog.BasicDialog;
import javax.swing.*; import javax.swing.*;
/** /**

8
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeEditor.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeEditor.java

@ -1,8 +1,8 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.designer.properties.items.Item; import com.fanruan.api.design.work.form.basic.Item;
import com.fr.design.mainframe.widget.editors.ItemCellEditor; import com.fanruan.api.design.work.form.basic.ItemCellEditor;
import com.fr.general.Inter; import com.fanruan.api.i18n.I18nKit;
import com.fr.plugin.widget.ztree.core.ZTreeCascade; import com.fr.plugin.widget.ztree.core.ZTreeCascade;
/** /**
@ -21,7 +21,7 @@ public class ZTreeCascadeEditor extends ItemCellEditor {
Item[] items = new Item[len]; Item[] items = new Item[len];
for (int i = 0; i < len; i ++) { for (int i = 0; i < len; i ++) {
ZTreeCascade style = cascades[i]; ZTreeCascade style = cascades[i];
items[i] = new Item(Inter.getLocText(style.toLocaleKey()), style); items[i] = new Item(I18nKit.getLocText(style.toLocaleKey()), style);
} }
return items; return items;
} }

2
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeWrapper.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeCascadeWrapper.java

@ -1,6 +1,8 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
//抽象方法
import com.fr.design.Exception.ValidationException; import com.fr.design.Exception.ValidationException;
//接口
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
import com.fr.plugin.widget.ztree.core.ZTreeCascade; import com.fr.plugin.widget.ztree.core.ZTreeCascade;

2
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelEditor.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelEditor.java

@ -1,6 +1,6 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; import com.fanruan.api.design.work.form.basic.AccessiblePropertyEditor;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.

7
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelWrapper.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeModelWrapper.java

@ -1,11 +1,12 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.Exception.ValidationException; import com.fanruan.api.util.StringKit;
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
import com.fr.plugin.widget.ztree.core.ZTreeNode; import com.fr.plugin.widget.ztree.core.ZTreeNode;
import com.fr.stable.StringUtils;
//抽象
import com.fr.design.Exception.ValidationException;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.
*/ */
@ -14,7 +15,7 @@ public class ZTreeModelWrapper implements Encoder<ZTreeNode>, Decoder<ZTreeNode>
@Override @Override
public String encode(ZTreeNode v) { public String encode(ZTreeNode v) {
if (v == null) { if (v == null) {
return StringUtils.EMPTY; return StringKit.EMPTY;
} }
return "共有" + v.getLevelCount() + "层数据"; return "共有" + v.getLevelCount() + "层数据";
} }

9
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleEditor.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleEditor.java

@ -1,8 +1,9 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.mainframe.widget.editors.ItemCellEditor; import com.fanruan.api.design.work.form.basic.Item;
import com.fr.general.Inter; import com.fanruan.api.design.work.form.basic.ItemCellEditor;
import com.fanruan.api.i18n.I18nKit;
import com.fr.plugin.widget.ztree.core.ZTreeStyle; import com.fr.plugin.widget.ztree.core.ZTreeStyle;
/** /**
@ -20,7 +21,7 @@ public class ZTreeStyleEditor extends ItemCellEditor {
Item[] items = new Item[len]; Item[] items = new Item[len];
for (int i = 0; i < len; i ++) { for (int i = 0; i < len; i ++) {
ZTreeStyle style = styles[i]; ZTreeStyle style = styles[i];
items[i] = new Item(Inter.getLocText(style.toLocaleKey()), style); items[i] = new Item(I18nKit.getLocText(style.toLocaleKey()), style);
} }
return items; return items;
} }

5
src/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleWrapper.java → src/main/java/com/fr/plugin/widget/ztree/ui/editor/ZTreeStyleWrapper.java

@ -1,10 +1,13 @@
package com.fr.plugin.widget.ztree.ui.editor; package com.fr.plugin.widget.ztree.ui.editor;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
import com.fr.plugin.widget.ztree.core.ZTreeStyle; import com.fr.plugin.widget.ztree.core.ZTreeStyle;
//抽象
import com.fr.design.Exception.ValidationException;
/** /**
* Created by richie on 15/11/18. * Created by richie on 15/11/18.
*/ */

2
src/com/fr/plugin/widget/ztree/ui/renderer/ZTreeCascadeRenderer.java → src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeCascadeRenderer.java

@ -1,6 +1,6 @@
package com.fr.plugin.widget.ztree.ui.renderer; package com.fr.plugin.widget.ztree.ui.renderer;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; import com.fanruan.api.design.work.form.basic.EncoderCellRenderer;
import com.fr.plugin.widget.ztree.ui.editor.ZTreeCascadeWrapper; import com.fr.plugin.widget.ztree.ui.editor.ZTreeCascadeWrapper;
/** /**

2
src/com/fr/plugin/widget/ztree/ui/renderer/ZTreeModelRenderer.java → src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeModelRenderer.java

@ -1,6 +1,6 @@
package com.fr.plugin.widget.ztree.ui.renderer; package com.fr.plugin.widget.ztree.ui.renderer;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; import com.fanruan.api.design.work.form.basic.EncoderCellRenderer;
import com.fr.plugin.widget.ztree.ui.editor.ZTreeModelWrapper; import com.fr.plugin.widget.ztree.ui.editor.ZTreeModelWrapper;
/** /**

2
src/com/fr/plugin/widget/ztree/ui/renderer/ZTreeStyleRenderer.java → src/main/java/com/fr/plugin/widget/ztree/ui/renderer/ZTreeStyleRenderer.java

@ -1,6 +1,6 @@
package com.fr.plugin.widget.ztree.ui.renderer; package com.fr.plugin.widget.ztree.ui.renderer;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; import com.fanruan.api.design.work.form.basic.EncoderCellRenderer;
import com.fr.plugin.widget.ztree.ui.editor.ZTreeStyleWrapper; import com.fr.plugin.widget.ztree.ui.editor.ZTreeStyleWrapper;
/** /**

0
src/com/fr/plugin/widget/ztree/images/add.png → src/main/resources/com/fr/plugin/widget/ztree/images/add.png

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

0
src/com/fr/plugin/widget/ztree/images/drop_down_tree.png → src/main/resources/com/fr/plugin/widget/ztree/images/drop_down_tree.png

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 256 B

0
src/com/fr/plugin/widget/ztree/images/remove.png → src/main/resources/com/fr/plugin/widget/ztree/images/remove.png

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

0
src/com/fr/plugin/widget/ztree/lib/css/zTreeStyle.css → src/main/resources/com/fr/plugin/widget/ztree/lib/css/zTreeStyle.css

0
src/com/fr/plugin/widget/ztree/lib/img/diy/1_close.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/1_close.png

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 601 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/1_open.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/1_open.png

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/2.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/2.png

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/3.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/3.png

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 762 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/4.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/4.png

Before

Width:  |  Height:  |  Size: 399 B

After

Width:  |  Height:  |  Size: 399 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/5.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/5.png

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 710 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/6.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/6.png

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/7.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/7.png

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/8.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/8.png

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 529 B

0
src/com/fr/plugin/widget/ztree/lib/img/diy/9.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/diy/9.png

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 467 B

0
src/com/fr/plugin/widget/ztree/lib/img/line_conn.gif → src/main/resources/com/fr/plugin/widget/ztree/lib/img/line_conn.gif

Before

Width:  |  Height:  |  Size: 45 B

After

Width:  |  Height:  |  Size: 45 B

0
src/com/fr/plugin/widget/ztree/lib/img/loading.gif → src/main/resources/com/fr/plugin/widget/ztree/lib/img/loading.gif

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 381 B

0
src/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.gif → src/main/resources/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.gif

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

0
src/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.png → src/main/resources/com/fr/plugin/widget/ztree/lib/img/zTreeStandard.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
src/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.all-3.5.js → src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.all-3.5.js

0
src/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.core-3.5.js → src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.core-3.5.js

0
src/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.excheck-3.5.js → src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.excheck-3.5.js

0
src/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exedit-3.5.js → src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exedit-3.5.js

0
src/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exhide-3.5.js → src/main/resources/com/fr/plugin/widget/ztree/lib/js/jquery.ztree.exhide-3.5.js

0
src/com/fr/plugin/widget/ztree/locale/ztree.properties → src/main/resources/com/fr/plugin/widget/ztree/locale/ztree.properties

0
src/com/fr/plugin/widget/ztree/locale/ztree_zh_CN.properties → src/main/resources/com/fr/plugin/widget/ztree/locale/ztree_zh_CN.properties

0
screenshots/check.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/check.png

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

0
screenshots/data_result.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_result.png

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

0
screenshots/data_set.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_set.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
screenshots/data_ui.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/data_ui.png

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

0
screenshots/properties.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/properties.png

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

0
screenshots/radio.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/radio.png

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

0
screenshots/styles.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/styles.png

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

0
screenshots/web_ui.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/web_ui.png

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

0
screenshots/widget.png → src/main/resources/com/fr/plugin/widget/ztree/screenshots/widget.png

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
src/com/fr/plugin/widget/ztree/web/widget.ztree.css → src/main/resources/com/fr/plugin/widget/ztree/web/widget.ztree.css

0
src/com/fr/plugin/widget/ztree/web/widget.ztree.js → src/main/resources/com/fr/plugin/widget/ztree/web/widget.ztree.js

Loading…
Cancel
Save