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.component.ActionSource; 024 import javax.faces.component.ActionSource2; 025 import javax.faces.context.FacesContext; 026 import javax.faces.el.MethodBinding; 027 import org.apache.myfaces.tobago.context.Markup; 028 import org.apache.myfaces.tobago.internal.component.AbstractUITabGroup; 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 Renders a tab group which contains tab panels. 048 * UIComponent class, generated from template {@code component1.2.stg} with class 049 * {@link org.apache.myfaces.tobago.internal.taglib.component.TabGroupTagDeclaration}. 050 */ 051 public class UITabGroup 052 extends AbstractUITabGroup implements ActionSource, ActionSource2, SupportsMarkup { 053 054 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TabGroup"; 055 056 private javax.faces.el.MethodBinding actionListener; 057 private org.apache.myfaces.tobago.context.Markup markup; 058 private java.lang.Integer renderedIndex; 059 private org.apache.myfaces.tobago.layout.Measure marginLeft; 060 private org.apache.myfaces.tobago.layout.Measure minimumHeight; 061 private org.apache.myfaces.tobago.layout.Measure borderLeft; 062 private org.apache.myfaces.tobago.layout.Measure height; 063 private org.apache.myfaces.tobago.layout.Measure minimumWidth; 064 065 private javax.el.MethodExpression actionExpression; 066 private java.lang.Integer rowSpan; 067 private org.apache.myfaces.tobago.layout.Measure left; 068 private java.lang.Integer columnSpan; 069 private org.apache.myfaces.tobago.layout.Measure borderRight; 070 private java.lang.Boolean showNavigationBar; 071 private org.apache.myfaces.tobago.layout.Measure paddingBottom; 072 private javax.faces.el.MethodBinding tabChangeListener; 073 private org.apache.myfaces.tobago.layout.Measure maximumHeight; 074 private org.apache.myfaces.tobago.layout.Measure top; 075 private org.apache.myfaces.tobago.layout.Measure currentWidth; 076 private java.lang.Integer selectedIndex; 077 private org.apache.myfaces.tobago.layout.Measure paddingTop; 078 private org.apache.myfaces.tobago.layout.Measure marginTop; 079 private org.apache.myfaces.tobago.layout.Measure width; 080 private org.apache.myfaces.tobago.layout.Measure marginRight; 081 private org.apache.myfaces.tobago.layout.Measure currentHeight; 082 private org.apache.myfaces.tobago.layout.Measure preferredHeight; 083 private org.apache.myfaces.tobago.layout.Measure borderBottom; 084 private org.apache.myfaces.tobago.layout.Display display; 085 private org.apache.myfaces.tobago.layout.Measure maximumWidth; 086 private org.apache.myfaces.tobago.layout.Measure paddingLeft; 087 private org.apache.myfaces.tobago.layout.Measure paddingRight; 088 private org.apache.myfaces.tobago.layout.Measure preferredWidth; 089 private java.lang.String switchType; 090 private org.apache.myfaces.tobago.layout.Measure marginBottom; 091 private java.lang.Boolean immediate; 092 private org.apache.myfaces.tobago.layout.Measure borderTop; 093 private java.lang.Integer verticalIndex; 094 private java.lang.String[] renderedPartially; 095 private org.apache.myfaces.tobago.context.Markup currentMarkup; 096 private java.lang.Integer horizontalIndex; 097 098 099 public javax.faces.el.MethodBinding getActionListener() { 100 return actionListener; 101 } 102 103 public void setActionListener(javax.faces.el.MethodBinding actionListener) { 104 this.actionListener = actionListener; 105 } 106 107 public org.apache.myfaces.tobago.context.Markup getMarkup() { 108 if (markup != null) { 109 return markup; 110 } 111 ValueExpression ve = getValueExpression("markup"); 112 if (ve != null) { 113 try { 114 Object object = ve.getValue(getFacesContext().getELContext()); 115 return Markup.valueOf(object); 116 } catch (ELException e) { 117 throw new FacesException(e); 118 } 119 } 120 return null; 121 } 122 123 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) { 124 this.markup = markup; 125 } 126 127 /** 128 For internal use. TODO: Check if this long needed 129 <br />Default: <code>0</code> 130 */ 131 public java.lang.Integer getRenderedIndex() { 132 if (renderedIndex != null) { 133 return renderedIndex; 134 } 135 ValueExpression ve = getValueExpression("renderedIndex"); 136 if (ve != null) { 137 try { 138 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 139 if (number != null) { 140 return number.intValue(); 141 } 142 } catch (ELException e) { 143 throw new FacesException(e); 144 } 145 } 146 return 0; 147 } 148 149 public void setRenderedIndex(java.lang.Integer renderedIndex) { 150 this.renderedIndex = renderedIndex; 151 } 152 153 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() { 154 if (marginLeft != null) { 155 return marginLeft; 156 } 157 ValueExpression ve = getValueExpression("marginLeft"); 158 if (ve != null) { 159 try { 160 Object object = ve.getValue(getFacesContext().getELContext()); 161 return Measure.valueOf(object); 162 } catch (ELException e) { 163 throw new FacesException(e); 164 } 165 } 166 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this); 167 } 168 169 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) { 170 this.marginLeft = marginLeft; 171 } 172 173 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() { 174 if (minimumHeight != null) { 175 return minimumHeight; 176 } 177 ValueExpression ve = getValueExpression("minimumHeight"); 178 if (ve != null) { 179 try { 180 Object object = ve.getValue(getFacesContext().getELContext()); 181 return Measure.valueOf(object); 182 } catch (ELException e) { 183 throw new FacesException(e); 184 } 185 } 186 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this); 187 } 188 189 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) { 190 this.minimumHeight = minimumHeight; 191 } 192 193 /** 194 This attribute is for internal use only. 195 196 */ 197 public org.apache.myfaces.tobago.layout.Measure getBorderLeft() { 198 if (borderLeft != null) { 199 return borderLeft; 200 } 201 ValueExpression ve = getValueExpression("borderLeft"); 202 if (ve != null) { 203 try { 204 Object object = ve.getValue(getFacesContext().getELContext()); 205 return Measure.valueOf(object); 206 } catch (ELException e) { 207 throw new FacesException(e); 208 } 209 } 210 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 211 getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this); 212 } 213 214 public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) { 215 this.borderLeft = borderLeft; 216 } 217 218 /** 219 This value will usually be set by the layout manager. 220 221 */ 222 public org.apache.myfaces.tobago.layout.Measure getHeight() { 223 if (height != null) { 224 return height; 225 } 226 ValueExpression ve = getValueExpression("height"); 227 if (ve != null) { 228 try { 229 Object object = ve.getValue(getFacesContext().getELContext()); 230 return Measure.valueOf(object); 231 } catch (ELException e) { 232 throw new FacesException(e); 233 } 234 } 235 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this); 236 } 237 238 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) { 239 this.height = height; 240 } 241 242 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() { 243 if (minimumWidth != null) { 244 return minimumWidth; 245 } 246 ValueExpression ve = getValueExpression("minimumWidth"); 247 if (ve != null) { 248 try { 249 Object object = ve.getValue(getFacesContext().getELContext()); 250 return Measure.valueOf(object); 251 } catch (ELException e) { 252 throw new FacesException(e); 253 } 254 } 255 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this); 256 } 257 258 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) { 259 this.minimumWidth = minimumWidth; 260 } 261 262 public javax.faces.el.MethodBinding getAction() { 263 MethodExpression expression = getActionExpression(); 264 if (expression instanceof MethodBindingToMethodExpression) { 265 return ((MethodBindingToMethodExpression)expression).getMethodBinding(); 266 } 267 if (expression != null) { 268 return new MethodExpressionToMethodBinding(expression); 269 } 270 return null; 271 } 272 273 public void setAction(javax.faces.el.MethodBinding action) { 274 if (action != null) { 275 setActionExpression(new MethodBindingToMethodExpression(action)); 276 } else { 277 setActionExpression(null); 278 } 279 } 280 281 public javax.el.MethodExpression getActionExpression() { 282 return actionExpression; 283 } 284 285 public void setActionExpression(javax.el.MethodExpression actionExpression) { 286 this.actionExpression = actionExpression; 287 } 288 289 public java.lang.Integer getRowSpan() { 290 if (rowSpan != null) { 291 return rowSpan; 292 } 293 ValueExpression ve = getValueExpression("rowSpan"); 294 if (ve != null) { 295 try { 296 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 297 if (number != null) { 298 return number.intValue(); 299 } 300 } catch (ELException e) { 301 throw new FacesException(e); 302 } 303 } 304 return 1; 305 } 306 307 public void setRowSpan(java.lang.Integer rowSpan) { 308 this.rowSpan = rowSpan; 309 } 310 311 /** 312 This value will usually be set by the layout manager. 313 314 */ 315 public org.apache.myfaces.tobago.layout.Measure getLeft() { 316 if (left != null) { 317 return left; 318 } 319 ValueExpression ve = getValueExpression("left"); 320 if (ve != null) { 321 try { 322 Object object = ve.getValue(getFacesContext().getELContext()); 323 return Measure.valueOf(object); 324 } catch (ELException e) { 325 throw new FacesException(e); 326 } 327 } 328 return null; 329 } 330 331 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) { 332 this.left = left; 333 } 334 335 public java.lang.Integer getColumnSpan() { 336 if (columnSpan != null) { 337 return columnSpan; 338 } 339 ValueExpression ve = getValueExpression("columnSpan"); 340 if (ve != null) { 341 try { 342 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 343 if (number != null) { 344 return number.intValue(); 345 } 346 } catch (ELException e) { 347 throw new FacesException(e); 348 } 349 } 350 return 1; 351 } 352 353 public void setColumnSpan(java.lang.Integer columnSpan) { 354 this.columnSpan = columnSpan; 355 } 356 357 /** 358 This attribute is for internal use only. 359 360 */ 361 public org.apache.myfaces.tobago.layout.Measure getBorderRight() { 362 if (borderRight != null) { 363 return borderRight; 364 } 365 ValueExpression ve = getValueExpression("borderRight"); 366 if (ve != null) { 367 try { 368 Object object = ve.getValue(getFacesContext().getELContext()); 369 return Measure.valueOf(object); 370 } catch (ELException e) { 371 throw new FacesException(e); 372 } 373 } 374 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 375 getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this); 376 } 377 378 public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) { 379 this.borderRight = borderRight; 380 } 381 382 /** 383 Flag indicating that the tab navigation bar is rendered. 384 <br />Default: <code>true</code> 385 */ 386 public boolean isShowNavigationBar() { 387 if (showNavigationBar != null) { 388 return showNavigationBar; 389 } 390 ValueExpression ve = getValueExpression("showNavigationBar"); 391 if (ve != null) { 392 try { 393 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 394 if (bool != null) { 395 return bool; 396 } 397 } catch (ELException e) { 398 throw new FacesException(e); 399 } 400 } 401 return true; 402 } 403 404 public void setShowNavigationBar(boolean showNavigationBar) { 405 this.showNavigationBar = showNavigationBar; 406 } 407 408 /** 409 This attribute is for internal use only. 410 411 */ 412 public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() { 413 if (paddingBottom != null) { 414 return paddingBottom; 415 } 416 ValueExpression ve = getValueExpression("paddingBottom"); 417 if (ve != null) { 418 try { 419 Object object = ve.getValue(getFacesContext().getELContext()); 420 return Measure.valueOf(object); 421 } catch (ELException e) { 422 throw new FacesException(e); 423 } 424 } 425 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 426 getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this); 427 } 428 429 public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) { 430 this.paddingBottom = paddingBottom; 431 } 432 433 public javax.faces.el.MethodBinding getTabChangeListener() { 434 return tabChangeListener; 435 } 436 437 public void setTabChangeListener(javax.faces.el.MethodBinding tabChangeListener) { 438 this.tabChangeListener = tabChangeListener; 439 } 440 441 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() { 442 if (maximumHeight != null) { 443 return maximumHeight; 444 } 445 ValueExpression ve = getValueExpression("maximumHeight"); 446 if (ve != null) { 447 try { 448 Object object = ve.getValue(getFacesContext().getELContext()); 449 return Measure.valueOf(object); 450 } catch (ELException e) { 451 throw new FacesException(e); 452 } 453 } 454 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this); 455 } 456 457 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) { 458 this.maximumHeight = maximumHeight; 459 } 460 461 /** 462 This value will usually be set by the layout manager. 463 464 */ 465 public org.apache.myfaces.tobago.layout.Measure getTop() { 466 if (top != null) { 467 return top; 468 } 469 ValueExpression ve = getValueExpression("top"); 470 if (ve != null) { 471 try { 472 Object object = ve.getValue(getFacesContext().getELContext()); 473 return Measure.valueOf(object); 474 } catch (ELException e) { 475 throw new FacesException(e); 476 } 477 } 478 return null; 479 } 480 481 public void setTop(org.apache.myfaces.tobago.layout.Measure top) { 482 this.top = top; 483 } 484 485 /** 486 This value will usually be set by the layout manager. It holds the current width computed by the layout manager. 487 488 */ 489 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() { 490 if (currentWidth != null) { 491 return currentWidth; 492 } 493 ValueExpression ve = getValueExpression("currentWidth"); 494 if (ve != null) { 495 try { 496 Object object = ve.getValue(getFacesContext().getELContext()); 497 return Measure.valueOf(object); 498 } catch (ELException e) { 499 throw new FacesException(e); 500 } 501 } 502 return getWidth(); 503 } 504 505 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) { 506 this.currentWidth = currentWidth; 507 } 508 509 /** 510 <strong>ValueBindingExpression</strong> pointing to a Integer to save the 511 component's selected Tab. 512 <br />Default: <code>0</code> 513 */ 514 public java.lang.Integer getSelectedIndex() { 515 if (selectedIndex != null) { 516 return selectedIndex; 517 } 518 ValueExpression ve = getValueExpression("selectedIndex"); 519 if (ve != null) { 520 try { 521 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 522 if (number != null) { 523 return number.intValue(); 524 } 525 } catch (ELException e) { 526 throw new FacesException(e); 527 } 528 } 529 return 0; 530 } 531 532 public void setSelectedIndex(java.lang.Integer selectedIndex) { 533 this.selectedIndex = selectedIndex; 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 This value will usually be set by the layout manager. 583 584 */ 585 public org.apache.myfaces.tobago.layout.Measure getWidth() { 586 if (width != null) { 587 return width; 588 } 589 ValueExpression ve = getValueExpression("width"); 590 if (ve != null) { 591 try { 592 Object object = ve.getValue(getFacesContext().getELContext()); 593 return Measure.valueOf(object); 594 } catch (ELException e) { 595 throw new FacesException(e); 596 } 597 } 598 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this); 599 } 600 601 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) { 602 this.width = width; 603 } 604 605 public org.apache.myfaces.tobago.layout.Measure getMarginRight() { 606 if (marginRight != null) { 607 return marginRight; 608 } 609 ValueExpression ve = getValueExpression("marginRight"); 610 if (ve != null) { 611 try { 612 Object object = ve.getValue(getFacesContext().getELContext()); 613 return Measure.valueOf(object); 614 } catch (ELException e) { 615 throw new FacesException(e); 616 } 617 } 618 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this); 619 } 620 621 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) { 622 this.marginRight = marginRight; 623 } 624 625 /** 626 This value will usually be set by the layout manager. It holds the current height computed by the layout manager. 627 628 */ 629 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() { 630 if (currentHeight != null) { 631 return currentHeight; 632 } 633 ValueExpression ve = getValueExpression("currentHeight"); 634 if (ve != null) { 635 try { 636 Object object = ve.getValue(getFacesContext().getELContext()); 637 return Measure.valueOf(object); 638 } catch (ELException e) { 639 throw new FacesException(e); 640 } 641 } 642 return getHeight(); 643 } 644 645 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) { 646 this.currentHeight = currentHeight; 647 } 648 649 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() { 650 if (preferredHeight != null) { 651 return preferredHeight; 652 } 653 ValueExpression ve = getValueExpression("preferredHeight"); 654 if (ve != null) { 655 try { 656 Object object = ve.getValue(getFacesContext().getELContext()); 657 return Measure.valueOf(object); 658 } catch (ELException e) { 659 throw new FacesException(e); 660 } 661 } 662 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this); 663 } 664 665 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) { 666 this.preferredHeight = preferredHeight; 667 } 668 669 /** 670 This attribute is for internal use only. 671 672 */ 673 public org.apache.myfaces.tobago.layout.Measure getBorderBottom() { 674 if (borderBottom != null) { 675 return borderBottom; 676 } 677 ValueExpression ve = getValueExpression("borderBottom"); 678 if (ve != null) { 679 try { 680 Object object = ve.getValue(getFacesContext().getELContext()); 681 return Measure.valueOf(object); 682 } catch (ELException e) { 683 throw new FacesException(e); 684 } 685 } 686 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 687 getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this); 688 } 689 690 public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) { 691 this.borderBottom = borderBottom; 692 } 693 694 /** 695 This attribute is for internal use only. 696 697 */ 698 public org.apache.myfaces.tobago.layout.Display getDisplay() { 699 if (display != null) { 700 return display; 701 } 702 ValueExpression ve = getValueExpression("display"); 703 if (ve != null) { 704 try { 705 return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext()); 706 } catch (ELException e) { 707 throw new FacesException(e); 708 } 709 } 710 return null; 711 } 712 713 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) { 714 this.display = display; 715 } 716 717 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() { 718 if (maximumWidth != null) { 719 return maximumWidth; 720 } 721 ValueExpression ve = getValueExpression("maximumWidth"); 722 if (ve != null) { 723 try { 724 Object object = ve.getValue(getFacesContext().getELContext()); 725 return Measure.valueOf(object); 726 } catch (ELException e) { 727 throw new FacesException(e); 728 } 729 } 730 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this); 731 } 732 733 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) { 734 this.maximumWidth = maximumWidth; 735 } 736 737 /** 738 This attribute is for internal use only. 739 740 */ 741 public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() { 742 if (paddingLeft != null) { 743 return paddingLeft; 744 } 745 ValueExpression ve = getValueExpression("paddingLeft"); 746 if (ve != null) { 747 try { 748 Object object = ve.getValue(getFacesContext().getELContext()); 749 return Measure.valueOf(object); 750 } catch (ELException e) { 751 throw new FacesException(e); 752 } 753 } 754 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 755 getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this); 756 } 757 758 public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) { 759 this.paddingLeft = paddingLeft; 760 } 761 762 /** 763 This attribute is for internal use only. 764 765 */ 766 public org.apache.myfaces.tobago.layout.Measure getPaddingRight() { 767 if (paddingRight != null) { 768 return paddingRight; 769 } 770 ValueExpression ve = getValueExpression("paddingRight"); 771 if (ve != null) { 772 try { 773 Object object = ve.getValue(getFacesContext().getELContext()); 774 return Measure.valueOf(object); 775 } catch (ELException e) { 776 throw new FacesException(e); 777 } 778 } 779 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 780 getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this); 781 } 782 783 public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) { 784 this.paddingRight = paddingRight; 785 } 786 787 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() { 788 if (preferredWidth != null) { 789 return preferredWidth; 790 } 791 ValueExpression ve = getValueExpression("preferredWidth"); 792 if (ve != null) { 793 try { 794 Object object = ve.getValue(getFacesContext().getELContext()); 795 return Measure.valueOf(object); 796 } catch (ELException e) { 797 throw new FacesException(e); 798 } 799 } 800 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this); 801 } 802 803 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) { 804 this.preferredWidth = preferredWidth; 805 } 806 807 /** 808 Indicating how tab switching should be done. 809 <p/> 810 Possible values are: 811 <dl> 812 <dt>client</dt> 813 <dd>Tab switching is done on client, no server Request.</dd> 814 <dt>reloadPage</dt> 815 <dd>Tab switching is done by server request. Full page is reloaded.</dd> 816 <dt>reloadTab</dt> 817 <dd>Tab switching is done by server request. Only the Tab is reloaded.</dd> 818 </dl> 819 <br />Default: <code>client</code><br />Allowed Values: <code>client,reloadPage,reloadTab</code> 820 */ 821 public java.lang.String getSwitchType() { 822 if (switchType != null) { 823 return switchType; 824 } 825 ValueExpression ve = getValueExpression("switchType"); 826 if (ve != null) { 827 try { 828 java.lang.String switchType = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 829 if (switchType != null) { 830 return switchType; 831 } 832 } catch (ELException e) { 833 throw new FacesException(e); 834 } 835 } 836 return "client"; 837 } 838 839 public void setSwitchType(java.lang.String switchType) { 840 this.switchType = switchType; 841 } 842 843 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() { 844 if (marginBottom != null) { 845 return marginBottom; 846 } 847 ValueExpression ve = getValueExpression("marginBottom"); 848 if (ve != null) { 849 try { 850 Object object = ve.getValue(getFacesContext().getELContext()); 851 return Measure.valueOf(object); 852 } catch (ELException e) { 853 throw new FacesException(e); 854 } 855 } 856 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this); 857 } 858 859 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) { 860 this.marginBottom = marginBottom; 861 } 862 863 /** 864 Flag indicating that, if this component is activated by the user, 865 notifications should be delivered to interested listeners and actions 866 immediately (that is, during Apply Request Values phase) rather than 867 waiting until Invoke Application phase. 868 <br />Default: <code>false</code> 869 */ 870 public boolean isImmediate() { 871 if (immediate != null) { 872 return immediate; 873 } 874 ValueExpression ve = getValueExpression("immediate"); 875 if (ve != null) { 876 try { 877 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 878 if (bool != null) { 879 return bool; 880 } 881 } catch (ELException e) { 882 throw new FacesException(e); 883 } 884 } 885 return false; 886 } 887 888 public void setImmediate(boolean immediate) { 889 this.immediate = immediate; 890 } 891 892 /** 893 This attribute is for internal use only. 894 895 */ 896 public org.apache.myfaces.tobago.layout.Measure getBorderTop() { 897 if (borderTop != null) { 898 return borderTop; 899 } 900 ValueExpression ve = getValueExpression("borderTop"); 901 if (ve != null) { 902 try { 903 Object object = ve.getValue(getFacesContext().getELContext()); 904 return Measure.valueOf(object); 905 } catch (ELException e) { 906 throw new FacesException(e); 907 } 908 } 909 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 910 getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this); 911 } 912 913 public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) { 914 this.borderTop = borderTop; 915 } 916 917 /** 918 This attribute is for internal use only. 919 920 */ 921 public java.lang.Integer getVerticalIndex() { 922 if (verticalIndex != null) { 923 return verticalIndex; 924 } 925 ValueExpression ve = getValueExpression("verticalIndex"); 926 if (ve != null) { 927 try { 928 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 929 if (number != null) { 930 return number.intValue(); 931 } 932 } catch (ELException e) { 933 throw new FacesException(e); 934 } 935 } 936 return null; 937 } 938 939 public void setVerticalIndex(java.lang.Integer verticalIndex) { 940 this.verticalIndex = verticalIndex; 941 } 942 943 /** 944 Indicate the partially rendered Components in a case of a submit. 945 946 */ 947 public String[] getRenderedPartially() { 948 if (renderedPartially != null) { 949 return renderedPartially; 950 } 951 ValueExpression ve = getValueExpression("renderedPartially"); 952 if (ve != null) { 953 try { 954 Object strArray = ve.getValue(getFacesContext().getELContext()); 955 if (strArray instanceof String[]) { 956 return (String[]) strArray; 957 } else if (strArray instanceof String) { 958 String[] strings = StringUtils.split((String) strArray, ", "); 959 List<String> result = new ArrayList<String>(strings.length); 960 for (String string : strings) { 961 if (string.trim().length() != 0) { 962 result.add(string.trim()); 963 } 964 } 965 return result.toArray(new String[result.size()]); 966 } else if (strArray == null) { 967 return ArrayUtils.EMPTY_STRING_ARRAY; 968 } else { 969 return new String[]{strArray.toString()}; 970 } 971 } catch (ELException e) { 972 throw new FacesException(e); 973 } 974 } 975 return ArrayUtils.EMPTY_STRING_ARRAY; 976 } 977 978 public void setRenderedPartially(String[] renderedPartially) { 979 this.renderedPartially = renderedPartially; 980 } 981 982 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() { 983 if (currentMarkup != null) { 984 return currentMarkup; 985 } 986 ValueExpression ve = getValueExpression("currentMarkup"); 987 if (ve != null) { 988 try { 989 Object object = ve.getValue(getFacesContext().getELContext()); 990 return Markup.valueOf(object); 991 } catch (ELException e) { 992 throw new FacesException(e); 993 } 994 } 995 return null; 996 } 997 998 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) { 999 this.currentMarkup = currentMarkup; 1000 } 1001 1002 /** 1003 This attribute is for internal use only. 1004 1005 */ 1006 public java.lang.Integer getHorizontalIndex() { 1007 if (horizontalIndex != null) { 1008 return horizontalIndex; 1009 } 1010 ValueExpression ve = getValueExpression("horizontalIndex"); 1011 if (ve != null) { 1012 try { 1013 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 1014 if (number != null) { 1015 return number.intValue(); 1016 } 1017 } catch (ELException e) { 1018 throw new FacesException(e); 1019 } 1020 } 1021 return null; 1022 } 1023 1024 public void setHorizontalIndex(java.lang.Integer horizontalIndex) { 1025 this.horizontalIndex = horizontalIndex; 1026 } 1027 1028 public void restoreState(FacesContext context, Object componentState) { 1029 Object[] values = (Object[]) componentState; 1030 super.restoreState(context, values[0]); 1031 actionListener = (javax.faces.el.MethodBinding) restoreAttachedState(context, values[1]); 1032 markup = (org.apache.myfaces.tobago.context.Markup) values[2]; 1033 renderedIndex = (java.lang.Integer) values[3]; 1034 marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[4]; 1035 minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[5]; 1036 borderLeft = (org.apache.myfaces.tobago.layout.Measure) values[6]; 1037 height = (org.apache.myfaces.tobago.layout.Measure) values[7]; 1038 minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[8]; 1039 1040 actionExpression = (javax.el.MethodExpression) restoreAttachedState(context, values[9]); 1041 rowSpan = (java.lang.Integer) values[10]; 1042 left = (org.apache.myfaces.tobago.layout.Measure) values[11]; 1043 columnSpan = (java.lang.Integer) values[12]; 1044 borderRight = (org.apache.myfaces.tobago.layout.Measure) values[13]; 1045 showNavigationBar = (java.lang.Boolean) values[14]; 1046 paddingBottom = (org.apache.myfaces.tobago.layout.Measure) values[15]; 1047 tabChangeListener = (javax.faces.el.MethodBinding) restoreAttachedState(context, values[16]); 1048 maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[17]; 1049 top = (org.apache.myfaces.tobago.layout.Measure) values[18]; 1050 currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[19]; 1051 selectedIndex = (java.lang.Integer) values[20]; 1052 paddingTop = (org.apache.myfaces.tobago.layout.Measure) values[21]; 1053 marginTop = (org.apache.myfaces.tobago.layout.Measure) values[22]; 1054 width = (org.apache.myfaces.tobago.layout.Measure) values[23]; 1055 marginRight = (org.apache.myfaces.tobago.layout.Measure) values[24]; 1056 currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[25]; 1057 preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[26]; 1058 borderBottom = (org.apache.myfaces.tobago.layout.Measure) values[27]; 1059 display = (org.apache.myfaces.tobago.layout.Display) values[28]; 1060 maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[29]; 1061 paddingLeft = (org.apache.myfaces.tobago.layout.Measure) values[30]; 1062 paddingRight = (org.apache.myfaces.tobago.layout.Measure) values[31]; 1063 preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[32]; 1064 switchType = (java.lang.String) values[33]; 1065 marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[34]; 1066 immediate = (java.lang.Boolean) values[35]; 1067 borderTop = (org.apache.myfaces.tobago.layout.Measure) values[36]; 1068 verticalIndex = (java.lang.Integer) values[37]; 1069 renderedPartially = (java.lang.String[]) values[38]; 1070 currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[39]; 1071 horizontalIndex = (java.lang.Integer) values[40]; 1072 } 1073 1074 public Object saveState(FacesContext context) { 1075 Object[] values = new Object[42]; 1076 values[0] = super.saveState(context); 1077 values[1] = saveAttachedState(context, actionListener); 1078 values[2] = markup; 1079 values[3] = renderedIndex; 1080 values[4] = marginLeft; 1081 values[5] = minimumHeight; 1082 values[6] = borderLeft; 1083 values[7] = height; 1084 values[8] = minimumWidth; 1085 1086 values[9] = saveAttachedState(context, actionExpression); 1087 values[10] = rowSpan; 1088 values[11] = left; 1089 values[12] = columnSpan; 1090 values[13] = borderRight; 1091 values[14] = showNavigationBar; 1092 values[15] = paddingBottom; 1093 values[16] = saveAttachedState(context, tabChangeListener); 1094 values[17] = maximumHeight; 1095 values[18] = top; 1096 values[19] = currentWidth; 1097 values[20] = selectedIndex; 1098 values[21] = paddingTop; 1099 values[22] = marginTop; 1100 values[23] = width; 1101 values[24] = marginRight; 1102 values[25] = currentHeight; 1103 values[26] = preferredHeight; 1104 values[27] = borderBottom; 1105 values[28] = display; 1106 values[29] = maximumWidth; 1107 values[30] = paddingLeft; 1108 values[31] = paddingRight; 1109 values[32] = preferredWidth; 1110 values[33] = switchType; 1111 values[34] = marginBottom; 1112 values[35] = immediate; 1113 values[36] = borderTop; 1114 values[37] = verticalIndex; 1115 values[38] = renderedPartially; 1116 values[39] = currentMarkup; 1117 values[40] = horizontalIndex; 1118 return values; 1119 } 1120 1121 1122 }