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