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.UIProgress;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30
31
32
33
34 public final class ProgressTag extends TobagoELTag {
35 private static final Logger LOG = LoggerFactory.getLogger(ProgressTag.class);
36 private javax.el.ValueExpression markup;
37 private javax.el.ValueExpression tip;
38 private javax.el.ValueExpression value;
39
40 @Override
41 public String getComponentType() {
42 return UIProgress.COMPONENT_TYPE;
43 }
44 @Override
45 public String getRendererType() {
46 return "Progress";
47 }
48
49 @Override
50 protected void setProperties(final UIComponent uiComponent) {
51 super.setProperties(uiComponent);
52 final UIProgress component = (UIProgress) uiComponent;
53 final FacesContext context = FacesContext.getCurrentInstance();
54 final Application application = context.getApplication();
55 if (markup != null) {
56 if (!markup.isLiteralText()) {
57 component.setValueExpression("markup", markup);
58 } else {
59 component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
60 }
61 }
62 if (tip != null) {
63 component.setValueExpression("tip", tip);
64 }
65
66 if (value != null) {
67 if (!value.isLiteralText()) {
68 component.setValueExpression("value", value);
69
70
71 }
72 }
73 }
74
75 public javax.el.ValueExpression getMarkup() {
76 return markup;
77 }
78
79 public void setMarkup(final javax.el.ValueExpression markup) {
80 this.markup = markup;
81 }
82
83 public javax.el.ValueExpression getTip() {
84 return tip;
85 }
86
87 public void setTip(final javax.el.ValueExpression tip) {
88 this.tip = tip;
89 }
90
91 public javax.el.ValueExpression getValue() {
92 return value;
93 }
94
95 public void setValue(final javax.el.ValueExpression value) {
96 this.value = value;
97 }
98
99
100
101 @Override
102 public void release() {
103 super.release();
104 markup = null;
105 tip = null;
106 value = null;
107 }
108 }