001 // ---------- Attention: Generated code, please do not modify! -----------
002
003 /*
004 * Licensed to the Apache Software Foundation (ASF) under one or more
005 * contributor license agreements. See the NOTICE file distributed with
006 * this work for additional information regarding copyright ownership.
007 * The ASF licenses this file to You under the Apache License, Version 2.0
008 * (the "License"); you may not use this file except in compliance with
009 * the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019
020 package org.apache.myfaces.tobago.component;
021
022 import javax.faces.context.FacesContext;
023 import org.apache.myfaces.tobago.context.Markup;
024 import org.apache.myfaces.tobago.internal.component.AbstractUIInput;
025 import org.apache.myfaces.tobago.layout.Display;
026 import org.apache.myfaces.tobago.layout.Measure;
027 import org.apache.commons.lang.ArrayUtils;
028 import org.apache.commons.lang.StringUtils;
029 import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
030 import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
031 import org.apache.myfaces.tobago.internal.util.Deprecation;
032 import org.apache.myfaces.tobago.renderkit.MarginValues;
033 import org.apache.myfaces.tobago.renderkit.SpacingValues;
034 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
035 import javax.el.ELException;
036 import javax.faces.FacesException;
037 import java.util.ArrayList;
038 import java.util.List;
039 import javax.el.MethodExpression;
040 import javax.el.ValueExpression;
041
042 /**
043 Renders a multi line text input control.
044 * UIComponent class, generated from template {@code component1.2.stg} with class
045 * {@link org.apache.myfaces.tobago.internal.taglib.component.TextareaTagDeclaration}.
046 */
047 public class UITextarea
048 extends AbstractUIInput implements SupportsMarkup {
049
050 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Textarea";
051
052 private org.apache.myfaces.tobago.context.Markup markup;
053 private java.lang.Character accessKey;
054 private org.apache.myfaces.tobago.layout.Measure marginLeft;
055 private java.lang.String labelWithAccessKey;
056 private java.lang.Integer tabIndex;
057 private org.apache.myfaces.tobago.layout.Measure minimumHeight;
058 private java.lang.String tip;
059 private org.apache.myfaces.tobago.layout.Measure height;
060 private org.apache.myfaces.tobago.layout.Measure minimumWidth;
061 private java.lang.Integer rowSpan;
062 private java.lang.Boolean focus;
063 private org.apache.myfaces.tobago.layout.Measure left;
064 private java.lang.Integer columnSpan;
065 private java.lang.Boolean required;
066 private org.apache.myfaces.tobago.layout.Measure top;
067 private org.apache.myfaces.tobago.layout.Measure maximumHeight;
068 private org.apache.myfaces.tobago.layout.Measure currentWidth;
069 private org.apache.myfaces.tobago.layout.Measure marginTop;
070 private org.apache.myfaces.tobago.layout.Measure width;
071 private org.apache.myfaces.tobago.layout.Measure marginRight;
072 private org.apache.myfaces.tobago.layout.Measure preferredHeight;
073 private org.apache.myfaces.tobago.layout.Measure currentHeight;
074 private java.lang.String label;
075 private org.apache.myfaces.tobago.layout.Display display;
076 private org.apache.myfaces.tobago.layout.Measure maximumWidth;
077 private java.lang.String onchange;
078 private java.lang.String rows;
079 private org.apache.myfaces.tobago.layout.Measure preferredWidth;
080 private org.apache.myfaces.tobago.layout.Measure marginBottom;
081 private java.lang.Integer verticalIndex;
082 private org.apache.myfaces.tobago.context.Markup currentMarkup;
083 private java.lang.Integer horizontalIndex;
084 private java.lang.Boolean readonly;
085 private java.lang.Boolean disabled;
086
087
088 public org.apache.myfaces.tobago.context.Markup getMarkup() {
089 if (markup != null) {
090 return markup;
091 }
092 ValueExpression ve = getValueExpression("markup");
093 if (ve != null) {
094 try {
095 Object object = ve.getValue(getFacesContext().getELContext());
096 return Markup.valueOf(object);
097 } catch (ELException e) {
098 throw new FacesException(e);
099 }
100 }
101 return null;
102 }
103
104 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
105 this.markup = markup;
106 }
107
108 /**
109 Deprecated! Has not longer any function.
110
111 @deprecated*/
112 @Deprecated
113 public java.lang.Character getAccessKey() {
114 if (accessKey != null) {
115 return accessKey;
116 }
117 ValueExpression ve = getValueExpression("accessKey");
118 if (ve != null) {
119 try {
120 return (java.lang.Character) ve.getValue(getFacesContext().getELContext());
121 } catch (ELException e) {
122 throw new FacesException(e);
123 }
124 }
125 return null;
126 }
127
128 @Deprecated
129 public void setAccessKey(java.lang.Character accessKey) {
130 this.accessKey = accessKey;
131 }
132
133 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
134 if (marginLeft != null) {
135 return marginLeft;
136 }
137 ValueExpression ve = getValueExpression("marginLeft");
138 if (ve != null) {
139 try {
140 Object object = ve.getValue(getFacesContext().getELContext());
141 return Measure.valueOf(object);
142 } catch (ELException e) {
143 throw new FacesException(e);
144 }
145 }
146 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
147 }
148
149 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
150 this.marginLeft = marginLeft;
151 }
152
153 /**
154 Deprecated! Use 'label' instead.
155 Text value to display as label.
156 If text contains an underscore the next character overwrites 'accesskey'.
157
158 @deprecated*/
159 @Deprecated
160 public java.lang.String getLabelWithAccessKey() {
161 if (labelWithAccessKey != null) {
162 return labelWithAccessKey;
163 }
164 ValueExpression ve = getValueExpression("labelWithAccessKey");
165 if (ve != null) {
166 try {
167 return (java.lang.String) ve.getValue(getFacesContext().getELContext());
168 } catch (ELException e) {
169 throw new FacesException(e);
170 }
171 }
172 return null;
173 }
174
175 @Deprecated
176 public void setLabelWithAccessKey(java.lang.String labelWithAccessKey) {
177 this.labelWithAccessKey = labelWithAccessKey;
178 }
179
180 /**
181 Controls the navigation of the focus through the
182 input controls on a page with the Tab-Key.
183 The navigation starts from the element with
184 the lowest tabIndex value to the element with the highest value.
185 Elements that have identical tabIndex values should be navigated
186 in the order they appear in the character stream
187 Elements that are disabled or with a negative tabIndex
188 do not participate in the tabbing order.
189
190 */
191 public java.lang.Integer getTabIndex() {
192 if (tabIndex != null) {
193 return tabIndex;
194 }
195 ValueExpression ve = getValueExpression("tabIndex");
196 if (ve != null) {
197 try {
198 Number number = (Number) ve.getValue(getFacesContext().getELContext());
199 if (number != null) {
200 return number.intValue();
201 }
202 } catch (ELException e) {
203 throw new FacesException(e);
204 }
205 }
206 return null;
207 }
208
209 public void setTabIndex(java.lang.Integer tabIndex) {
210 this.tabIndex = tabIndex;
211 }
212
213 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
214 if (minimumHeight != null) {
215 return minimumHeight;
216 }
217 ValueExpression ve = getValueExpression("minimumHeight");
218 if (ve != null) {
219 try {
220 Object object = ve.getValue(getFacesContext().getELContext());
221 return Measure.valueOf(object);
222 } catch (ELException e) {
223 throw new FacesException(e);
224 }
225 }
226 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
227 }
228
229 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
230 this.minimumHeight = minimumHeight;
231 }
232
233 /**
234 Text value to display as tooltip.
235
236 */
237 public java.lang.String getTip() {
238 if (tip != null) {
239 return tip;
240 }
241 ValueExpression ve = getValueExpression("tip");
242 if (ve != null) {
243 try {
244 return (java.lang.String) ve.getValue(getFacesContext().getELContext());
245 } catch (ELException e) {
246 throw new FacesException(e);
247 }
248 }
249 return null;
250 }
251
252 public void setTip(java.lang.String tip) {
253 this.tip = tip;
254 }
255
256 /**
257 This value will usually be set by the layout manager.
258
259 */
260 public org.apache.myfaces.tobago.layout.Measure getHeight() {
261 if (height != null) {
262 return height;
263 }
264 ValueExpression ve = getValueExpression("height");
265 if (ve != null) {
266 try {
267 Object object = ve.getValue(getFacesContext().getELContext());
268 return Measure.valueOf(object);
269 } catch (ELException e) {
270 throw new FacesException(e);
271 }
272 }
273 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
274 }
275
276 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
277 this.height = height;
278 }
279
280 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
281 if (minimumWidth != null) {
282 return minimumWidth;
283 }
284 ValueExpression ve = getValueExpression("minimumWidth");
285 if (ve != null) {
286 try {
287 Object object = ve.getValue(getFacesContext().getELContext());
288 return Measure.valueOf(object);
289 } catch (ELException e) {
290 throw new FacesException(e);
291 }
292 }
293 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
294 }
295
296 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
297 this.minimumWidth = minimumWidth;
298 }
299
300 public java.lang.Integer getRowSpan() {
301 if (rowSpan != null) {
302 return rowSpan;
303 }
304 ValueExpression ve = getValueExpression("rowSpan");
305 if (ve != null) {
306 try {
307 Number number = (Number) ve.getValue(getFacesContext().getELContext());
308 if (number != null) {
309 return number.intValue();
310 }
311 } catch (ELException e) {
312 throw new FacesException(e);
313 }
314 }
315 return 1;
316 }
317
318 public void setRowSpan(java.lang.Integer rowSpan) {
319 this.rowSpan = rowSpan;
320 }
321
322 /**
323 Flag indicating this component should receive the focus.
324 <br />Default: <code>false</code>
325 */
326 public boolean isFocus() {
327 if (focus != null) {
328 return focus;
329 }
330 ValueExpression ve = getValueExpression("focus");
331 if (ve != null) {
332 try {
333 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
334 if (bool != null) {
335 return bool;
336 }
337 } catch (ELException e) {
338 throw new FacesException(e);
339 }
340 }
341 return false;
342 }
343
344 public void setFocus(boolean focus) {
345 this.focus = focus;
346 }
347
348 /**
349 This value will usually be set by the layout manager.
350
351 */
352 public org.apache.myfaces.tobago.layout.Measure getLeft() {
353 if (left != null) {
354 return left;
355 }
356 ValueExpression ve = getValueExpression("left");
357 if (ve != null) {
358 try {
359 Object object = ve.getValue(getFacesContext().getELContext());
360 return Measure.valueOf(object);
361 } catch (ELException e) {
362 throw new FacesException(e);
363 }
364 }
365 return null;
366 }
367
368 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
369 this.left = left;
370 }
371
372 public java.lang.Integer getColumnSpan() {
373 if (columnSpan != null) {
374 return columnSpan;
375 }
376 ValueExpression ve = getValueExpression("columnSpan");
377 if (ve != null) {
378 try {
379 Number number = (Number) ve.getValue(getFacesContext().getELContext());
380 if (number != null) {
381 return number.intValue();
382 }
383 } catch (ELException e) {
384 throw new FacesException(e);
385 }
386 }
387 return 1;
388 }
389
390 public void setColumnSpan(java.lang.Integer columnSpan) {
391 this.columnSpan = columnSpan;
392 }
393
394 /**
395 Flag indicating that a value is required.
396 If the value is an empty string a
397 ValidationError occurs and a Error Message is rendered.
398 <br />Default: <code>false</code>
399 */
400 public boolean isRequired() {
401 if (required != null) {
402 return required;
403 }
404 ValueExpression ve = getValueExpression("required");
405 if (ve != null) {
406 try {
407 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
408 if (bool != null) {
409 return bool;
410 }
411 } catch (ELException e) {
412 throw new FacesException(e);
413 }
414 }
415 return false;
416 }
417
418 public void setRequired(boolean required) {
419 this.required = required;
420 }
421
422 /**
423 This value will usually be set by the layout manager.
424
425 */
426 public org.apache.myfaces.tobago.layout.Measure getTop() {
427 if (top != null) {
428 return top;
429 }
430 ValueExpression ve = getValueExpression("top");
431 if (ve != null) {
432 try {
433 Object object = ve.getValue(getFacesContext().getELContext());
434 return Measure.valueOf(object);
435 } catch (ELException e) {
436 throw new FacesException(e);
437 }
438 }
439 return null;
440 }
441
442 public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
443 this.top = top;
444 }
445
446 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
447 if (maximumHeight != null) {
448 return maximumHeight;
449 }
450 ValueExpression ve = getValueExpression("maximumHeight");
451 if (ve != null) {
452 try {
453 Object object = ve.getValue(getFacesContext().getELContext());
454 return Measure.valueOf(object);
455 } catch (ELException e) {
456 throw new FacesException(e);
457 }
458 }
459 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
460 }
461
462 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
463 this.maximumHeight = maximumHeight;
464 }
465
466 /**
467 This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
468
469 */
470 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
471 if (currentWidth != null) {
472 return currentWidth;
473 }
474 ValueExpression ve = getValueExpression("currentWidth");
475 if (ve != null) {
476 try {
477 Object object = ve.getValue(getFacesContext().getELContext());
478 return Measure.valueOf(object);
479 } catch (ELException e) {
480 throw new FacesException(e);
481 }
482 }
483 return getWidth();
484 }
485
486 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
487 this.currentWidth = currentWidth;
488 }
489
490 public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
491 if (marginTop != null) {
492 return marginTop;
493 }
494 ValueExpression ve = getValueExpression("marginTop");
495 if (ve != null) {
496 try {
497 Object object = ve.getValue(getFacesContext().getELContext());
498 return Measure.valueOf(object);
499 } catch (ELException e) {
500 throw new FacesException(e);
501 }
502 }
503 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
504 }
505
506 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
507 this.marginTop = marginTop;
508 }
509
510 /**
511 This value will usually be set by the layout manager.
512
513 */
514 public org.apache.myfaces.tobago.layout.Measure getWidth() {
515 if (width != null) {
516 return width;
517 }
518 ValueExpression ve = getValueExpression("width");
519 if (ve != null) {
520 try {
521 Object object = ve.getValue(getFacesContext().getELContext());
522 return Measure.valueOf(object);
523 } catch (ELException e) {
524 throw new FacesException(e);
525 }
526 }
527 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
528 }
529
530 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
531 this.width = width;
532 }
533
534 public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
535 if (marginRight != null) {
536 return marginRight;
537 }
538 ValueExpression ve = getValueExpression("marginRight");
539 if (ve != null) {
540 try {
541 Object object = ve.getValue(getFacesContext().getELContext());
542 return Measure.valueOf(object);
543 } catch (ELException e) {
544 throw new FacesException(e);
545 }
546 }
547 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
548 }
549
550 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
551 this.marginRight = marginRight;
552 }
553
554 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
555 if (preferredHeight != null) {
556 return preferredHeight;
557 }
558 ValueExpression ve = getValueExpression("preferredHeight");
559 if (ve != null) {
560 try {
561 Object object = ve.getValue(getFacesContext().getELContext());
562 return Measure.valueOf(object);
563 } catch (ELException e) {
564 throw new FacesException(e);
565 }
566 }
567 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
568 }
569
570 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
571 this.preferredHeight = preferredHeight;
572 }
573
574 /**
575 This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
576
577 */
578 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
579 if (currentHeight != null) {
580 return currentHeight;
581 }
582 ValueExpression ve = getValueExpression("currentHeight");
583 if (ve != null) {
584 try {
585 Object object = ve.getValue(getFacesContext().getELContext());
586 return Measure.valueOf(object);
587 } catch (ELException e) {
588 throw new FacesException(e);
589 }
590 }
591 return getHeight();
592 }
593
594 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
595 this.currentHeight = currentHeight;
596 }
597
598 /**
599 Text value to display as label.
600 If text contains an underscore the next character is used as accesskey.
601
602 */
603 public java.lang.String getLabel() {
604 if (label != null) {
605 return label;
606 }
607 ValueExpression ve = getValueExpression("label");
608 if (ve != null) {
609 try {
610 return (java.lang.String) ve.getValue(getFacesContext().getELContext());
611 } catch (ELException e) {
612 throw new FacesException(e);
613 }
614 }
615 return null;
616 }
617
618 public void setLabel(java.lang.String label) {
619 this.label = label;
620 }
621
622 /**
623 This attribute is for internal use only.
624
625 */
626 public org.apache.myfaces.tobago.layout.Display getDisplay() {
627 if (display != null) {
628 return display;
629 }
630 ValueExpression ve = getValueExpression("display");
631 if (ve != null) {
632 try {
633 return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
634 } catch (ELException e) {
635 throw new FacesException(e);
636 }
637 }
638 return null;
639 }
640
641 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
642 this.display = display;
643 }
644
645 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
646 if (maximumWidth != null) {
647 return maximumWidth;
648 }
649 ValueExpression ve = getValueExpression("maximumWidth");
650 if (ve != null) {
651 try {
652 Object object = ve.getValue(getFacesContext().getELContext());
653 return Measure.valueOf(object);
654 } catch (ELException e) {
655 throw new FacesException(e);
656 }
657 }
658 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
659 }
660
661 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
662 this.maximumWidth = maximumWidth;
663 }
664
665 /**
666 Clientside script function to add to this component's onchange handler.
667
668 */
669 public java.lang.String getOnchange() {
670 if (onchange != null) {
671 return onchange;
672 }
673 ValueExpression ve = getValueExpression("onchange");
674 if (ve != null) {
675 try {
676 return (java.lang.String) ve.getValue(getFacesContext().getELContext());
677 } catch (ELException e) {
678 throw new FacesException(e);
679 }
680 }
681 return null;
682 }
683
684 public void setOnchange(java.lang.String onchange) {
685 this.onchange = onchange;
686 }
687
688 /**
689 The row count for this component.
690
691 */
692 public java.lang.String getRows() {
693 if (rows != null) {
694 return rows;
695 }
696 ValueExpression ve = getValueExpression("rows");
697 if (ve != null) {
698 try {
699 return (java.lang.String) ve.getValue(getFacesContext().getELContext());
700 } catch (ELException e) {
701 throw new FacesException(e);
702 }
703 }
704 return null;
705 }
706
707 public void setRows(java.lang.String rows) {
708 this.rows = rows;
709 }
710
711 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
712 if (preferredWidth != null) {
713 return preferredWidth;
714 }
715 ValueExpression ve = getValueExpression("preferredWidth");
716 if (ve != null) {
717 try {
718 Object object = ve.getValue(getFacesContext().getELContext());
719 return Measure.valueOf(object);
720 } catch (ELException e) {
721 throw new FacesException(e);
722 }
723 }
724 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
725 }
726
727 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
728 this.preferredWidth = preferredWidth;
729 }
730
731 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
732 if (marginBottom != null) {
733 return marginBottom;
734 }
735 ValueExpression ve = getValueExpression("marginBottom");
736 if (ve != null) {
737 try {
738 Object object = ve.getValue(getFacesContext().getELContext());
739 return Measure.valueOf(object);
740 } catch (ELException e) {
741 throw new FacesException(e);
742 }
743 }
744 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
745 }
746
747 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
748 this.marginBottom = marginBottom;
749 }
750
751 /**
752 This attribute is for internal use only.
753
754 */
755 public java.lang.Integer getVerticalIndex() {
756 if (verticalIndex != null) {
757 return verticalIndex;
758 }
759 ValueExpression ve = getValueExpression("verticalIndex");
760 if (ve != null) {
761 try {
762 Number number = (Number) ve.getValue(getFacesContext().getELContext());
763 if (number != null) {
764 return number.intValue();
765 }
766 } catch (ELException e) {
767 throw new FacesException(e);
768 }
769 }
770 return null;
771 }
772
773 public void setVerticalIndex(java.lang.Integer verticalIndex) {
774 this.verticalIndex = verticalIndex;
775 }
776
777 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
778 if (currentMarkup != null) {
779 return currentMarkup;
780 }
781 return null;
782 }
783
784 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
785 this.currentMarkup = currentMarkup;
786 }
787
788 /**
789 This attribute is for internal use only.
790
791 */
792 public java.lang.Integer getHorizontalIndex() {
793 if (horizontalIndex != null) {
794 return horizontalIndex;
795 }
796 ValueExpression ve = getValueExpression("horizontalIndex");
797 if (ve != null) {
798 try {
799 Number number = (Number) ve.getValue(getFacesContext().getELContext());
800 if (number != null) {
801 return number.intValue();
802 }
803 } catch (ELException e) {
804 throw new FacesException(e);
805 }
806 }
807 return null;
808 }
809
810 public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
811 this.horizontalIndex = horizontalIndex;
812 }
813
814 /**
815 Flag indicating that this component will prohibit changes by the user.
816 <br />Default: <code>false</code>
817 */
818 public boolean isReadonly() {
819 if (readonly != null) {
820 return readonly;
821 }
822 ValueExpression ve = getValueExpression("readonly");
823 if (ve != null) {
824 try {
825 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
826 if (bool != null) {
827 return bool;
828 }
829 } catch (ELException e) {
830 throw new FacesException(e);
831 }
832 }
833 return false;
834 }
835
836 public void setReadonly(boolean readonly) {
837 this.readonly = readonly;
838 }
839
840 /**
841 Flag indicating that this element is disabled.
842 <br />Default: <code>false</code>
843 */
844 public boolean isDisabled() {
845 if (disabled != null) {
846 return disabled;
847 }
848 ValueExpression ve = getValueExpression("disabled");
849 if (ve != null) {
850 try {
851 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
852 if (bool != null) {
853 return bool;
854 }
855 } catch (ELException e) {
856 throw new FacesException(e);
857 }
858 }
859 return false;
860 }
861
862 public void setDisabled(boolean disabled) {
863 this.disabled = disabled;
864 }
865
866 public void restoreState(FacesContext context, Object componentState) {
867 Object[] values = (Object[]) componentState;
868 super.restoreState(context, values[0]);
869 markup = (org.apache.myfaces.tobago.context.Markup) values[1];
870 accessKey = (java.lang.Character) values[2];
871 marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[3];
872 labelWithAccessKey = (java.lang.String) values[4];
873 tabIndex = (java.lang.Integer) values[5];
874 minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[6];
875 tip = (java.lang.String) values[7];
876 height = (org.apache.myfaces.tobago.layout.Measure) values[8];
877 minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[9];
878 rowSpan = (java.lang.Integer) values[10];
879 focus = (java.lang.Boolean) values[11];
880 left = (org.apache.myfaces.tobago.layout.Measure) values[12];
881 columnSpan = (java.lang.Integer) values[13];
882 required = (java.lang.Boolean) values[14];
883 top = (org.apache.myfaces.tobago.layout.Measure) values[15];
884 maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[16];
885 currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[17];
886 marginTop = (org.apache.myfaces.tobago.layout.Measure) values[18];
887 width = (org.apache.myfaces.tobago.layout.Measure) values[19];
888 marginRight = (org.apache.myfaces.tobago.layout.Measure) values[20];
889 preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[21];
890 currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
891 label = (java.lang.String) values[23];
892 display = (org.apache.myfaces.tobago.layout.Display) values[24];
893 maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[25];
894 onchange = (java.lang.String) values[26];
895 rows = (java.lang.String) values[27];
896 preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[28];
897 marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[29];
898 verticalIndex = (java.lang.Integer) values[30];
899 horizontalIndex = (java.lang.Integer) values[31];
900 readonly = (java.lang.Boolean) values[32];
901 disabled = (java.lang.Boolean) values[33];
902 }
903
904 public Object saveState(FacesContext context) {
905 Object[] values = new Object[34];
906 values[0] = super.saveState(context);
907 values[1] = markup;
908 values[2] = accessKey;
909 values[3] = marginLeft;
910 values[4] = labelWithAccessKey;
911 values[5] = tabIndex;
912 values[6] = minimumHeight;
913 values[7] = tip;
914 values[8] = height;
915 values[9] = minimumWidth;
916 values[10] = rowSpan;
917 values[11] = focus;
918 values[12] = left;
919 values[13] = columnSpan;
920 values[14] = required;
921 values[15] = top;
922 values[16] = maximumHeight;
923 values[17] = currentWidth;
924 values[18] = marginTop;
925 values[19] = width;
926 values[20] = marginRight;
927 values[21] = preferredHeight;
928 values[22] = currentHeight;
929 values[23] = label;
930 values[24] = display;
931 values[25] = maximumWidth;
932 values[26] = onchange;
933 values[27] = rows;
934 values[28] = preferredWidth;
935 values[29] = marginBottom;
936 values[30] = verticalIndex;
937 values[31] = horizontalIndex;
938 values[32] = readonly;
939 values[33] = disabled;
940 currentMarkup = null;
941 return values;
942 }
943
944
945 }