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