这是一个插件控件的开发示例,实现了一个基于ztree的参数树控件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
951 B

package com.fr.plugin.widget.ztree.core;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.util.StringKit;
/**
* Created by richie on 15/11/18.
*/
public enum ZTreeStyle {
NONE("none", "Plugin-ZTree_Style_None"),
CHECK("checkbox", "Plugin-ZTree_Style_Checkbox"),
RADIO("radio", "Plugin-ZTree_Style_Radio");
private String type;
private String localeKey;
ZTreeStyle(String type, String localeKey) {
this.type = type;
this.localeKey = localeKey;
}
public String toLocaleText() {
return I18nKit.getLocText(localeKey);
}
public String toLocaleKey() {
return localeKey;
}
public String toText() {
return type;
}
public static ZTreeStyle parser(String type) {
for (ZTreeStyle style : values()) {
if (StringKit.equals(type, style.type)) {
return style;
}
}
return NONE;
}
}