View Javadoc

1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.faces.context.FacesContext;
23  import org.apache.myfaces.tobago.context.Markup;
24  import org.apache.myfaces.tobago.internal.component.AbstractUIOut;
25  import org.apache.myfaces.tobago.layout.Display;
26  import org.apache.myfaces.tobago.layout.Measure;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import org.apache.myfaces.tobago.renderkit.MarginValues;
31  import org.apache.myfaces.tobago.renderkit.SpacingValues;
32  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
33  import javax.el.ELException;
34  import javax.faces.FacesException;
35  import java.util.ArrayList;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /** 
41   Show external content inside of an application.
42    This will typically renders an iframe tag.
43    * UIComponent class, generated from template {@code component2.0.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.ObjectTagDeclaration}.
45   */
46  public class UIObject
47      extends AbstractUIOut implements SupportsMarkup {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Object";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Output";
52  
53    private org.apache.myfaces.tobago.context.Markup currentMarkup;
54  
55    enum PropertyKeys {
56      currentWidth,
57      markup,
58      marginTop,
59      marginLeft,
60      width,
61      marginRight,
62      currentHeight,
63      preferredHeight,
64      display,
65      minimumHeight,
66      maximumWidth,
67      preferredWidth,
68      marginBottom,
69      height,
70      verticalIndex,
71      minimumWidth,
72      name,
73      rowSpan,
74      horizontalIndex,
75      left,
76      src,
77      columnSpan,
78      top,
79      maximumHeight,
80    }
81  
82    public String getFamily() {
83      return COMPONENT_FAMILY;
84    }
85  
86  
87    /**
88    This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
89  
90    */
91    public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
92      Object object = getStateHelper().eval(PropertyKeys.currentWidth);
93      if (object != null) {
94         return Measure.valueOf(object);
95      }
96      return getWidth();
97    }
98  
99    public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
100     getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
101   }
102 
103   public org.apache.myfaces.tobago.context.Markup getMarkup() {
104     Object object = getStateHelper().eval(PropertyKeys.markup);
105     if (object != null) {
106       return Markup.valueOf(object);
107     }
108     return null;
109   }
110 
111   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
112     getStateHelper().put(PropertyKeys.markup, markup);
113   }
114 
115   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
116     Object object = getStateHelper().eval(PropertyKeys.marginTop);
117     if (object != null) {
118        return Measure.valueOf(object);
119     }
120     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
121   }
122 
123   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
124     getStateHelper().put(PropertyKeys.marginTop, marginTop);
125   }
126 
127   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
128     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
129     if (object != null) {
130        return Measure.valueOf(object);
131     }
132     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
133   }
134 
135   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
136     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
137   }
138 
139   /**
140   This value will usually be set by the layout manager.
141 
142   */
143   public org.apache.myfaces.tobago.layout.Measure getWidth() {
144     Object object = getStateHelper().eval(PropertyKeys.width);
145     if (object != null) {
146        return Measure.valueOf(object);
147     }
148     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this) : Measure.ZERO;
149   }
150 
151   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
152     getStateHelper().put(PropertyKeys.width, width);
153   }
154 
155   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
156     Object object = getStateHelper().eval(PropertyKeys.marginRight);
157     if (object != null) {
158        return Measure.valueOf(object);
159     }
160     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
161   }
162 
163   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
164     getStateHelper().put(PropertyKeys.marginRight, marginRight);
165   }
166 
167   /**
168   This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
169 
170   */
171   public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
172     Object object = getStateHelper().eval(PropertyKeys.currentHeight);
173     if (object != null) {
174        return Measure.valueOf(object);
175     }
176     return getHeight();
177   }
178 
179   public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
180     getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
181   }
182 
183   public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
184     Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
185     if (object != null) {
186        return Measure.valueOf(object);
187     }
188     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this) : Measure.ZERO;
189   }
190 
191   public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
192     getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
193   }
194 
195   /**
196   This attribute is for internal use only.
197 
198   */
199   public org.apache.myfaces.tobago.layout.Display getDisplay() {
200     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
201   }
202 
203   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
204     getStateHelper().put(PropertyKeys.display, display);
205   }
206 
207   public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
208     Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
209     if (object != null) {
210        return Measure.valueOf(object);
211     }
212     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this) : Measure.ZERO;
213   }
214 
215   public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
216     getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
217   }
218 
219   public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
220     Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
221     if (object != null) {
222        return Measure.valueOf(object);
223     }
224     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this) : Measure.ZERO;
225   }
226 
227   public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
228     getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
229   }
230 
231   public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
232     Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
233     if (object != null) {
234        return Measure.valueOf(object);
235     }
236     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this) : Measure.ZERO;
237   }
238 
239   public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
240     getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
241   }
242 
243   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
244     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
245     if (object != null) {
246        return Measure.valueOf(object);
247     }
248     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
249   }
250 
251   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
252     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
253   }
254 
255   /**
256   This value will usually be set by the layout manager.
257 
258   */
259   public org.apache.myfaces.tobago.layout.Measure getHeight() {
260     Object object = getStateHelper().eval(PropertyKeys.height);
261     if (object != null) {
262        return Measure.valueOf(object);
263     }
264     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this) : Measure.ZERO;
265   }
266 
267   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
268     getStateHelper().put(PropertyKeys.height, height);
269   }
270 
271   /**
272   This attribute is for internal use only.
273 
274   */
275   public java.lang.Integer getVerticalIndex() {
276     Number value  = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
277     if (value != null) {
278       return value.intValue();
279     }
280     return null;
281   }
282 
283   public void setVerticalIndex(java.lang.Integer verticalIndex) {
284     getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
285   }
286 
287   public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
288     Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
289     if (object != null) {
290        return Measure.valueOf(object);
291     }
292     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this) : Measure.ZERO;
293   }
294 
295   public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
296     getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
297   }
298 
299   /**
300   Name of the element.
301    If not set the id will be used as name. The id in JSF normally contains colons.
302    This doesn't work in Internet Explorer 9 and lower when using window.open(src, target).
303 
304   */
305   public java.lang.String getName() {
306     return (java.lang.String) getStateHelper().eval(PropertyKeys.name);
307   }
308 
309   public void setName(java.lang.String name) {
310     getStateHelper().put(PropertyKeys.name, name);
311   }
312 
313   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
314     if (currentMarkup != null) {
315       return currentMarkup;
316     }
317     return null;
318   }
319 
320   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
321     this.currentMarkup = currentMarkup;
322   }
323 
324   public java.lang.Integer getRowSpan() {
325     Number value  = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
326     if (value != null) {
327       return value.intValue();
328     }
329     return 1;
330   }
331 
332   public void setRowSpan(java.lang.Integer rowSpan) {
333     getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
334   }
335 
336   /**
337   This attribute is for internal use only.
338 
339   */
340   public java.lang.Integer getHorizontalIndex() {
341     Number value  = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
342     if (value != null) {
343       return value.intValue();
344     }
345     return null;
346   }
347 
348   public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
349     getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
350   }
351 
352   /**
353   This value will usually be set by the layout manager.
354 
355   */
356   public org.apache.myfaces.tobago.layout.Measure getLeft() {
357     Object object = getStateHelper().eval(PropertyKeys.left);
358     if (object != null) {
359        return Measure.valueOf(object);
360     }
361     return null;
362   }
363 
364   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
365     getStateHelper().put(PropertyKeys.left, left);
366   }
367 
368   /**
369   URI to object source
370 
371   */
372   public java.lang.String getSrc() {
373     return (java.lang.String) getStateHelper().eval(PropertyKeys.src);
374   }
375 
376   public void setSrc(java.lang.String src) {
377     getStateHelper().put(PropertyKeys.src, src);
378   }
379 
380   public java.lang.Integer getColumnSpan() {
381     Number value  = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
382     if (value != null) {
383       return value.intValue();
384     }
385     return 1;
386   }
387 
388   public void setColumnSpan(java.lang.Integer columnSpan) {
389     getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
390   }
391 
392   /**
393   This value will usually be set by the layout manager.
394 
395   */
396   public org.apache.myfaces.tobago.layout.Measure getTop() {
397     Object object = getStateHelper().eval(PropertyKeys.top);
398     if (object != null) {
399        return Measure.valueOf(object);
400     }
401     return null;
402   }
403 
404   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
405     getStateHelper().put(PropertyKeys.top, top);
406   }
407 
408   public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
409     Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
410     if (object != null) {
411        return Measure.valueOf(object);
412     }
413     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this) : Measure.ZERO;
414   }
415 
416   public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
417     getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
418   }
419 
420   public Object saveState(FacesContext context) {
421     currentMarkup = null;
422     return super.saveState(context);
423   }
424 
425 }