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