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.UIColumn;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30
31
32
33
34 public final class ColumnTag extends TobagoELTag {
35 private static final Logger LOG = LoggerFactory.getLogger(ColumnTag.class);
36 private javax.el.ValueExpression markup;
37 private javax.el.ValueExpression width;
38 private javax.el.ValueExpression sortable;
39 private javax.el.ValueExpression align;
40 private javax.el.ValueExpression label;
41 private javax.el.ValueExpression tip;
42 private javax.el.ValueExpression resizable;
43
44 @Override
45 public String getComponentType() {
46 return UIColumn.COMPONENT_TYPE;
47 }
48 @Override
49 public String getRendererType() {
50 return "Column";
51 }
52
53 @Override
54 protected void setProperties(final UIComponent uiComponent) {
55 super.setProperties(uiComponent);
56 final UIColumn component = (UIColumn) uiComponent;
57 final FacesContext context = FacesContext.getCurrentInstance();
58 final Application application = context.getApplication();
59 if (markup != null) {
60 if (!markup.isLiteralText()) {
61 component.setValueExpression("markup", markup);
62 } else {
63 component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
64 }
65 }
66 if (width != null) {
67 if (!width.isLiteralText()) {
68 component.setValueExpression("width", width);
69 } else {
70 component.setWidth(org.apache.myfaces.tobago.layout.Measure.valueOf(width.getExpressionString()));
71 }
72 }
73 if (sortable != null) {
74 if (!sortable.isLiteralText()) {
75 component.setValueExpression("sortable", sortable);
76 } else {
77 component.setSortable(Boolean.parseBoolean(sortable.getExpressionString()));
78 }
79 }
80 if (align != null) {
81 component.setValueExpression("align", align);
82 }
83
84 if (label != null) {
85 component.setValueExpression("label", label);
86 }
87
88 if (tip != null) {
89 component.setValueExpression("tip", tip);
90 }
91
92 if (resizable != null) {
93 if (!resizable.isLiteralText()) {
94 component.setValueExpression("resizable", resizable);
95 } else {
96 component.setResizable(Boolean.parseBoolean(resizable.getExpressionString()));
97 }
98 }
99 }
100
101 public javax.el.ValueExpression getMarkup() {
102 return markup;
103 }
104
105 public void setMarkup(final javax.el.ValueExpression markup) {
106 this.markup = markup;
107 }
108
109 public javax.el.ValueExpression getWidth() {
110 return width;
111 }
112
113 public void setWidth(final javax.el.ValueExpression width) {
114 this.width = width;
115 }
116
117 public javax.el.ValueExpression getSortable() {
118 return sortable;
119 }
120
121 public void setSortable(final javax.el.ValueExpression sortable) {
122 this.sortable = sortable;
123 }
124
125 public javax.el.ValueExpression getAlign() {
126 return align;
127 }
128
129 public void setAlign(final javax.el.ValueExpression align) {
130 this.align = align;
131 }
132
133 public javax.el.ValueExpression getLabel() {
134 return label;
135 }
136
137 public void setLabel(final javax.el.ValueExpression label) {
138 this.label = label;
139 }
140
141 public javax.el.ValueExpression getTip() {
142 return tip;
143 }
144
145 public void setTip(final javax.el.ValueExpression tip) {
146 this.tip = tip;
147 }
148
149 public javax.el.ValueExpression getResizable() {
150 return resizable;
151 }
152
153 public void setResizable(final javax.el.ValueExpression resizable) {
154 this.resizable = resizable;
155 }
156
157
158
159 @Override
160 public void release() {
161 super.release();
162 markup = null;
163 width = null;
164 sortable = null;
165 align = null;
166 label = null;
167 tip = null;
168 resizable = null;
169 }
170 }