1 16 17 package org.apache.myfaces.custom.tree2; 18 19 import org.apache.myfaces.taglib.UIComponentTagBase; 20 import javax.faces.component.UIComponent; 21 import javax.faces.context.FacesContext; 22 import javax.faces.el.ValueBinding; 23 import org.apache.myfaces.renderkit.JSFAttr; 24 25 29 30 public class TreeTag extends UIComponentTagBase { 32 private String _value; 33 private String _var; 34 private String _varNodeToggler; 35 private String _showLines; 36 private String _showNav; 37 private String _clientSideToggle; 38 private String _showRootNode; 39 40 public void release() 41 { 42 super.release(); 43 44 _value=null; 45 _var=null; 46 _varNodeToggler=null; 47 _showLines = null; 48 _showNav = null; 49 _clientSideToggle = null; 50 _showRootNode = null; 51 } 52 53 public String getComponentType() 54 { 55 return "org.apache.myfaces.HtmlTree2"; 56 } 57 58 public String getRendererType() 59 { 60 return "org.apache.myfaces.HtmlTree2"; 61 } 62 63 public void setValue(String value) 64 { 65 _value = value; 66 } 67 68 71 public void setVar(String var) 72 { 73 _var = var; 74 } 75 76 public void setVarNodeToggler(String varNodeToggler) 77 { 78 _varNodeToggler = varNodeToggler; 79 } 80 81 public void setShowLines(String showLines) 82 { 83 _showLines = showLines; 84 } 85 86 public void setShowNav(String showNav) 87 { 88 _showNav = showNav; 89 } 90 91 public void setClientSideToggle(String clientSideToggle) 92 { 93 _clientSideToggle = clientSideToggle; 94 } 95 96 public void setShowRootNode(String showRootNode) 97 { 98 _showRootNode = showRootNode; 99 } 100 101 protected void setProperties(UIComponent component) 102 { 103 super.setProperties(component); 104 105 FacesContext context = getFacesContext(); 106 107 if (_value != null) 108 { 109 ValueBinding vb = context.getApplication().createValueBinding(_value); 110 component.setValueBinding("value", vb); 111 } 112 113 if (_var != null) 114 { 115 ((HtmlTree)component).setVar(_var); 116 } 117 118 if (_varNodeToggler != null) 119 { 120 ((HtmlTree)component).setVarNodeToggler(_varNodeToggler); 121 } 122 123 setBooleanProperty(component, JSFAttr.SHOW_NAV, _showNav); 124 setBooleanProperty(component, JSFAttr.SHOW_LINES, _showLines); 125 setBooleanProperty(component, JSFAttr.CLIENT_SIDE_TOGGLE, _clientSideToggle); 126 setBooleanProperty(component, JSFAttr.SHOW_ROOT_NODE, _showRootNode); 127 } 128 } 129 | Popular Tags |