Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: renderkits/taglib/svg/OutputTextTag.java


1   /*
2    * The contents of this file are subject to the terms
3    * of the Common Development and Distribution License
4    * (the License). You may not use this file except in
5    * compliance with the License.
6    * 
7    * You can obtain a copy of the License at
8    * https://javaserverfaces.dev.java.net/CDDL.html or
9    * legal/CDDLv1.0.txt. 
10   * See the License for the specific language governing
11   * permission and limitations under the License.
12   * 
13   * When distributing Covered Code, include this CDDL
14   * Header Notice in each file and include the License file
15   * at legal/CDDLv1.0.txt.    
16   * If applicable, add the following below the CDDL Header,
17   * with the fields enclosed by brackets [] replaced by
18   * your own identifying information:
19   * "Portions Copyrighted [year] [name of copyright owner]"
20   * 
21   * [Name of File] [ver.__] [Date]
22   * 
23   * Copyright 2005 Sun Microsystems Inc. All Rights Reserved
24   */
25  
26  package renderkits.taglib.svg;
27  
28  import javax.faces.component.UIComponent;
29  import javax.faces.context.FacesContext;
30  import javax.faces.convert.Converter;
31  import javax.faces.webapp.UIComponentELTag;
32  import javax.servlet.jsp.JspException;
33  
34  /*
35  * ******* GENERATED CODE - DO NOT EDIT *******
36  */
37  
38  
39  public final class OutputTextTag extends UIComponentELTag {
40  
41  
42      // Setter Methods
43      // PROPERTY: converter
44      private javax.el.ValueExpression converter;
45  
46      public void setConverter(javax.el.ValueExpression converter) {
47          this.converter = converter;
48      }
49  
50      // PROPERTY: value
51      private javax.el.ValueExpression value;
52  
53      public void setValue(javax.el.ValueExpression value) {
54          this.value = value;
55      }
56  
57      // PROPERTY: escape
58      private javax.el.ValueExpression escape;
59  
60      public void setEscape(javax.el.ValueExpression escape) {
61          this.escape = escape;
62      }
63  
64      // PROPERTY: style
65      private javax.el.ValueExpression style;
66  
67      public void setStyle(javax.el.ValueExpression style) {
68          this.style = style;
69      }
70  
71      // PROPERTY: styleClass
72      private javax.el.ValueExpression styleClass;
73  
74      public void setStyleClass(javax.el.ValueExpression styleClass) {
75          this.styleClass = styleClass;
76      }
77  
78      // PROPERTY: x
79      private javax.el.ValueExpression x;
80  
81      public void setX(javax.el.ValueExpression x) {
82          this.x = x;
83      }
84  
85      // PROPERTY: y
86      private javax.el.ValueExpression y;
87  
88      public void setY(javax.el.ValueExpression y) {
89          this.y = y;
90      }
91  
92      // PROPERTY: dx
93      private javax.el.ValueExpression dx;
94  
95      public void setDx(javax.el.ValueExpression dx) {
96          this.dx = dx;
97      }
98  
99      // PROPERTY: dy
100     private javax.el.ValueExpression dy;
101 
102     public void setDy(javax.el.ValueExpression dy) {
103         this.dy = dy;
104     }
105 
106     // PROPERTY: textAnchor 
107     private javax.el.ValueExpression textAnchor;
108 
109     public void setTextAnchor(javax.el.ValueExpression textAnchor) {
110         this.textAnchor = textAnchor;
111     }
112 
113     // PROPERTY: rotate 
114     private javax.el.ValueExpression rotate;
115 
116     public void setRotate(javax.el.ValueExpression rotate) {
117         this.rotate = rotate;
118     }
119 
120     // PROPERTY: textLength 
121     private javax.el.ValueExpression textLength;
122 
123     public void setTextLength(javax.el.ValueExpression textLength) {
124         this.textLength = textLength;
125     }
126 
127     // PROPERTY: textAdjust 
128     private javax.el.ValueExpression textAdjust;
129 
130     public void setTextAdjust(javax.el.ValueExpression textAdjust) {
131         this.textAdjust = textAdjust;
132     }
133 
134     // General Methods
135     public String getRendererType() {
136         return "renderkit.svg.Text";
137     }
138 
139     public String getComponentType() {
140         return "javax.faces.Output";
141     }
142 
143     protected void setProperties(UIComponent component) {
144         super.setProperties(component);
145         javax.faces.component.UIOutput output = null;
146         try {
147             output = (javax.faces.component.UIOutput) component;
148         } catch (ClassCastException cce) {
149             throw new IllegalStateException("Component "
150                                             + component.toString()
151                                             + " not expected type.  Expected: javax.faces.component.UIOutput.  Perhaps you're missing a tag?");
152         }
153 
154         if (converter != null) {
155             if (!converter.isLiteralText()) {
156                 output.setValueExpression("converter", converter);
157             } else {
158                 Converter conv = FacesContext.getCurrentInstance()
159                       .getApplication()
160                       .createConverter(converter.getExpressionString());
161                 output.setConverter(conv);
162             }
163         }
164 
165         if (value != null) {
166             if (!value.isLiteralText()) {
167                 output.setValueExpression("value", value);
168             } else {
169                 output.setValue(value.getExpressionString());
170             }
171         }
172 
173         if (escape != null) {
174             if (!escape.isLiteralText()) {
175                 output.setValueExpression("escape", escape);
176             } else {
177                 output.getAttributes().put("escape",
178                                            java.lang.Boolean.valueOf(escape.getExpressionString()));
179             }
180         }
181         if (style != null) {
182             if (!style.isLiteralText()) {
183                 output.setValueExpression("style", style);
184             } else {
185                 output.getAttributes()
186                       .put("style", style.getExpressionString());
187             }
188         }
189         if (styleClass != null) {
190             if (!styleClass.isLiteralText()) {
191                 output.setValueExpression("styleClass", styleClass);
192             } else {
193                 output.getAttributes()
194                       .put("styleClass", styleClass.getExpressionString());
195             }
196         }
197         if (x != null) {
198             if (!x.isLiteralText()) {
199                 output.setValueExpression("x", x);
200             } else {
201                 output.getAttributes().put("x", x.getExpressionString());
202             }
203         }
204         if (y != null) {
205             if (!y.isLiteralText()) {
206                 output.setValueExpression("y", y);
207             } else {
208                 output.getAttributes().put("y", y.getExpressionString());
209             }
210         }
211         if (dx != null) {
212             if (!dx.isLiteralText()) {
213                 output.setValueExpression("dx", dx);
214             } else {
215                 output.getAttributes().put("dx", dx.getExpressionString());
216             }
217         }
218         if (dy != null) {
219             if (!dy.isLiteralText()) {
220                 output.setValueExpression("dy", dy);
221             } else {
222                 output.getAttributes().put("dy", dy.getExpressionString());
223             }
224         }
225         if (textAnchor != null) {
226             if (!textAnchor.isLiteralText()) {
227                 output.setValueExpression("textAnchor", textAnchor);
228             } else {
229                 output.getAttributes()
230                       .put("textAnchor", textAnchor.getExpressionString());
231             }
232         }
233         if (rotate != null) {
234             if (!rotate.isLiteralText()) {
235                 output.setValueExpression("rotate", rotate);
236             } else {
237                 output.getAttributes()
238                       .put("rotate", rotate.getExpressionString());
239             }
240         }
241         if (textLength != null) {
242             if (!textLength.isLiteralText()) {
243                 output.setValueExpression("textLength", textLength);
244             } else {
245                 output.getAttributes()
246                       .put("textLength", textLength.getExpressionString());
247             }
248         }
249 
250     }
251 
252     // Methods From TagSupport
253     public int doStartTag() throws JspException {
254         try {
255             return super.doStartTag();
256         } catch (Exception e) {
257             Throwable root = e;
258             while (root.getCause() != null) {
259                 root = root.getCause();
260             }
261             throw new JspException(root);
262         }
263     }
264 
265     public int doEndTag() throws JspException {
266         try {
267             return super.doEndTag();
268         } catch (Exception e) {
269             Throwable root = e;
270             while (root.getCause() != null) {
271                 root = root.getCause();
272             }
273             throw new JspException(root);
274         }
275     }
276 
277     // RELEASE
278     public void release() {
279         super.release();
280 
281         // component properties
282         this.converter = null;
283         this.value = null;
284 
285         // rendered attributes
286         this.escape = null;
287         this.style = null;
288         this.styleClass = null;
289     }
290 
291     public String getDebugString() {
292         String result =
293               "id: " + this.getId() + " class: " + this.getClass().getName();
294         return result;
295     }
296 
297 }