|
|
@ -1,16 +1,15 @@ |
|
|
|
package com.fr.plugin.widget.ztree.ui; |
|
|
|
package com.fr.plugin.widget.ztree.ui; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fanruan.api.design.DesignKit; |
|
|
|
import com.fanruan.api.design.ui.component.UITextField; |
|
|
|
import com.fanruan.api.design.ui.component.UITextField; |
|
|
|
|
|
|
|
|
|
|
|
import com.fanruan.api.design.util.GUICoreKit; |
|
|
|
import com.fanruan.api.design.util.GUICoreKit; |
|
|
|
import com.fanruan.api.design.work.form.creator.XFieldEditor; |
|
|
|
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.editor.WidgetValueEditor; |
|
|
|
import com.fanruan.api.design.work.form.macro.XCreatorConstants; |
|
|
|
import com.fanruan.api.design.work.form.macro.XCreatorConstants; |
|
|
|
import com.fanruan.api.i18n.I18nKit; |
|
|
|
|
|
|
|
import com.fanruan.api.util.ArrayKit; |
|
|
|
import com.fanruan.api.util.ArrayKit; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.CRPropertyDescriptor; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XWScaleLayout; |
|
|
|
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; |
|
|
@ -19,8 +18,6 @@ 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.design.designer.creator.CRPropertyDescriptor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.beans.IntrospectionException; |
|
|
|
import java.beans.IntrospectionException; |
|
|
@ -40,25 +37,25 @@ 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( |
|
|
|
I18nKit.getLocText("Plugin-ZTree_Widget_Value")).setEditorClass(WidgetValueEditor.class), |
|
|
|
DesignKit.i18nText("Plugin-ZTree_Widget_Value")).setEditorClass(WidgetValueEditor.class), |
|
|
|
new CRPropertyDescriptor("treeNode", this.toData().getClass()).setI18NName( |
|
|
|
new CRPropertyDescriptor("treeNode", this.toData().getClass()).setI18NName( |
|
|
|
I18nKit.getLocText("Plugin-ZTree_Widget_Data")).setEditorClass(ZTreeModelEditor.class).setRendererClass( |
|
|
|
DesignKit.i18nText("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(I18nKit.getLocText("Plugin-ZTree_Widget_Popup_Height")) |
|
|
|
.setI18NName(DesignKit.i18nText("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(I18nKit.getLocText("Plugin-ZTree_Mode")) |
|
|
|
.setI18NName(DesignKit.i18nText("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(I18nKit.getLocText("Plugin-ZTree_Cascade")) |
|
|
|
.setI18NName(DesignKit.i18nText("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[]) ArrayKit.addAll(super.supportedDescriptor(), crp); |
|
|
|
return ArrayKit.addAll(super.supportedDescriptor(), crp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JComponent initEditor() { |
|
|
|
protected JComponent initEditor() { |
|
|
@ -88,6 +85,7 @@ public class XZTree extends XFieldEditor { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 控件的预定义大小 |
|
|
|
* 控件的预定义大小 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 控件的预定义大小 |
|
|
|
* @return 控件的预定义大小 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -104,12 +102,8 @@ public class XZTree extends XFieldEditor { |
|
|
|
* 获取当前XCreator的一个封装父容器 |
|
|
|
* 获取当前XCreator的一个封装父容器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param widgetName 当前组件名 |
|
|
|
* @param widgetName 当前组件名 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 封装的父容器 |
|
|
|
* @return 封装的父容器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-11-25-下午4:47:23 |
|
|
|
* @date 2014-11-25-下午4:47:23 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected XLayoutContainer getCreatorWrapper(String widgetName) { |
|
|
|
protected XLayoutContainer getCreatorWrapper(String widgetName) { |
|
|
@ -120,10 +114,7 @@ public class XZTree extends XFieldEditor { |
|
|
|
* 将当前对象添加到父容器中 |
|
|
|
* 将当前对象添加到父容器中 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param parentPanel 父容器组件 |
|
|
|
* @param parentPanel 父容器组件 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-11-25-下午4:57:55 |
|
|
|
* @date 2014-11-25-下午4:57:55 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight) { |
|
|
|
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight) { |
|
|
|