1 33 34 package com.icesoft.faces.component.tree; 35 36 import javax.faces.component.NamingContainer; 37 import javax.faces.component.UIComponent; 38 import javax.faces.component.UIComponentBase; 39 import javax.swing.tree.DefaultMutableTreeNode ; 40 41 63 public class TreeNode extends UIComponentBase implements NamingContainer { 64 65 68 public TreeNode() { 69 } 70 71 75 public TreeNode(DefaultMutableTreeNode node, Tree trunk) { 76 this.mutable = node; 77 this.tree = trunk; 78 } 79 80 private DefaultMutableTreeNode mutable; 81 private Tree tree; 82 85 public static final String FACET_CONTENT = "content"; 86 89 public static final String FACET_ICON = "icon"; 90 91 94 public String getRendererType() { 95 return "com.icesoft.faces.View"; 96 } 97 98 101 public String getFamily() { 102 return "com.icesoft.faces.TreeNode"; 103 } 104 105 108 public DefaultMutableTreeNode getMutable() { 109 return mutable; 110 } 111 112 115 public void setMutable(DefaultMutableTreeNode mutable) { 116 this.mutable = mutable; 117 } 118 119 122 public Tree getTree() { 123 return tree; 124 } 125 126 129 public void setTree(Tree tree) { 130 this.tree = tree; 131 } 132 133 136 public UIComponent getContent() { 137 return (UIComponent) getFacets().get(FACET_CONTENT); 138 } 139 140 143 public UIComponent getIcon() { 144 return (UIComponent) getFacets().get(FACET_ICON); 145 } 146 147 148 } 149 | Popular Tags |