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
package com.fr.plugin.widget.ztree.core; |
|
|
|
import com.fanruan.api.i18n.I18nKit; |
|
import com.fanruan.api.util.StringKit; |
|
|
|
/** |
|
* 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() { |
|
return I18nKit.getLocText(localeKey); |
|
} |
|
|
|
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()) { |
|
if (StringKit.equals(type, style.type)) { |
|
return style; |
|
} |
|
} |
|
return DESCENDANT; |
|
} |
|
} |