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 javax.faces.el.MethodBinding; 024 import org.apache.myfaces.tobago.context.Markup; 025 import org.apache.myfaces.tobago.event.SortActionSource; 026 import org.apache.myfaces.tobago.event.SortActionSource2; 027 import org.apache.myfaces.tobago.internal.component.AbstractUISheet; 028 import org.apache.myfaces.tobago.layout.Display; 029 import org.apache.myfaces.tobago.layout.Measure; 030 import org.apache.commons.lang.ArrayUtils; 031 import org.apache.commons.lang.StringUtils; 032 import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression; 033 import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding; 034 import org.apache.myfaces.tobago.internal.util.Deprecation; 035 import org.apache.myfaces.tobago.renderkit.MarginValues; 036 import org.apache.myfaces.tobago.renderkit.SpacingValues; 037 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer; 038 import javax.el.ELException; 039 import javax.faces.FacesException; 040 import java.util.ArrayList; 041 import java.util.List; 042 import javax.el.MethodExpression; 043 import javax.el.ValueExpression; 044 045 /** 046 Render a sheet element. 047 * UIComponent class, generated from template {@code component1.2.stg} with class 048 * {@link org.apache.myfaces.tobago.internal.taglib.component.SheetTagDeclaration}. 049 */ 050 public class UISheet 051 extends AbstractUISheet implements SortActionSource, SortActionSource2, SupportsMarkup { 052 053 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Sheet"; 054 055 private org.apache.myfaces.tobago.context.Markup markup; 056 private org.apache.myfaces.tobago.layout.Measure marginLeft; 057 private java.lang.String columns; 058 private org.apache.myfaces.tobago.layout.Measure borderLeft; 059 private org.apache.myfaces.tobago.layout.Measure height; 060 private org.apache.myfaces.tobago.layout.Measure minimumWidth; 061 private java.lang.String showDirectLinks; 062 private java.lang.String showPageRange; 063 private java.lang.Boolean overflowX; 064 private java.lang.Boolean overflowY; 065 private java.lang.String forceVerticalScrollbar; 066 private javax.faces.el.MethodBinding stateChangeListener; 067 private org.apache.myfaces.tobago.layout.Measure borderRight; 068 private org.apache.myfaces.tobago.layout.Measure maximumHeight; 069 private org.apache.myfaces.tobago.layout.Measure currentWidth; 070 private org.apache.myfaces.tobago.layout.Measure paddingTop; 071 private org.apache.myfaces.tobago.layout.Measure marginTop; 072 private org.apache.myfaces.tobago.layout.Measure width; 073 private org.apache.myfaces.tobago.layout.Measure currentHeight; 074 private org.apache.myfaces.tobago.layout.Measure borderBottom; 075 private org.apache.myfaces.tobago.layout.Display display; 076 private org.apache.myfaces.tobago.layout.Measure paddingLeft; 077 private org.apache.myfaces.tobago.layout.Measure preferredWidth; 078 private org.apache.myfaces.tobago.layout.Measure borderTop; 079 private java.lang.Integer verticalIndex; 080 private java.lang.Boolean showPagingAlways; 081 private org.apache.myfaces.tobago.context.Markup currentMarkup; 082 private java.lang.String[] renderedPartially; 083 private org.apache.myfaces.tobago.layout.Measure minimumHeight; 084 private java.lang.Integer rowSpan; 085 private org.apache.myfaces.tobago.layout.Measure left; 086 private java.lang.Integer columnSpan; 087 private org.apache.myfaces.tobago.layout.Measure paddingBottom; 088 private org.apache.myfaces.tobago.layout.Measure top; 089 private java.lang.String showRowRange; 090 private org.apache.myfaces.tobago.layout.Measure marginRight; 091 private org.apache.myfaces.tobago.layout.Measure preferredHeight; 092 private org.apache.myfaces.tobago.layout.Measure maximumWidth; 093 private org.apache.myfaces.tobago.layout.Measure paddingRight; 094 private org.apache.myfaces.tobago.layout.Measure marginBottom; 095 private java.lang.String selectable; 096 private java.lang.Boolean showHeader; 097 private java.lang.Integer directLinkCount; 098 099 private javax.el.MethodExpression sortActionListenerExpression; 100 private java.lang.Integer horizontalIndex; 101 102 103 public org.apache.myfaces.tobago.context.Markup getMarkup() { 104 if (markup != null) { 105 return markup; 106 } 107 ValueExpression ve = getValueExpression("markup"); 108 if (ve != null) { 109 try { 110 Object object = ve.getValue(getFacesContext().getELContext()); 111 return Markup.valueOf(object); 112 } catch (ELException e) { 113 throw new FacesException(e); 114 } 115 } 116 return null; 117 } 118 119 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) { 120 this.markup = markup; 121 } 122 123 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() { 124 if (marginLeft != null) { 125 return marginLeft; 126 } 127 ValueExpression ve = getValueExpression("marginLeft"); 128 if (ve != null) { 129 try { 130 Object object = ve.getValue(getFacesContext().getELContext()); 131 return Measure.valueOf(object); 132 } catch (ELException e) { 133 throw new FacesException(e); 134 } 135 } 136 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this); 137 } 138 139 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) { 140 this.marginLeft = marginLeft; 141 } 142 143 /** 144 LayoutConstraints for column layout. 145 Semicolon separated list of layout tokens ('<x>*', '<x>px' or '<x>%'). 146 147 */ 148 public java.lang.String getColumns() { 149 if (columns != null) { 150 return columns; 151 } 152 ValueExpression ve = getValueExpression("columns"); 153 if (ve != null) { 154 try { 155 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 156 } catch (ELException e) { 157 throw new FacesException(e); 158 } 159 } 160 return null; 161 } 162 163 public void setColumns(java.lang.String columns) { 164 this.columns = columns; 165 } 166 167 /** 168 This attribute is for internal use only. 169 170 */ 171 public org.apache.myfaces.tobago.layout.Measure getBorderLeft() { 172 if (borderLeft != null) { 173 return borderLeft; 174 } 175 ValueExpression ve = getValueExpression("borderLeft"); 176 if (ve != null) { 177 try { 178 Object object = ve.getValue(getFacesContext().getELContext()); 179 return Measure.valueOf(object); 180 } catch (ELException e) { 181 throw new FacesException(e); 182 } 183 } 184 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 185 getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this); 186 } 187 188 public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) { 189 this.borderLeft = borderLeft; 190 } 191 192 /** 193 This value will usually be set by the layout manager. 194 195 */ 196 public org.apache.myfaces.tobago.layout.Measure getHeight() { 197 if (height != null) { 198 return height; 199 } 200 ValueExpression ve = getValueExpression("height"); 201 if (ve != null) { 202 try { 203 Object object = ve.getValue(getFacesContext().getELContext()); 204 return Measure.valueOf(object); 205 } catch (ELException e) { 206 throw new FacesException(e); 207 } 208 } 209 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this); 210 } 211 212 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) { 213 this.height = height; 214 } 215 216 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() { 217 if (minimumWidth != null) { 218 return minimumWidth; 219 } 220 ValueExpression ve = getValueExpression("minimumWidth"); 221 if (ve != null) { 222 try { 223 Object object = ve.getValue(getFacesContext().getELContext()); 224 return Measure.valueOf(object); 225 } catch (ELException e) { 226 throw new FacesException(e); 227 } 228 } 229 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this); 230 } 231 232 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) { 233 this.minimumWidth = minimumWidth; 234 } 235 236 /** 237 Flag indicating whether or not a range of direct paging links should be 238 rendered in the sheet's footer. 239 <br />Default: <code>center</code><br />Allowed Values: <code>left,center,right,none</code> 240 */ 241 public java.lang.String getShowDirectLinks() { 242 if (showDirectLinks != null) { 243 return showDirectLinks; 244 } 245 ValueExpression ve = getValueExpression("showDirectLinks"); 246 if (ve != null) { 247 try { 248 java.lang.String showDirectLinks = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 249 if (showDirectLinks != null) { 250 return showDirectLinks; 251 } 252 } catch (ELException e) { 253 throw new FacesException(e); 254 } 255 } 256 return "center"; 257 } 258 259 public void setShowDirectLinks(java.lang.String showDirectLinks) { 260 this.showDirectLinks = showDirectLinks; 261 } 262 263 /** 264 Flag indicating whether and where the range pages should 265 rendered in the sheet's footer. Rendering this range also offers the 266 capability to enter the index displayed page directly. 267 <br />Default: <code>right</code><br />Allowed Values: <code>left,center,right,none</code> 268 */ 269 public java.lang.String getShowPageRange() { 270 if (showPageRange != null) { 271 return showPageRange; 272 } 273 ValueExpression ve = getValueExpression("showPageRange"); 274 if (ve != null) { 275 try { 276 java.lang.String showPageRange = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 277 if (showPageRange != null) { 278 return showPageRange; 279 } 280 } catch (ELException e) { 281 throw new FacesException(e); 282 } 283 } 284 return "right"; 285 } 286 287 public void setShowPageRange(java.lang.String showPageRange) { 288 this.showPageRange = showPageRange; 289 } 290 291 /** 292 This attribute is for internal use only. 293 294 */ 295 public boolean isOverflowX() { 296 if (overflowX != null) { 297 return overflowX; 298 } 299 ValueExpression ve = getValueExpression("overflowX"); 300 if (ve != null) { 301 try { 302 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 303 if (bool != null) { 304 return bool; 305 } 306 } catch (ELException e) { 307 throw new FacesException(e); 308 } 309 } 310 return false; 311 } 312 313 public void setOverflowX(boolean overflowX) { 314 this.overflowX = overflowX; 315 } 316 317 /** 318 This attribute is for internal use only. 319 320 */ 321 public boolean isOverflowY() { 322 if (overflowY != null) { 323 return overflowY; 324 } 325 ValueExpression ve = getValueExpression("overflowY"); 326 if (ve != null) { 327 try { 328 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 329 if (bool != null) { 330 return bool; 331 } 332 } catch (ELException e) { 333 throw new FacesException(e); 334 } 335 } 336 return false; 337 } 338 339 public void setOverflowY(boolean overflowY) { 340 this.overflowY = overflowY; 341 } 342 343 /** 344 Flag indicating whether or not this sheet should reserve space for 345 vertical toolbar when calculating column width's.<br /> 346 Possible values are: <pre> 347 'auto' : sheet try to estimate the need of scrollbar. 348 'true' : space for scroolbar is reserved. 349 'false' : no space is reserved. 350 </pre> 351 <br />Default: <code>auto</code><br />Allowed Values: <code>auto,true,false</code> 352 */ 353 public java.lang.String getForceVerticalScrollbar() { 354 if (forceVerticalScrollbar != null) { 355 return forceVerticalScrollbar; 356 } 357 ValueExpression ve = getValueExpression("forceVerticalScrollbar"); 358 if (ve != null) { 359 try { 360 java.lang.String forceVerticalScrollbar = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 361 if (forceVerticalScrollbar != null) { 362 return forceVerticalScrollbar; 363 } 364 } catch (ELException e) { 365 throw new FacesException(e); 366 } 367 } 368 return "auto"; 369 } 370 371 public void setForceVerticalScrollbar(java.lang.String forceVerticalScrollbar) { 372 this.forceVerticalScrollbar = forceVerticalScrollbar; 373 } 374 375 public javax.faces.el.MethodBinding getStateChangeListener() { 376 return stateChangeListener; 377 } 378 379 public void setStateChangeListener(javax.faces.el.MethodBinding stateChangeListener) { 380 this.stateChangeListener = stateChangeListener; 381 } 382 383 /** 384 This attribute is for internal use only. 385 386 */ 387 public org.apache.myfaces.tobago.layout.Measure getBorderRight() { 388 if (borderRight != null) { 389 return borderRight; 390 } 391 ValueExpression ve = getValueExpression("borderRight"); 392 if (ve != null) { 393 try { 394 Object object = ve.getValue(getFacesContext().getELContext()); 395 return Measure.valueOf(object); 396 } catch (ELException e) { 397 throw new FacesException(e); 398 } 399 } 400 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 401 getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this); 402 } 403 404 public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) { 405 this.borderRight = borderRight; 406 } 407 408 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() { 409 if (maximumHeight != null) { 410 return maximumHeight; 411 } 412 ValueExpression ve = getValueExpression("maximumHeight"); 413 if (ve != null) { 414 try { 415 Object object = ve.getValue(getFacesContext().getELContext()); 416 return Measure.valueOf(object); 417 } catch (ELException e) { 418 throw new FacesException(e); 419 } 420 } 421 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this); 422 } 423 424 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) { 425 this.maximumHeight = maximumHeight; 426 } 427 428 /** 429 This value will usually be set by the layout manager. It holds the current width computed by the layout manager. 430 431 */ 432 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() { 433 if (currentWidth != null) { 434 return currentWidth; 435 } 436 ValueExpression ve = getValueExpression("currentWidth"); 437 if (ve != null) { 438 try { 439 Object object = ve.getValue(getFacesContext().getELContext()); 440 return Measure.valueOf(object); 441 } catch (ELException e) { 442 throw new FacesException(e); 443 } 444 } 445 return getWidth(); 446 } 447 448 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) { 449 this.currentWidth = currentWidth; 450 } 451 452 /** 453 This attribute is for internal use only. 454 455 */ 456 public org.apache.myfaces.tobago.layout.Measure getPaddingTop() { 457 if (paddingTop != null) { 458 return paddingTop; 459 } 460 ValueExpression ve = getValueExpression("paddingTop"); 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 ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 470 getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this); 471 } 472 473 public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) { 474 this.paddingTop = paddingTop; 475 } 476 477 public org.apache.myfaces.tobago.layout.Measure getMarginTop() { 478 if (marginTop != null) { 479 return marginTop; 480 } 481 ValueExpression ve = getValueExpression("marginTop"); 482 if (ve != null) { 483 try { 484 Object object = ve.getValue(getFacesContext().getELContext()); 485 return Measure.valueOf(object); 486 } catch (ELException e) { 487 throw new FacesException(e); 488 } 489 } 490 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this); 491 } 492 493 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) { 494 this.marginTop = marginTop; 495 } 496 497 /** 498 This value will usually be set by the layout manager. 499 500 */ 501 public org.apache.myfaces.tobago.layout.Measure getWidth() { 502 if (width != null) { 503 return width; 504 } 505 ValueExpression ve = getValueExpression("width"); 506 if (ve != null) { 507 try { 508 Object object = ve.getValue(getFacesContext().getELContext()); 509 return Measure.valueOf(object); 510 } catch (ELException e) { 511 throw new FacesException(e); 512 } 513 } 514 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this); 515 } 516 517 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) { 518 this.width = width; 519 } 520 521 /** 522 This value will usually be set by the layout manager. It holds the current height computed by the layout manager. 523 524 */ 525 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() { 526 if (currentHeight != null) { 527 return currentHeight; 528 } 529 ValueExpression ve = getValueExpression("currentHeight"); 530 if (ve != null) { 531 try { 532 Object object = ve.getValue(getFacesContext().getELContext()); 533 return Measure.valueOf(object); 534 } catch (ELException e) { 535 throw new FacesException(e); 536 } 537 } 538 return getHeight(); 539 } 540 541 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) { 542 this.currentHeight = currentHeight; 543 } 544 545 /** 546 This attribute is for internal use only. 547 548 */ 549 public org.apache.myfaces.tobago.layout.Measure getBorderBottom() { 550 if (borderBottom != null) { 551 return borderBottom; 552 } 553 ValueExpression ve = getValueExpression("borderBottom"); 554 if (ve != null) { 555 try { 556 Object object = ve.getValue(getFacesContext().getELContext()); 557 return Measure.valueOf(object); 558 } catch (ELException e) { 559 throw new FacesException(e); 560 } 561 } 562 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 563 getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this); 564 } 565 566 public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) { 567 this.borderBottom = borderBottom; 568 } 569 570 /** 571 This attribute is for internal use only. 572 573 */ 574 public org.apache.myfaces.tobago.layout.Display getDisplay() { 575 if (display != null) { 576 return display; 577 } 578 ValueExpression ve = getValueExpression("display"); 579 if (ve != null) { 580 try { 581 return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext()); 582 } catch (ELException e) { 583 throw new FacesException(e); 584 } 585 } 586 return null; 587 } 588 589 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) { 590 this.display = display; 591 } 592 593 /** 594 This attribute is for internal use only. 595 596 */ 597 public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() { 598 if (paddingLeft != null) { 599 return paddingLeft; 600 } 601 ValueExpression ve = getValueExpression("paddingLeft"); 602 if (ve != null) { 603 try { 604 Object object = ve.getValue(getFacesContext().getELContext()); 605 return Measure.valueOf(object); 606 } catch (ELException e) { 607 throw new FacesException(e); 608 } 609 } 610 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 611 getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this); 612 } 613 614 public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) { 615 this.paddingLeft = paddingLeft; 616 } 617 618 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() { 619 if (preferredWidth != null) { 620 return preferredWidth; 621 } 622 ValueExpression ve = getValueExpression("preferredWidth"); 623 if (ve != null) { 624 try { 625 Object object = ve.getValue(getFacesContext().getELContext()); 626 return Measure.valueOf(object); 627 } catch (ELException e) { 628 throw new FacesException(e); 629 } 630 } 631 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this); 632 } 633 634 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) { 635 this.preferredWidth = preferredWidth; 636 } 637 638 /** 639 This attribute is for internal use only. 640 641 */ 642 public org.apache.myfaces.tobago.layout.Measure getBorderTop() { 643 if (borderTop != null) { 644 return borderTop; 645 } 646 ValueExpression ve = getValueExpression("borderTop"); 647 if (ve != null) { 648 try { 649 Object object = ve.getValue(getFacesContext().getELContext()); 650 return Measure.valueOf(object); 651 } catch (ELException e) { 652 throw new FacesException(e); 653 } 654 } 655 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 656 getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this); 657 } 658 659 public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) { 660 this.borderTop = borderTop; 661 } 662 663 /** 664 This attribute is for internal use only. 665 666 */ 667 public java.lang.Integer getVerticalIndex() { 668 if (verticalIndex != null) { 669 return verticalIndex; 670 } 671 ValueExpression ve = getValueExpression("verticalIndex"); 672 if (ve != null) { 673 try { 674 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 675 if (number != null) { 676 return number.intValue(); 677 } 678 } catch (ELException e) { 679 throw new FacesException(e); 680 } 681 } 682 return null; 683 } 684 685 public void setVerticalIndex(java.lang.Integer verticalIndex) { 686 this.verticalIndex = verticalIndex; 687 } 688 689 /** 690 Flag indicating whether or not the paging panel should be display, if it is not needed for paging.<br /> 691 <ul> 692 <li>showPagingAlways="false" which is the default means, that the paging footer should be displayed, 693 only when it is needed.</li> 694 <ul> 695 <li>When the rows="0" paging is not needed, so the footer will not be rendered,</li> 696 <li>when rows="N", N > 0 and the size of the data value is <= N paging is not needed 697 and the footer will not be rendered,</li> 698 <li>in any other case the paging footer will be displayed.</li> 699 </ul> 700 <li>showPagingAlways="true" means, that the paging footer should be displayed in any case.</li> 701 </ul> 702 <br />Default: <code>false</code> 703 */ 704 public boolean isShowPagingAlways() { 705 if (showPagingAlways != null) { 706 return showPagingAlways; 707 } 708 ValueExpression ve = getValueExpression("showPagingAlways"); 709 if (ve != null) { 710 try { 711 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 712 if (bool != null) { 713 return bool; 714 } 715 } catch (ELException e) { 716 throw new FacesException(e); 717 } 718 } 719 return false; 720 } 721 722 public void setShowPagingAlways(boolean showPagingAlways) { 723 this.showPagingAlways = showPagingAlways; 724 } 725 726 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() { 727 if (currentMarkup != null) { 728 return currentMarkup; 729 } 730 return null; 731 } 732 733 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) { 734 this.currentMarkup = currentMarkup; 735 } 736 737 /** 738 Indicate the partially rendered Components in a case of a submit. 739 740 */ 741 public String[] getRenderedPartially() { 742 if (renderedPartially != null) { 743 return renderedPartially; 744 } 745 ValueExpression ve = getValueExpression("renderedPartially"); 746 if (ve != null) { 747 try { 748 Object strArray = ve.getValue(getFacesContext().getELContext()); 749 if (strArray instanceof String[]) { 750 return (String[]) strArray; 751 } else if (strArray instanceof String) { 752 String[] strings = StringUtils.split((String) strArray, ", "); 753 List<String> result = new ArrayList<String>(strings.length); 754 for (String string : strings) { 755 if (string.trim().length() != 0) { 756 result.add(string.trim()); 757 } 758 } 759 return result.toArray(new String[result.size()]); 760 } else if (strArray == null) { 761 return ArrayUtils.EMPTY_STRING_ARRAY; 762 } else { 763 return new String[]{strArray.toString()}; 764 } 765 } catch (ELException e) { 766 throw new FacesException(e); 767 } 768 } 769 return ArrayUtils.EMPTY_STRING_ARRAY; 770 } 771 772 public void setRenderedPartially(String[] renderedPartially) { 773 this.renderedPartially = renderedPartially; 774 } 775 776 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() { 777 if (minimumHeight != null) { 778 return minimumHeight; 779 } 780 ValueExpression ve = getValueExpression("minimumHeight"); 781 if (ve != null) { 782 try { 783 Object object = ve.getValue(getFacesContext().getELContext()); 784 return Measure.valueOf(object); 785 } catch (ELException e) { 786 throw new FacesException(e); 787 } 788 } 789 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this); 790 } 791 792 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) { 793 this.minimumHeight = minimumHeight; 794 } 795 796 public java.lang.Integer getRowSpan() { 797 if (rowSpan != null) { 798 return rowSpan; 799 } 800 ValueExpression ve = getValueExpression("rowSpan"); 801 if (ve != null) { 802 try { 803 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 804 if (number != null) { 805 return number.intValue(); 806 } 807 } catch (ELException e) { 808 throw new FacesException(e); 809 } 810 } 811 return 1; 812 } 813 814 public void setRowSpan(java.lang.Integer rowSpan) { 815 this.rowSpan = rowSpan; 816 } 817 818 /** 819 This value will usually be set by the layout manager. 820 821 */ 822 public org.apache.myfaces.tobago.layout.Measure getLeft() { 823 if (left != null) { 824 return left; 825 } 826 ValueExpression ve = getValueExpression("left"); 827 if (ve != null) { 828 try { 829 Object object = ve.getValue(getFacesContext().getELContext()); 830 return Measure.valueOf(object); 831 } catch (ELException e) { 832 throw new FacesException(e); 833 } 834 } 835 return null; 836 } 837 838 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) { 839 this.left = left; 840 } 841 842 public java.lang.Integer getColumnSpan() { 843 if (columnSpan != null) { 844 return columnSpan; 845 } 846 ValueExpression ve = getValueExpression("columnSpan"); 847 if (ve != null) { 848 try { 849 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 850 if (number != null) { 851 return number.intValue(); 852 } 853 } catch (ELException e) { 854 throw new FacesException(e); 855 } 856 } 857 return 1; 858 } 859 860 public void setColumnSpan(java.lang.Integer columnSpan) { 861 this.columnSpan = columnSpan; 862 } 863 864 /** 865 This attribute is for internal use only. 866 867 */ 868 public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() { 869 if (paddingBottom != null) { 870 return paddingBottom; 871 } 872 ValueExpression ve = getValueExpression("paddingBottom"); 873 if (ve != null) { 874 try { 875 Object object = ve.getValue(getFacesContext().getELContext()); 876 return Measure.valueOf(object); 877 } catch (ELException e) { 878 throw new FacesException(e); 879 } 880 } 881 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 882 getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this); 883 } 884 885 public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) { 886 this.paddingBottom = paddingBottom; 887 } 888 889 /** 890 This value will usually be set by the layout manager. 891 892 */ 893 public org.apache.myfaces.tobago.layout.Measure getTop() { 894 if (top != null) { 895 return top; 896 } 897 ValueExpression ve = getValueExpression("top"); 898 if (ve != null) { 899 try { 900 Object object = ve.getValue(getFacesContext().getELContext()); 901 return Measure.valueOf(object); 902 } catch (ELException e) { 903 throw new FacesException(e); 904 } 905 } 906 return null; 907 } 908 909 public void setTop(org.apache.myfaces.tobago.layout.Measure top) { 910 this.top = top; 911 } 912 913 /** 914 Flag indicating whether or not the range of displayed rows should 915 rendered in the sheet's footer. Rendering this range also offers the 916 capability to enter the index of the start row directly. 917 <br />Default: <code>left</code><br />Allowed Values: <code>left,center,right,none</code> 918 */ 919 public java.lang.String getShowRowRange() { 920 if (showRowRange != null) { 921 return showRowRange; 922 } 923 ValueExpression ve = getValueExpression("showRowRange"); 924 if (ve != null) { 925 try { 926 java.lang.String showRowRange = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 927 if (showRowRange != null) { 928 return showRowRange; 929 } 930 } catch (ELException e) { 931 throw new FacesException(e); 932 } 933 } 934 return "left"; 935 } 936 937 public void setShowRowRange(java.lang.String showRowRange) { 938 this.showRowRange = showRowRange; 939 } 940 941 public org.apache.myfaces.tobago.layout.Measure getMarginRight() { 942 if (marginRight != null) { 943 return marginRight; 944 } 945 ValueExpression ve = getValueExpression("marginRight"); 946 if (ve != null) { 947 try { 948 Object object = ve.getValue(getFacesContext().getELContext()); 949 return Measure.valueOf(object); 950 } catch (ELException e) { 951 throw new FacesException(e); 952 } 953 } 954 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this); 955 } 956 957 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) { 958 this.marginRight = marginRight; 959 } 960 961 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() { 962 if (preferredHeight != null) { 963 return preferredHeight; 964 } 965 ValueExpression ve = getValueExpression("preferredHeight"); 966 if (ve != null) { 967 try { 968 Object object = ve.getValue(getFacesContext().getELContext()); 969 return Measure.valueOf(object); 970 } catch (ELException e) { 971 throw new FacesException(e); 972 } 973 } 974 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this); 975 } 976 977 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) { 978 this.preferredHeight = preferredHeight; 979 } 980 981 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() { 982 if (maximumWidth != null) { 983 return maximumWidth; 984 } 985 ValueExpression ve = getValueExpression("maximumWidth"); 986 if (ve != null) { 987 try { 988 Object object = ve.getValue(getFacesContext().getELContext()); 989 return Measure.valueOf(object); 990 } catch (ELException e) { 991 throw new FacesException(e); 992 } 993 } 994 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this); 995 } 996 997 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) { 998 this.maximumWidth = maximumWidth; 999 } 1000 1001 /** 1002 This attribute is for internal use only. 1003 1004 */ 1005 public org.apache.myfaces.tobago.layout.Measure getPaddingRight() { 1006 if (paddingRight != null) { 1007 return paddingRight; 1008 } 1009 ValueExpression ve = getValueExpression("paddingRight"); 1010 if (ve != null) { 1011 try { 1012 Object object = ve.getValue(getFacesContext().getELContext()); 1013 return Measure.valueOf(object); 1014 } catch (ELException e) { 1015 throw new FacesException(e); 1016 } 1017 } 1018 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 1019 getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this); 1020 } 1021 1022 public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) { 1023 this.paddingRight = paddingRight; 1024 } 1025 1026 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() { 1027 if (marginBottom != null) { 1028 return marginBottom; 1029 } 1030 ValueExpression ve = getValueExpression("marginBottom"); 1031 if (ve != null) { 1032 try { 1033 Object object = ve.getValue(getFacesContext().getELContext()); 1034 return Measure.valueOf(object); 1035 } catch (ELException e) { 1036 throw new FacesException(e); 1037 } 1038 } 1039 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this); 1040 } 1041 1042 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) { 1043 this.marginBottom = marginBottom; 1044 } 1045 1046 /** 1047 Flag indicating whether or not the sheet should be selectable. 1048 <br />Default: <code>multi</code><br />Allowed Values: <code>none,single,singleOrNone,multi</code> 1049 */ 1050 public java.lang.String getSelectable() { 1051 if (selectable != null) { 1052 return selectable; 1053 } 1054 ValueExpression ve = getValueExpression("selectable"); 1055 if (ve != null) { 1056 try { 1057 java.lang.String selectable = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 1058 if (selectable != null) { 1059 return selectable; 1060 } 1061 } catch (ELException e) { 1062 throw new FacesException(e); 1063 } 1064 } 1065 return "multi"; 1066 } 1067 1068 public void setSelectable(java.lang.String selectable) { 1069 this.selectable = selectable; 1070 } 1071 1072 /** 1073 Flag indicating the header should be rendered. 1074 <br />Default: <code>true</code> 1075 */ 1076 public boolean isShowHeader() { 1077 if (showHeader != null) { 1078 return showHeader; 1079 } 1080 ValueExpression ve = getValueExpression("showHeader"); 1081 if (ve != null) { 1082 try { 1083 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 1084 if (bool != null) { 1085 return bool; 1086 } 1087 } catch (ELException e) { 1088 throw new FacesException(e); 1089 } 1090 } 1091 return true; 1092 } 1093 1094 public void setShowHeader(boolean showHeader) { 1095 this.showHeader = showHeader; 1096 } 1097 1098 /** 1099 The count of rendered direct paging links in the sheet's footer.<br /> 1100 <br />Default: <code>9</code> 1101 */ 1102 public java.lang.Integer getDirectLinkCount() { 1103 if (directLinkCount != null) { 1104 return directLinkCount; 1105 } 1106 ValueExpression ve = getValueExpression("directLinkCount"); 1107 if (ve != null) { 1108 try { 1109 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 1110 if (number != null) { 1111 return number.intValue(); 1112 } 1113 } catch (ELException e) { 1114 throw new FacesException(e); 1115 } 1116 } 1117 return 9; 1118 } 1119 1120 public void setDirectLinkCount(java.lang.Integer directLinkCount) { 1121 this.directLinkCount = directLinkCount; 1122 } 1123 1124 public javax.faces.el.MethodBinding getSortActionListener() { 1125 MethodExpression expression = getSortActionListenerExpression(); 1126 if (expression instanceof MethodBindingToMethodExpression) { 1127 return ((MethodBindingToMethodExpression)expression).getMethodBinding(); 1128 } 1129 if (expression != null) { 1130 return new MethodExpressionToMethodBinding(expression); 1131 } 1132 return null; 1133 } 1134 1135 public void setSortActionListener(javax.faces.el.MethodBinding sortActionListener) { 1136 if (sortActionListener != null) { 1137 setSortActionListenerExpression(new MethodBindingToMethodExpression(sortActionListener)); 1138 } else { 1139 setSortActionListenerExpression(null); 1140 } 1141 } 1142 1143 public javax.el.MethodExpression getSortActionListenerExpression() { 1144 return sortActionListenerExpression; 1145 } 1146 1147 public void setSortActionListenerExpression(javax.el.MethodExpression sortActionListenerExpression) { 1148 this.sortActionListenerExpression = sortActionListenerExpression; 1149 } 1150 1151 /** 1152 This attribute is for internal use only. 1153 1154 */ 1155 public java.lang.Integer getHorizontalIndex() { 1156 if (horizontalIndex != null) { 1157 return horizontalIndex; 1158 } 1159 ValueExpression ve = getValueExpression("horizontalIndex"); 1160 if (ve != null) { 1161 try { 1162 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 1163 if (number != null) { 1164 return number.intValue(); 1165 } 1166 } catch (ELException e) { 1167 throw new FacesException(e); 1168 } 1169 } 1170 return null; 1171 } 1172 1173 public void setHorizontalIndex(java.lang.Integer horizontalIndex) { 1174 this.horizontalIndex = horizontalIndex; 1175 } 1176 1177 public void restoreState(FacesContext context, Object componentState) { 1178 Object[] values = (Object[]) componentState; 1179 super.restoreState(context, values[0]); 1180 markup = (org.apache.myfaces.tobago.context.Markup) values[1]; 1181 marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2]; 1182 columns = (java.lang.String) values[3]; 1183 borderLeft = (org.apache.myfaces.tobago.layout.Measure) values[4]; 1184 height = (org.apache.myfaces.tobago.layout.Measure) values[5]; 1185 minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[6]; 1186 showDirectLinks = (java.lang.String) values[7]; 1187 showPageRange = (java.lang.String) values[8]; 1188 overflowX = (java.lang.Boolean) values[9]; 1189 overflowY = (java.lang.Boolean) values[10]; 1190 forceVerticalScrollbar = (java.lang.String) values[11]; 1191 stateChangeListener = (javax.faces.el.MethodBinding) restoreAttachedState(context, values[12]); 1192 borderRight = (org.apache.myfaces.tobago.layout.Measure) values[13]; 1193 maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[14]; 1194 currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[15]; 1195 paddingTop = (org.apache.myfaces.tobago.layout.Measure) values[16]; 1196 marginTop = (org.apache.myfaces.tobago.layout.Measure) values[17]; 1197 width = (org.apache.myfaces.tobago.layout.Measure) values[18]; 1198 currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[19]; 1199 borderBottom = (org.apache.myfaces.tobago.layout.Measure) values[20]; 1200 display = (org.apache.myfaces.tobago.layout.Display) values[21]; 1201 paddingLeft = (org.apache.myfaces.tobago.layout.Measure) values[22]; 1202 preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[23]; 1203 borderTop = (org.apache.myfaces.tobago.layout.Measure) values[24]; 1204 verticalIndex = (java.lang.Integer) values[25]; 1205 showPagingAlways = (java.lang.Boolean) values[26]; 1206 renderedPartially = (java.lang.String[]) values[27]; 1207 minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[28]; 1208 rowSpan = (java.lang.Integer) values[29]; 1209 left = (org.apache.myfaces.tobago.layout.Measure) values[30]; 1210 columnSpan = (java.lang.Integer) values[31]; 1211 paddingBottom = (org.apache.myfaces.tobago.layout.Measure) values[32]; 1212 top = (org.apache.myfaces.tobago.layout.Measure) values[33]; 1213 showRowRange = (java.lang.String) values[34]; 1214 marginRight = (org.apache.myfaces.tobago.layout.Measure) values[35]; 1215 preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[36]; 1216 maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[37]; 1217 paddingRight = (org.apache.myfaces.tobago.layout.Measure) values[38]; 1218 marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[39]; 1219 selectable = (java.lang.String) values[40]; 1220 showHeader = (java.lang.Boolean) values[41]; 1221 directLinkCount = (java.lang.Integer) values[42]; 1222 1223 sortActionListenerExpression = (javax.el.MethodExpression) restoreAttachedState(context, values[43]); 1224 horizontalIndex = (java.lang.Integer) values[44]; 1225 } 1226 1227 public Object saveState(FacesContext context) { 1228 Object[] values = new Object[45]; 1229 values[0] = super.saveState(context); 1230 values[1] = markup; 1231 values[2] = marginLeft; 1232 values[3] = columns; 1233 values[4] = borderLeft; 1234 values[5] = height; 1235 values[6] = minimumWidth; 1236 values[7] = showDirectLinks; 1237 values[8] = showPageRange; 1238 values[9] = overflowX; 1239 values[10] = overflowY; 1240 values[11] = forceVerticalScrollbar; 1241 values[12] = saveAttachedState(context, stateChangeListener); 1242 values[13] = borderRight; 1243 values[14] = maximumHeight; 1244 values[15] = currentWidth; 1245 values[16] = paddingTop; 1246 values[17] = marginTop; 1247 values[18] = width; 1248 values[19] = currentHeight; 1249 values[20] = borderBottom; 1250 values[21] = display; 1251 values[22] = paddingLeft; 1252 values[23] = preferredWidth; 1253 values[24] = borderTop; 1254 values[25] = verticalIndex; 1255 values[26] = showPagingAlways; 1256 values[27] = renderedPartially; 1257 values[28] = minimumHeight; 1258 values[29] = rowSpan; 1259 values[30] = left; 1260 values[31] = columnSpan; 1261 values[32] = paddingBottom; 1262 values[33] = top; 1263 values[34] = showRowRange; 1264 values[35] = marginRight; 1265 values[36] = preferredHeight; 1266 values[37] = maximumWidth; 1267 values[38] = paddingRight; 1268 values[39] = marginBottom; 1269 values[40] = selectable; 1270 values[41] = showHeader; 1271 values[42] = directLinkCount; 1272 1273 values[43] = saveAttachedState(context, sortActionListenerExpression); 1274 values[44] = horizontalIndex; 1275 currentMarkup = null; 1276 return values; 1277 } 1278 1279 1280 }