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