package com.vci.starter.revision.bo; import com.vci.starter.web.pagemodel.TreeQueryObject; /** * 转换为树型数据时的配置信息 * @author weidy * @date 2020/4/22 */ public class TreeWrapperOptions implements java.io.Serializable{ /** * 请勿修改这个值 */ private static final long serialVersionUID = 3183500138266494574L; /** * 显示文本所使用的属性 */ private String textFieldName = "name"; /** * 多个显示文本的属性时的分隔符(最终显示的值的分隔符) */ private String textValueSep = " "; /** * 上级数据的属性名称 */ private String parentFieldName; /** * 主键的属性名称 */ private String oidFieldName = "oid"; /** * 多个值属性时的分隔符 */ private String oidValueSep = ","; /** * 是否查询所有的属性 */ private boolean allAttributes = true; /** * 上级的主键的值 */ private String parentOid; /** * 是否多选 */ private boolean multipleSelect = false; /** * 是否显示复选框 */ private boolean showCheckBox = false; /** * 构造函数 */ public TreeWrapperOptions(){ } /** * 常用的构造函数,只设置上级属性的名称 * @param parentFieldName 上级属性的名称 */ public TreeWrapperOptions(String parentFieldName){ this.parentFieldName = parentFieldName; } /** * 常用的构造函数,设置显示text和上级属性的名称 * @param textFieldName 显示文本属性的名称 * @param parentFieldName 上级属性的名称 */ public TreeWrapperOptions(String textFieldName,String parentFieldName){ this.textFieldName = textFieldName; this.parentFieldName = parentFieldName; } /** * 常用的构造函数,设置显示text、上级属性的名称、 * @param textFieldName 显示文本属性的名称 * @param parentFieldName 上级属性的名称 * @param parentOid 上级主键 */ public TreeWrapperOptions(String textFieldName,String parentFieldName,String parentOid){ this.textFieldName = textFieldName; this.parentFieldName = parentFieldName; this.parentOid = parentOid; } /** * 从树形查询对象上拷贝 * @param treeQueryObject 树形查询对象 */ public void copyFromTreeQuery(TreeQueryObject treeQueryObject){ if(treeQueryObject != null){ this.parentOid = treeQueryObject.getParentOid(); this.multipleSelect = treeQueryObject.isMultipleSelect(); this.showCheckBox = treeQueryObject.isShowCheckBox(); } } public String getTextFieldName() { return textFieldName; } public void setTextFieldName(String textFieldName) { this.textFieldName = textFieldName; } public String getParentFieldName() { return parentFieldName; } public void setParentFieldName(String parentFieldName) { this.parentFieldName = parentFieldName; } public String getOidFieldName() { return oidFieldName; } public void setOidFieldName(String oidFieldName) { this.oidFieldName = oidFieldName; } public boolean isAllAttributes() { return allAttributes; } public void setAllAttributes(boolean allAttributes) { this.allAttributes = allAttributes; } public String getParentOid() { return parentOid; } public void setParentOid(String parentOid) { this.parentOid = parentOid; } public boolean isMultipleSelect() { return multipleSelect; } public void setMultipleSelect(boolean multipleSelect) { this.multipleSelect = multipleSelect; } public boolean isShowCheckBox() { return showCheckBox; } public void setShowCheckBox(boolean showCheckBox) { this.showCheckBox = showCheckBox; } public String getTextValueSep() { return textValueSep; } public void setTextValueSep(String textValueSep) { this.textValueSep = textValueSep; } public String getOidValueSep() { return oidValueSep; } public void setOidValueSep(String oidValueSep) { this.oidValueSep = oidValueSep; } @Override public String toString() { return "TreeWrapperOptions{" + "textFieldName='" + textFieldName + '\'' + ", textValueSep='" + textValueSep + '\'' + ", parentFieldName='" + parentFieldName + '\'' + ", oidFieldName='" + oidFieldName + '\'' + ", oidValueSep='" + oidValueSep + '\'' + ", allAttributes=" + allAttributes + ", parentOid='" + parentOid + '\'' + ", multipleSelect=" + multipleSelect + ", showCheckBox=" + showCheckBox + '}'; } }