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.
48 lines
1.0 KiB
48 lines
1.0 KiB
9 years ago
|
package com.fr.plugin.widget.ztree.core;
|
||
|
|
||
6 years ago
|
import com.fanruan.api.i18n.I18nKit;
|
||
|
import com.fanruan.api.util.StringKit;
|
||
9 years ago
|
|
||
|
/**
|
||
|
* Created by richie on 15/12/10.
|
||
|
*/
|
||
|
public enum ZTreeCascade {
|
||
|
|
||
|
NONE("none", "Plugin-ZTree_Cascade_None"),
|
||
|
CHILD("child", "Plugin-ZTree_Cascade_Child"),
|
||
|
DESCENDANT("descendant", "Plugin-ZTree_Cascade_Descendant");
|
||
|
|
||
|
private String type;
|
||
|
private String localeKey;
|
||
|
|
||
|
ZTreeCascade(String type, String localeKey) {
|
||
|
this.type = type;
|
||
|
this.localeKey = localeKey;
|
||
|
}
|
||
|
|
||
|
public String toLocaleText() {
|
||
6 years ago
|
return I18nKit.getLocText(localeKey);
|
||
9 years ago
|
}
|
||
|
|
||
|
public String toLocaleKey() {
|
||
|
return localeKey;
|
||
|
}
|
||
|
|
||
|
public String toText() {
|
||
|
return type;
|
||
|
}
|
||
|
|
||
|
public boolean isCascade() {
|
||
|
return this != NONE;
|
||
|
}
|
||
|
|
||
|
|
||
|
public static ZTreeCascade parser(String type) {
|
||
|
for (ZTreeCascade style : values()) {
|
||
6 years ago
|
if (StringKit.equals(type, style.type)) {
|
||
9 years ago
|
return style;
|
||
|
}
|
||
|
}
|
||
|
return DESCENDANT;
|
||
|
}
|
||
|
}
|