1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.internal.taglib;
21
22 import javax.faces.application.Application;
23 import javax.faces.component.UIComponent;
24 import javax.faces.context.FacesContext;
25 import org.apache.commons.lang.StringUtils;
26 import org.apache.myfaces.tobago.component.UITreeData;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30
31
32
33
34 public final class TreeDataTag extends TobagoELTag {
35 private static final Logger LOG = LoggerFactory.getLogger(TreeDataTag.class);
36 private String var;
37 private javax.el.ValueExpression value;
38
39 @Override
40 public String getComponentType() {
41 return UITreeData.COMPONENT_TYPE;
42 }
43 @Override
44 public String getRendererType() {
45 return "TreeData";
46 }
47
48 @Override
49 protected void setProperties(final UIComponent uiComponent) {
50 super.setProperties(uiComponent);
51 final UITreeData component = (UITreeData) uiComponent;
52 final FacesContext context = FacesContext.getCurrentInstance();
53 final Application application = context.getApplication();
54 if (var != null) {
55 component.setVar(var);
56 }
57
58 if (value != null) {
59 component.setValueExpression("value", value);
60 }
61
62 }
63
64 public String getVar() {
65 return var;
66 }
67
68 public void setVar(final String var) {
69 this.var = var;
70 }
71
72 public javax.el.ValueExpression getValue() {
73 return value;
74 }
75
76 public void setValue(final javax.el.ValueExpression value) {
77 this.value = value;
78 }
79
80
81
82 @Override
83 public void release() {
84 super.release();
85 var = null;
86 value = null;
87 }
88 }