1 33 34 package com.icesoft.faces.component.tree; 35 36 import javax.swing.tree.DefaultMutableTreeNode ; 37 38 39 56 public class IceUserObject { 57 58 protected DefaultMutableTreeNode wrapper; 59 protected String text; 60 protected boolean expanded; 61 protected String tooltip; 62 protected String action; 63 protected TreeNode treeNode; 64 65 protected String leafIcon; 67 protected String branchExpandedIcon; 68 protected String branchContractedIcon; 69 protected String icon; 70 71 protected boolean leaf; 73 74 private int rowIndex; 76 77 80 public int getRowIndex() { 81 return rowIndex; 82 } 83 84 87 public void setRowIndex(int rowIndex) { 88 this.rowIndex = rowIndex; 89 } 90 91 93 99 public IceUserObject(DefaultMutableTreeNode wrapper) { 100 this.wrapper = wrapper; 101 } 102 103 111 public void setLeaf(boolean leaf) { 112 this.leaf = leaf; 113 } 114 115 121 public boolean isLeaf() { 122 return this.leaf; 123 } 124 125 130 public String action() { 131 return action; 132 } 133 134 136 139 public void setTreeNode(TreeNode treeNode) { 140 this.treeNode = treeNode; 141 } 142 143 146 public TreeNode getTreeNode() { 147 return this.treeNode; 148 } 149 150 155 public String getText() { 156 return text; 157 } 158 159 164 public void setText(String text) { 165 this.text = text; 166 } 167 168 171 public String getFamily() { 172 return null; 173 } 174 175 180 public boolean isExpanded() { 181 return expanded; 182 } 183 184 189 public void setExpanded(boolean isExpanded) { 190 this.expanded = isExpanded; 191 } 192 193 198 public String getTooltip() { 199 return tooltip; 200 } 201 202 207 public void setTooltip(String tooltipString) { 208 this.tooltip = tooltipString; 209 } 210 211 214 public String toString() { 215 return text; 216 } 217 218 223 public String getLeafIcon() { 224 return leafIcon; 225 } 226 227 232 public void setLeafIcon(String leafIcon) { 233 this.leafIcon = leafIcon; 234 } 235 236 242 public String getBranchContractedIcon() { 243 return branchContractedIcon; 244 } 245 246 251 public void setBranchContractedIcon(String branchContractedIcon) { 252 this.branchContractedIcon = branchContractedIcon; 253 } 254 255 260 public String getBranchExpandedIcon() { 261 return branchExpandedIcon; 262 } 263 264 269 public void setBranchExpandedIcon(String branchExpandedIcon) { 270 this.branchExpandedIcon = branchExpandedIcon; 271 } 272 273 280 public String getIcon() { 281 if (this.isLeaf()) { 283 if (leafIcon != null) { 284 return leafIcon; 285 } 286 } else if (isExpanded()) { 287 if (branchExpandedIcon != null) { 288 return branchExpandedIcon; 289 } 290 } else { 291 if (branchContractedIcon != null) { 292 return branchContractedIcon; 293 } 294 } 295 return icon; 296 } 297 298 303 public DefaultMutableTreeNode getWrapper() { 304 return wrapper; 305 } 306 307 312 public void setWrapper(DefaultMutableTreeNode wrapper) { 313 this.wrapper = wrapper; 314 } 315 316 321 public String getAction() { 322 return action; 323 } 324 325 330 public void setAction(String action) { 331 this.action = action; 332 } 333 } | Popular Tags |