TreeNode.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. package com.hcks.cmfds.commons.lang;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import java.util.List;
  5. /**
  6. * @Author 刘厦(liusha.information@gmail.com)
  7. * @Date 创建时间:May 16, 2011 12:04:11 PM
  8. * @Version 0.0.0
  9. * 类说明:
  10. */
  11. public class TreeNode {
  12. private String id;
  13. private String icon;
  14. private String iconCls;
  15. private String cls;
  16. private String expanedIcon;
  17. private String collapsedIcon;
  18. private String value;
  19. private String text;
  20. private boolean leaf;
  21. private boolean init;
  22. private boolean expanded;
  23. private String operations;
  24. private String href;
  25. private String attrs;
  26. private boolean checkbox;
  27. private boolean checked;
  28. private boolean canSelect;
  29. private List<TreeNode> nodes;
  30. private HashMap<String, String> extendAttr;
  31. private Integer state;
  32. private String reasonId;
  33. public String getReasonName() {
  34. return reasonName;
  35. }
  36. public void setReasonName(String reasonName) {
  37. this.reasonName = reasonName;
  38. }
  39. private String reasonName;
  40. public Integer getState() {
  41. return state;
  42. }
  43. public void setState(Integer state) {
  44. this.state = state;
  45. }
  46. public String getReasonId() {
  47. return reasonId;
  48. }
  49. public void setReasonId(String reasonId) {
  50. this.reasonId = reasonId;
  51. }
  52. public void addNode(TreeNode node) {
  53. if (nodes == null) {
  54. nodes = new ArrayList<TreeNode>();
  55. }
  56. nodes.add(node);
  57. }
  58. public void addExtendAttr(String attr, String value) {
  59. if (extendAttr == null) {
  60. extendAttr = new HashMap<String, String>();
  61. }
  62. extendAttr.put(attr, value);
  63. }
  64. public String getId() {
  65. return id;
  66. }
  67. public void setId(String id) {
  68. this.id = id;
  69. }
  70. public String getIcon() {
  71. return icon;
  72. }
  73. public void setIcon(String image) {
  74. this.icon = image;
  75. }
  76. public String getValue() {
  77. return value;
  78. }
  79. public void setValue(String value) {
  80. this.value = value;
  81. }
  82. public String getText() {
  83. return text;
  84. }
  85. public void setText(String text) {
  86. this.text = text;
  87. }
  88. public boolean isLeaf() {
  89. return leaf;
  90. }
  91. public void setLeaf(boolean isLeaf) {
  92. this.leaf = isLeaf;
  93. }
  94. public void setInit(boolean init) {
  95. this.init = init;
  96. }
  97. public boolean isInit() {
  98. return init;
  99. }
  100. public boolean isExpanded() {
  101. return expanded;
  102. }
  103. public void setExpanded(boolean expanded) {
  104. this.expanded = expanded;
  105. }
  106. public String getOperations() {
  107. return operations;
  108. }
  109. public void setOperations(String operations) {
  110. this.operations = operations;
  111. }
  112. public String getHref() {
  113. return href;
  114. }
  115. public void setHref(String href) {
  116. this.href = href;
  117. }
  118. public String getAttrs() {
  119. return attrs;
  120. }
  121. public void setAttrs(String attrs) {
  122. this.attrs = attrs;
  123. }
  124. public boolean isCheckbox() {
  125. return checkbox;
  126. }
  127. public void setCheckbox(boolean checkbox) {
  128. this.checkbox = checkbox;
  129. }
  130. public boolean isChecked() {
  131. return checked;
  132. }
  133. public void setChecked(boolean checked) {
  134. this.checked = checked;
  135. }
  136. public List<TreeNode> getNodes() {
  137. return nodes;
  138. }
  139. @SuppressWarnings("unchecked")
  140. public List<TreeNode> getNodes(boolean init) {
  141. if (nodes == null)
  142. nodes = new ArrayList();
  143. return nodes;
  144. }
  145. public void setNodes(List<TreeNode> nodes) {
  146. this.nodes = nodes;
  147. }
  148. public void setExpanedIcon(String expanedIcon) {
  149. this.expanedIcon = expanedIcon;
  150. }
  151. public String getExpanedIcon() {
  152. return expanedIcon;
  153. }
  154. public void setCollapsedIcon(String collapsedIcon) {
  155. this.collapsedIcon = collapsedIcon;
  156. }
  157. public String getCollapsedIcon() {
  158. return collapsedIcon;
  159. }
  160. public void setCanSelect(boolean canSelect) {
  161. this.canSelect = canSelect;
  162. }
  163. public boolean isCanSelect() {
  164. return canSelect;
  165. }
  166. @SuppressWarnings("unchecked")
  167. public void setExtendAttr(HashMap extendAttr) {
  168. this.extendAttr = extendAttr;
  169. }
  170. @SuppressWarnings("unchecked")
  171. public HashMap getExtendAttr() {
  172. return extendAttr;
  173. }
  174. public String getIconCls() {
  175. return iconCls;
  176. }
  177. public void setIconCls(String iconCls) {
  178. this.iconCls = iconCls;
  179. }
  180. public String getCls() {
  181. return cls;
  182. }
  183. public void setCls(String cls) {
  184. this.cls = cls;
  185. }
  186. }