1 16 17 package org.apache.myfaces.custom.tree2; 18 19 import java.util.List ; 20 import java.util.ArrayList ; 21 22 public class TreeNodeBase implements TreeNode 23 { 24 private ArrayList children = new ArrayList (); 25 private String type; 26 private String description; 27 private boolean leaf; 28 private String identifier; 29 private boolean expanded; 30 31 public TreeNodeBase() 32 {} 33 34 public TreeNodeBase(String type, String description, boolean leaf) 35 { 36 this(type, description, null, leaf); 37 } 38 39 public TreeNodeBase(String type, String description, String identifier, boolean leaf) 40 { 41 this.type = type; 42 this.description = description; 43 this.identifier = identifier; 44 this.leaf = leaf; 45 } 46 47 public boolean isLeaf() 48 { 49 return leaf; 50 } 51 52 public void setLeaf(boolean leaf) 53 { 54 this.leaf = leaf; 55 } 56 57 public List getChildren() 58 { 59 return children; 60 } 61 62 public String getType() 63 { 64 return type; 65 } 66 67 public void setType(String type) 68 { 69 this.type = type; 70 } 71 72 public void setDescription(String description) 73 { 74 this.description = description; 75 } 76 77 public String getDescription() 78 { 79 return description; 80 } 81 82 public void setIdentifier(String identifier) 83 { 84 this.identifier = identifier; 85 } 86 87 public String getIdentifier() 88 { 89 return identifier; 90 } 91 92 public int getChildCount() 93 { 94 return getChildren().size(); 95 } 96 } 97 | Popular Tags |