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