Browse Source

KERNEL-1161 根据pr进行改进

master
Kalven 5 years ago
parent
commit
a9a75cf034
  1. 12
      src/main/java/com/fr/plugin/widget/ztree/core/ZTree.java
  2. 27
      src/main/java/com/fr/plugin/widget/ztree/core/ZTreeFunctionProcessor.java
  3. 5
      src/main/java/com/fr/plugin/widget/ztree/ui/XZTree.java

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

@ -7,6 +7,8 @@ import com.fanruan.api.runtime.PluginKit;
import com.fanruan.api.xml.XmlKit;
import com.fr.intelli.record.Focus;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.stable.fun.FunctionProcessor;//过时
import com.fr.general.ModuleContext;//过时方法
@ -31,6 +33,7 @@ import com.fr.plugin.ExtraClassManager;
/**
* Created by richie on 15/11/17.
*/
@EnableMetrics
public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
private WidgetValue widgetValue;
@ -117,16 +120,17 @@ public class ZTree extends CustomWriteAbleRepeatEditor implements DataControl {
return "ztree";
}
@Override
public JSONObject createJSONConfig(Repository repo, Calculator c, NodeVisitor toFindChart) throws JSONException {
JSONObject conf = super.createJSONConfig(repo, c, toFindChart);
if (treeAttr != null) {
treeAttr.mixConfig(conf);
}
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ZTreeFunctionProcessor.getInstance());
}
// FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
// if (processor != null) {
// processor.recordFunction(ZTreeFunctionProcessor.getInstance());
// }
return conf;
}

27
src/main/java/com/fr/plugin/widget/ztree/core/ZTreeFunctionProcessor.java

@ -1,27 +0,0 @@
package com.fr.plugin.widget.ztree.core;
import com.fanruan.api.function.FunctionKit;
import com.fr.plugin.widget.ztree.tools.ZTreeConstants;
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 FunctionKit.generateFunctionID(ZTreeConstants.PLUGIN_ID);
}
@Override
public String getLocaleKey() {
return "Plugin-ZTree_Widget_Name";
}
}

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

@ -8,6 +8,7 @@ import com.fanruan.api.design.work.form.creator.XFieldEditor;
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;
@ -18,7 +19,7 @@ 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.ZTreeModelRenderer;
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;
@ -60,7 +61,7 @@ public class XZTree extends XFieldEditor {
.setRendererClass(ZTreeCascadeRenderer.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};
return (CRPropertyDescriptor[])ArrayUtils.addAll(super.supportedDescriptor(), crp);
return (CRPropertyDescriptor[]) ArrayKit.addAll(super.supportedDescriptor(), crp);
}
protected JComponent initEditor() {

Loading…
Cancel
Save