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.AbstractUIWizard;
25  import org.apache.myfaces.tobago.layout.Display;
26  import org.apache.myfaces.tobago.layout.Measure;
27  import org.apache.myfaces.tobago.model.Wizard;
28  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
29  import org.apache.myfaces.tobago.internal.util.StringUtils;
30  import org.apache.myfaces.tobago.internal.util.Deprecation;
31  import org.apache.myfaces.tobago.renderkit.MarginValues;
32  import org.apache.myfaces.tobago.renderkit.SpacingValues;
33  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
34  import javax.el.ELException;
35  import javax.faces.FacesException;
36  import java.util.ArrayList;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /** 
42   Renders a flexible wizard.
43    * UIComponent class, generated from template {@code component2.0.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.WizardTagDeclaration}.
45   */
46  public class UIWizard
47      extends AbstractUIWizard implements SupportsMarkup {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Wizard";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Panel";
52  
53    private org.apache.myfaces.tobago.context.Markup currentMarkup;
54  
55    enum PropertyKeys {
56      markup,
57      marginLeft,
58      var,
59      minimumHeight,
60      borderLeft,
61      title,
62      height,
63      minimumWidth,
64      overflowX,
65      rowSpan,
66      overflowY,
67      left,
68      columnSpan,
69      borderRight,
70      paddingBottom,
71      maximumHeight,
72      top,
73      currentWidth,
74      paddingTop,
75      marginTop,
76      marginRight,
77      width,
78      preferredHeight,
79      currentHeight,
80      borderBottom,
81      display,
82      maximumWidth,
83      outcome,
84      paddingLeft,
85      paddingRight,
86      preferredWidth,
87      marginBottom,
88      verticalIndex,
89      borderTop,
90      allowJumpForward,
91      horizontalIndex,
92      controller,
93    }
94  
95    public String getFamily() {
96      return COMPONENT_FAMILY;
97    }
98  
99  
100   public org.apache.myfaces.tobago.context.Markup getMarkup() {
101     Object object = getStateHelper().eval(PropertyKeys.markup);
102     if (object != null) {
103       return Markup.valueOf(object);
104     }
105     return null;
106   }
107 
108   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
109     getStateHelper().put(PropertyKeys.markup, markup);
110   }
111 
112   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
113     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
114     if (object != null) {
115        return Measure.valueOf(object);
116     }
117     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
118   }
119 
120   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
121     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
122   }
123 
124   /**
125   Name of a request-scope attribute under which the model data will be exposed.
126 
127   */
128   public java.lang.String getVar() {
129     return (java.lang.String) getStateHelper().eval(PropertyKeys.var);
130   }
131 
132   public void setVar(java.lang.String var) {
133     getStateHelper().put(PropertyKeys.var, var);
134   }
135 
136   public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
137     Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
138     if (object != null) {
139        return Measure.valueOf(object);
140     }
141     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this) : Measure.ZERO;
142   }
143 
144   public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
145     getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
146   }
147 
148   /**
149   This attribute is for internal use only.
150 
151   */
152   public org.apache.myfaces.tobago.layout.Measure getBorderLeft() {
153     Object object = getStateHelper().eval(PropertyKeys.borderLeft);
154     if (object != null) {
155        return Measure.valueOf(object);
156     }
157     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
158    getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this) : Measure.ZERO;
159   }
160 
161   public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) {
162     getStateHelper().put(PropertyKeys.borderLeft, borderLeft);
163   }
164 
165   /**
166   Title of this page
167 
168   */
169   public java.lang.String getTitle() {
170     return (java.lang.String) getStateHelper().eval(PropertyKeys.title);
171   }
172 
173   public void setTitle(java.lang.String title) {
174     getStateHelper().put(PropertyKeys.title, title);
175   }
176 
177   /**
178   This value will usually be set by the layout manager.
179 
180   */
181   public org.apache.myfaces.tobago.layout.Measure getHeight() {
182     Object object = getStateHelper().eval(PropertyKeys.height);
183     if (object != null) {
184        return Measure.valueOf(object);
185     }
186     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this) : Measure.ZERO;
187   }
188 
189   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
190     getStateHelper().put(PropertyKeys.height, height);
191   }
192 
193   public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
194     Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
195     if (object != null) {
196        return Measure.valueOf(object);
197     }
198     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this) : Measure.ZERO;
199   }
200 
201   public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
202     getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
203   }
204 
205   /**
206   This attribute is for internal use only.
207 
208   */
209   public boolean isOverflowX() {
210     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowX);
211     if (bool != null) {
212       return bool;
213     }
214     return false;
215   }
216 
217   public void setOverflowX(boolean overflowX) {
218     getStateHelper().put(PropertyKeys.overflowX, overflowX);
219   }
220 
221   public java.lang.Integer getRowSpan() {
222     Number value  = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
223     if (value != null) {
224       return value.intValue();
225     }
226     return 1;
227   }
228 
229   public void setRowSpan(java.lang.Integer rowSpan) {
230     getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
231   }
232 
233   /**
234   This attribute is for internal use only.
235 
236   */
237   public boolean isOverflowY() {
238     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowY);
239     if (bool != null) {
240       return bool;
241     }
242     return false;
243   }
244 
245   public void setOverflowY(boolean overflowY) {
246     getStateHelper().put(PropertyKeys.overflowY, overflowY);
247   }
248 
249   /**
250   This value will usually be set by the layout manager.
251 
252   */
253   public org.apache.myfaces.tobago.layout.Measure getLeft() {
254     Object object = getStateHelper().eval(PropertyKeys.left);
255     if (object != null) {
256        return Measure.valueOf(object);
257     }
258     return null;
259   }
260 
261   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
262     getStateHelper().put(PropertyKeys.left, left);
263   }
264 
265   public java.lang.Integer getColumnSpan() {
266     Number value  = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
267     if (value != null) {
268       return value.intValue();
269     }
270     return 1;
271   }
272 
273   public void setColumnSpan(java.lang.Integer columnSpan) {
274     getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
275   }
276 
277   /**
278   This attribute is for internal use only.
279 
280   */
281   public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
282     Object object = getStateHelper().eval(PropertyKeys.borderRight);
283     if (object != null) {
284        return Measure.valueOf(object);
285     }
286     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
287   getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this) : Measure.ZERO;
288   }
289 
290   public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
291     getStateHelper().put(PropertyKeys.borderRight, borderRight);
292   }
293 
294   /**
295   This attribute is for internal use only.
296 
297   */
298   public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
299     Object object = getStateHelper().eval(PropertyKeys.paddingBottom);
300     if (object != null) {
301        return Measure.valueOf(object);
302     }
303     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
304   getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this) : Measure.ZERO;
305   }
306 
307   public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
308     getStateHelper().put(PropertyKeys.paddingBottom, paddingBottom);
309   }
310 
311   public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
312     Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
313     if (object != null) {
314        return Measure.valueOf(object);
315     }
316     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this) : Measure.ZERO;
317   }
318 
319   public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
320     getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
321   }
322 
323   /**
324   This value will usually be set by the layout manager.
325 
326   */
327   public org.apache.myfaces.tobago.layout.Measure getTop() {
328     Object object = getStateHelper().eval(PropertyKeys.top);
329     if (object != null) {
330        return Measure.valueOf(object);
331     }
332     return null;
333   }
334 
335   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
336     getStateHelper().put(PropertyKeys.top, top);
337   }
338 
339   /**
340   This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
341 
342   */
343   public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
344     Object object = getStateHelper().eval(PropertyKeys.currentWidth);
345     if (object != null) {
346        return Measure.valueOf(object);
347     }
348     return getWidth();
349   }
350 
351   public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
352     getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
353   }
354 
355   /**
356   This attribute is for internal use only.
357 
358   */
359   public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
360     Object object = getStateHelper().eval(PropertyKeys.paddingTop);
361     if (object != null) {
362        return Measure.valueOf(object);
363     }
364     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
365   getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this) : Measure.ZERO;
366   }
367 
368   public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
369     getStateHelper().put(PropertyKeys.paddingTop, paddingTop);
370   }
371 
372   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
373     Object object = getStateHelper().eval(PropertyKeys.marginTop);
374     if (object != null) {
375        return Measure.valueOf(object);
376     }
377     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
378   }
379 
380   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
381     getStateHelper().put(PropertyKeys.marginTop, marginTop);
382   }
383 
384   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
385     Object object = getStateHelper().eval(PropertyKeys.marginRight);
386     if (object != null) {
387        return Measure.valueOf(object);
388     }
389     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
390   }
391 
392   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
393     getStateHelper().put(PropertyKeys.marginRight, marginRight);
394   }
395 
396   /**
397   This value will usually be set by the layout manager.
398 
399   */
400   public org.apache.myfaces.tobago.layout.Measure getWidth() {
401     Object object = getStateHelper().eval(PropertyKeys.width);
402     if (object != null) {
403        return Measure.valueOf(object);
404     }
405     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this) : Measure.ZERO;
406   }
407 
408   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
409     getStateHelper().put(PropertyKeys.width, width);
410   }
411 
412   public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
413     Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
414     if (object != null) {
415        return Measure.valueOf(object);
416     }
417     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this) : Measure.ZERO;
418   }
419 
420   public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
421     getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
422   }
423 
424   /**
425   This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
426 
427   */
428   public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
429     Object object = getStateHelper().eval(PropertyKeys.currentHeight);
430     if (object != null) {
431        return Measure.valueOf(object);
432     }
433     return getHeight();
434   }
435 
436   public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
437     getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
438   }
439 
440   /**
441   This attribute is for internal use only.
442 
443   */
444   public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
445     Object object = getStateHelper().eval(PropertyKeys.borderBottom);
446     if (object != null) {
447        return Measure.valueOf(object);
448     }
449     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
450   getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this) : Measure.ZERO;
451   }
452 
453   public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
454     getStateHelper().put(PropertyKeys.borderBottom, borderBottom);
455   }
456 
457   /**
458   This attribute is for internal use only.
459 
460   */
461   public org.apache.myfaces.tobago.layout.Display getDisplay() {
462     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
463   }
464 
465   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
466     getStateHelper().put(PropertyKeys.display, display);
467   }
468 
469   public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
470     Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
471     if (object != null) {
472        return Measure.valueOf(object);
473     }
474     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this) : Measure.ZERO;
475   }
476 
477   public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
478     getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
479   }
480 
481   /**
482   Outcome to navigate to this page.
483 
484   */
485   public java.lang.String getOutcome() {
486     return (java.lang.String) getStateHelper().eval(PropertyKeys.outcome);
487   }
488 
489   public void setOutcome(java.lang.String outcome) {
490     getStateHelper().put(PropertyKeys.outcome, outcome);
491   }
492 
493   /**
494   This attribute is for internal use only.
495 
496   */
497   public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
498     Object object = getStateHelper().eval(PropertyKeys.paddingLeft);
499     if (object != null) {
500        return Measure.valueOf(object);
501     }
502     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
503   getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this) : Measure.ZERO;
504   }
505 
506   public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
507     getStateHelper().put(PropertyKeys.paddingLeft, paddingLeft);
508   }
509 
510   /**
511   This attribute is for internal use only.
512 
513   */
514   public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
515     Object object = getStateHelper().eval(PropertyKeys.paddingRight);
516     if (object != null) {
517        return Measure.valueOf(object);
518     }
519     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
520   getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this) : Measure.ZERO;
521   }
522 
523   public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
524     getStateHelper().put(PropertyKeys.paddingRight, paddingRight);
525   }
526 
527   public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
528     Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
529     if (object != null) {
530        return Measure.valueOf(object);
531     }
532     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this) : Measure.ZERO;
533   }
534 
535   public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
536     getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
537   }
538 
539   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
540     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
541     if (object != null) {
542        return Measure.valueOf(object);
543     }
544     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
545   }
546 
547   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
548     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
549   }
550 
551   /**
552   This attribute is for internal use only.
553 
554   */
555   public java.lang.Integer getVerticalIndex() {
556     Number value  = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
557     if (value != null) {
558       return value.intValue();
559     }
560     return null;
561   }
562 
563   public void setVerticalIndex(java.lang.Integer verticalIndex) {
564     getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
565   }
566 
567   /**
568   This attribute is for internal use only.
569 
570   */
571   public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
572     Object object = getStateHelper().eval(PropertyKeys.borderTop);
573     if (object != null) {
574        return Measure.valueOf(object);
575     }
576     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
577   getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this) : Measure.ZERO;
578   }
579 
580   public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
581     getStateHelper().put(PropertyKeys.borderTop, borderTop);
582   }
583 
584   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
585     if (currentMarkup != null) {
586       return currentMarkup;
587     }
588     return null;
589   }
590 
591   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
592     this.currentMarkup = currentMarkup;
593   }
594 
595   /**
596   Is a jump forward to following pages allowed?
597   <br />Default: <code>false</code>
598   */
599   public boolean isAllowJumpForward() {
600     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.allowJumpForward);
601     if (bool != null) {
602       return bool;
603     }
604     return false;
605   }
606 
607   public void setAllowJumpForward(boolean allowJumpForward) {
608     getStateHelper().put(PropertyKeys.allowJumpForward, allowJumpForward);
609   }
610 
611   /**
612   This attribute is for internal use only.
613 
614   */
615   public java.lang.Integer getHorizontalIndex() {
616     Number value  = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
617     if (value != null) {
618       return value.intValue();
619     }
620     return null;
621   }
622 
623   public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
624     getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
625   }
626 
627   public org.apache.myfaces.tobago.model.Wizard getController() {
628     return (org.apache.myfaces.tobago.model.Wizard) getStateHelper().eval(PropertyKeys.controller);
629   }
630 
631   public void setController(org.apache.myfaces.tobago.model.Wizard controller) {
632     getStateHelper().put(PropertyKeys.controller, controller);
633   }
634 
635   public Object saveState(FacesContext context) {
636     currentMarkup = null;
637     return super.saveState(context);
638   }
639 
640 
641 }