001 // ---------- Attention: Generated code, please do not modify! ----------- 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache License, Version 2.0 008 * (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020 package org.apache.myfaces.tobago.component; 021 022 import javax.faces.context.FacesContext; 023 import org.apache.myfaces.tobago.context.Markup; 024 import org.apache.myfaces.tobago.internal.component.AbstractUIToolBar; 025 import org.apache.myfaces.tobago.layout.Display; 026 import org.apache.myfaces.tobago.layout.Measure; 027 import org.apache.commons.lang.ArrayUtils; 028 import org.apache.commons.lang.StringUtils; 029 import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression; 030 import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding; 031 import org.apache.myfaces.tobago.internal.util.Deprecation; 032 import org.apache.myfaces.tobago.renderkit.MarginValues; 033 import org.apache.myfaces.tobago.renderkit.SpacingValues; 034 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer; 035 import javax.el.ELException; 036 import javax.faces.FacesException; 037 import java.util.ArrayList; 038 import java.util.List; 039 import javax.el.MethodExpression; 040 import javax.el.ValueExpression; 041 042 /** 043 <p/> 044 Renders a toolbar.<p /> 045 Allowed subcomponents are subtypes of UICommand i.e. 046 <code>'button'</code> and <code>'link'</code> tags. 047 These are rendered by ToolbarRenderer, so the result has 048 no difference.<p /> 049 To add an dropdown menu to a button add a facet <code>'menupopup'</code> 050 containing a 051 <a href="menu.html"><code><tc:menu></code></a> 052 tag to the button. Label's and Image's on those menu tag's are ignored 053 and replaced by the renderer. 054 <pre> 055 <tc:button onclick="alert('test 0')" 056 label="Alert 0" > 057 <f:facet name="menupopup"> 058 <tc:menu> 059 <tc:menuCommand onclick="alert('test 1')" label="Alert 1"/> 060 <tc:menuCommand onclick="alert('test 2')" label="Alert 2"/> 061 <tc:menuCommand onclick="alert('test 3')" label="Alert 3"/> 062 </tc:menu> 063 </f:facet> 064 </tc:button> 065 </pre> 066 * UIComponent class, generated from template {@code component1.2.stg} with class 067 * {@link org.apache.myfaces.tobago.internal.taglib.component.ToolBarTagDeclaration}. 068 */ 069 public class UIToolBar 070 extends AbstractUIToolBar implements SupportsMarkup { 071 072 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ToolBar"; 073 074 private org.apache.myfaces.tobago.context.Markup markup; 075 private org.apache.myfaces.tobago.layout.Measure marginLeft; 076 private org.apache.myfaces.tobago.layout.Measure minimumHeight; 077 private org.apache.myfaces.tobago.layout.Measure borderLeft; 078 private java.lang.String tip; 079 private org.apache.myfaces.tobago.layout.Measure height; 080 private org.apache.myfaces.tobago.layout.Measure minimumWidth; 081 private java.lang.Boolean overflowX; 082 private java.lang.Integer rowSpan; 083 private java.lang.Boolean overflowY; 084 private org.apache.myfaces.tobago.layout.Measure left; 085 private java.lang.Integer columnSpan; 086 private org.apache.myfaces.tobago.layout.Measure borderRight; 087 private org.apache.myfaces.tobago.layout.Measure paddingBottom; 088 private org.apache.myfaces.tobago.layout.Measure maximumHeight; 089 private org.apache.myfaces.tobago.layout.Measure top; 090 private java.lang.String orientation; 091 private org.apache.myfaces.tobago.layout.Measure currentWidth; 092 private org.apache.myfaces.tobago.layout.Measure paddingTop; 093 private org.apache.myfaces.tobago.layout.Measure marginTop; 094 private org.apache.myfaces.tobago.layout.Measure marginRight; 095 private org.apache.myfaces.tobago.layout.Measure width; 096 private org.apache.myfaces.tobago.layout.Measure currentHeight; 097 private org.apache.myfaces.tobago.layout.Measure preferredHeight; 098 private java.lang.String labelPosition; 099 private org.apache.myfaces.tobago.layout.Display display; 100 private org.apache.myfaces.tobago.layout.Measure borderBottom; 101 private org.apache.myfaces.tobago.layout.Measure maximumWidth; 102 private org.apache.myfaces.tobago.layout.Measure paddingLeft; 103 private org.apache.myfaces.tobago.layout.Measure paddingRight; 104 private org.apache.myfaces.tobago.layout.Measure preferredWidth; 105 private org.apache.myfaces.tobago.layout.Measure marginBottom; 106 private java.lang.String iconSize; 107 private java.lang.Integer verticalIndex; 108 private org.apache.myfaces.tobago.layout.Measure borderTop; 109 private org.apache.myfaces.tobago.context.Markup currentMarkup; 110 private java.lang.Integer horizontalIndex; 111 112 113 public org.apache.myfaces.tobago.context.Markup getMarkup() { 114 if (markup != null) { 115 return markup; 116 } 117 ValueExpression ve = getValueExpression("markup"); 118 if (ve != null) { 119 try { 120 Object object = ve.getValue(getFacesContext().getELContext()); 121 return Markup.valueOf(object); 122 } catch (ELException e) { 123 throw new FacesException(e); 124 } 125 } 126 return null; 127 } 128 129 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) { 130 this.markup = markup; 131 } 132 133 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() { 134 if (marginLeft != null) { 135 return marginLeft; 136 } 137 ValueExpression ve = getValueExpression("marginLeft"); 138 if (ve != null) { 139 try { 140 Object object = ve.getValue(getFacesContext().getELContext()); 141 return Measure.valueOf(object); 142 } catch (ELException e) { 143 throw new FacesException(e); 144 } 145 } 146 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this); 147 } 148 149 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) { 150 this.marginLeft = marginLeft; 151 } 152 153 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() { 154 if (minimumHeight != null) { 155 return minimumHeight; 156 } 157 ValueExpression ve = getValueExpression("minimumHeight"); 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())).getMinimumHeight(getFacesContext(), this); 167 } 168 169 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) { 170 this.minimumHeight = minimumHeight; 171 } 172 173 /** 174 This attribute is for internal use only. 175 176 */ 177 public org.apache.myfaces.tobago.layout.Measure getBorderLeft() { 178 if (borderLeft != null) { 179 return borderLeft; 180 } 181 ValueExpression ve = getValueExpression("borderLeft"); 182 if (ve != null) { 183 try { 184 Object object = ve.getValue(getFacesContext().getELContext()); 185 return Measure.valueOf(object); 186 } catch (ELException e) { 187 throw new FacesException(e); 188 } 189 } 190 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 191 getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this); 192 } 193 194 public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) { 195 this.borderLeft = borderLeft; 196 } 197 198 /** 199 Text value to display as tooltip. 200 201 */ 202 public java.lang.String getTip() { 203 if (tip != null) { 204 return tip; 205 } 206 ValueExpression ve = getValueExpression("tip"); 207 if (ve != null) { 208 try { 209 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 210 } catch (ELException e) { 211 throw new FacesException(e); 212 } 213 } 214 return null; 215 } 216 217 public void setTip(java.lang.String tip) { 218 this.tip = tip; 219 } 220 221 /** 222 This value will usually be set by the layout manager. 223 224 */ 225 public org.apache.myfaces.tobago.layout.Measure getHeight() { 226 if (height != null) { 227 return height; 228 } 229 ValueExpression ve = getValueExpression("height"); 230 if (ve != null) { 231 try { 232 Object object = ve.getValue(getFacesContext().getELContext()); 233 return Measure.valueOf(object); 234 } catch (ELException e) { 235 throw new FacesException(e); 236 } 237 } 238 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this); 239 } 240 241 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) { 242 this.height = height; 243 } 244 245 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() { 246 if (minimumWidth != null) { 247 return minimumWidth; 248 } 249 ValueExpression ve = getValueExpression("minimumWidth"); 250 if (ve != null) { 251 try { 252 Object object = ve.getValue(getFacesContext().getELContext()); 253 return Measure.valueOf(object); 254 } catch (ELException e) { 255 throw new FacesException(e); 256 } 257 } 258 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this); 259 } 260 261 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) { 262 this.minimumWidth = minimumWidth; 263 } 264 265 /** 266 This attribute is for internal use only. 267 268 */ 269 public boolean isOverflowX() { 270 if (overflowX != null) { 271 return overflowX; 272 } 273 ValueExpression ve = getValueExpression("overflowX"); 274 if (ve != null) { 275 try { 276 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 277 if (bool != null) { 278 return bool; 279 } 280 } catch (ELException e) { 281 throw new FacesException(e); 282 } 283 } 284 return false; 285 } 286 287 public void setOverflowX(boolean overflowX) { 288 this.overflowX = overflowX; 289 } 290 291 public java.lang.Integer getRowSpan() { 292 if (rowSpan != null) { 293 return rowSpan; 294 } 295 ValueExpression ve = getValueExpression("rowSpan"); 296 if (ve != null) { 297 try { 298 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 299 if (number != null) { 300 return number.intValue(); 301 } 302 } catch (ELException e) { 303 throw new FacesException(e); 304 } 305 } 306 return 1; 307 } 308 309 public void setRowSpan(java.lang.Integer rowSpan) { 310 this.rowSpan = rowSpan; 311 } 312 313 /** 314 This attribute is for internal use only. 315 316 */ 317 public boolean isOverflowY() { 318 if (overflowY != null) { 319 return overflowY; 320 } 321 ValueExpression ve = getValueExpression("overflowY"); 322 if (ve != null) { 323 try { 324 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 325 if (bool != null) { 326 return bool; 327 } 328 } catch (ELException e) { 329 throw new FacesException(e); 330 } 331 } 332 return false; 333 } 334 335 public void setOverflowY(boolean overflowY) { 336 this.overflowY = overflowY; 337 } 338 339 /** 340 This value will usually be set by the layout manager. 341 342 */ 343 public org.apache.myfaces.tobago.layout.Measure getLeft() { 344 if (left != null) { 345 return left; 346 } 347 ValueExpression ve = getValueExpression("left"); 348 if (ve != null) { 349 try { 350 Object object = ve.getValue(getFacesContext().getELContext()); 351 return Measure.valueOf(object); 352 } catch (ELException e) { 353 throw new FacesException(e); 354 } 355 } 356 return null; 357 } 358 359 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) { 360 this.left = left; 361 } 362 363 public java.lang.Integer getColumnSpan() { 364 if (columnSpan != null) { 365 return columnSpan; 366 } 367 ValueExpression ve = getValueExpression("columnSpan"); 368 if (ve != null) { 369 try { 370 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 371 if (number != null) { 372 return number.intValue(); 373 } 374 } catch (ELException e) { 375 throw new FacesException(e); 376 } 377 } 378 return 1; 379 } 380 381 public void setColumnSpan(java.lang.Integer columnSpan) { 382 this.columnSpan = columnSpan; 383 } 384 385 /** 386 This attribute is for internal use only. 387 388 */ 389 public org.apache.myfaces.tobago.layout.Measure getBorderRight() { 390 if (borderRight != null) { 391 return borderRight; 392 } 393 ValueExpression ve = getValueExpression("borderRight"); 394 if (ve != null) { 395 try { 396 Object object = ve.getValue(getFacesContext().getELContext()); 397 return Measure.valueOf(object); 398 } catch (ELException e) { 399 throw new FacesException(e); 400 } 401 } 402 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 403 getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this); 404 } 405 406 public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) { 407 this.borderRight = borderRight; 408 } 409 410 /** 411 This attribute is for internal use only. 412 413 */ 414 public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() { 415 if (paddingBottom != null) { 416 return paddingBottom; 417 } 418 ValueExpression ve = getValueExpression("paddingBottom"); 419 if (ve != null) { 420 try { 421 Object object = ve.getValue(getFacesContext().getELContext()); 422 return Measure.valueOf(object); 423 } catch (ELException e) { 424 throw new FacesException(e); 425 } 426 } 427 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 428 getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this); 429 } 430 431 public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) { 432 this.paddingBottom = paddingBottom; 433 } 434 435 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() { 436 if (maximumHeight != null) { 437 return maximumHeight; 438 } 439 ValueExpression ve = getValueExpression("maximumHeight"); 440 if (ve != null) { 441 try { 442 Object object = ve.getValue(getFacesContext().getELContext()); 443 return Measure.valueOf(object); 444 } catch (ELException e) { 445 throw new FacesException(e); 446 } 447 } 448 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this); 449 } 450 451 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) { 452 this.maximumHeight = maximumHeight; 453 } 454 455 /** 456 This value will usually be set by the layout manager. 457 458 */ 459 public org.apache.myfaces.tobago.layout.Measure getTop() { 460 if (top != null) { 461 return top; 462 } 463 ValueExpression ve = getValueExpression("top"); 464 if (ve != null) { 465 try { 466 Object object = ve.getValue(getFacesContext().getELContext()); 467 return Measure.valueOf(object); 468 } catch (ELException e) { 469 throw new FacesException(e); 470 } 471 } 472 return null; 473 } 474 475 public void setTop(org.apache.myfaces.tobago.layout.Measure top) { 476 this.top = top; 477 } 478 479 /** 480 Orientation of toolbar 481 <br />Default: <code>left</code><br />Allowed Values: <code>left,right</code> 482 */ 483 public java.lang.String getOrientation() { 484 if (orientation != null) { 485 return orientation; 486 } 487 ValueExpression ve = getValueExpression("orientation"); 488 if (ve != null) { 489 try { 490 java.lang.String orientation = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 491 if (orientation != null) { 492 return orientation; 493 } 494 } catch (ELException e) { 495 throw new FacesException(e); 496 } 497 } 498 return "left"; 499 } 500 501 public void setOrientation(java.lang.String orientation) { 502 this.orientation = orientation; 503 } 504 505 /** 506 This value will usually be set by the layout manager. It holds the current width computed by the layout manager. 507 508 */ 509 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() { 510 if (currentWidth != null) { 511 return currentWidth; 512 } 513 ValueExpression ve = getValueExpression("currentWidth"); 514 if (ve != null) { 515 try { 516 Object object = ve.getValue(getFacesContext().getELContext()); 517 return Measure.valueOf(object); 518 } catch (ELException e) { 519 throw new FacesException(e); 520 } 521 } 522 return getWidth(); 523 } 524 525 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) { 526 this.currentWidth = currentWidth; 527 } 528 529 /** 530 This attribute is for internal use only. 531 532 */ 533 public org.apache.myfaces.tobago.layout.Measure getPaddingTop() { 534 if (paddingTop != null) { 535 return paddingTop; 536 } 537 ValueExpression ve = getValueExpression("paddingTop"); 538 if (ve != null) { 539 try { 540 Object object = ve.getValue(getFacesContext().getELContext()); 541 return Measure.valueOf(object); 542 } catch (ELException e) { 543 throw new FacesException(e); 544 } 545 } 546 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 547 getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this); 548 } 549 550 public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) { 551 this.paddingTop = paddingTop; 552 } 553 554 public org.apache.myfaces.tobago.layout.Measure getMarginTop() { 555 if (marginTop != null) { 556 return marginTop; 557 } 558 ValueExpression ve = getValueExpression("marginTop"); 559 if (ve != null) { 560 try { 561 Object object = ve.getValue(getFacesContext().getELContext()); 562 return Measure.valueOf(object); 563 } catch (ELException e) { 564 throw new FacesException(e); 565 } 566 } 567 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this); 568 } 569 570 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) { 571 this.marginTop = marginTop; 572 } 573 574 public org.apache.myfaces.tobago.layout.Measure getMarginRight() { 575 if (marginRight != null) { 576 return marginRight; 577 } 578 ValueExpression ve = getValueExpression("marginRight"); 579 if (ve != null) { 580 try { 581 Object object = ve.getValue(getFacesContext().getELContext()); 582 return Measure.valueOf(object); 583 } catch (ELException e) { 584 throw new FacesException(e); 585 } 586 } 587 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this); 588 } 589 590 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) { 591 this.marginRight = marginRight; 592 } 593 594 /** 595 This value will usually be set by the layout manager. 596 597 */ 598 public org.apache.myfaces.tobago.layout.Measure getWidth() { 599 if (width != null) { 600 return width; 601 } 602 ValueExpression ve = getValueExpression("width"); 603 if (ve != null) { 604 try { 605 Object object = ve.getValue(getFacesContext().getELContext()); 606 return Measure.valueOf(object); 607 } catch (ELException e) { 608 throw new FacesException(e); 609 } 610 } 611 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this); 612 } 613 614 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) { 615 this.width = width; 616 } 617 618 /** 619 This value will usually be set by the layout manager. It holds the current height computed by the layout manager. 620 621 */ 622 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() { 623 if (currentHeight != null) { 624 return currentHeight; 625 } 626 ValueExpression ve = getValueExpression("currentHeight"); 627 if (ve != null) { 628 try { 629 Object object = ve.getValue(getFacesContext().getELContext()); 630 return Measure.valueOf(object); 631 } catch (ELException e) { 632 throw new FacesException(e); 633 } 634 } 635 return getHeight(); 636 } 637 638 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) { 639 this.currentHeight = currentHeight; 640 } 641 642 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() { 643 if (preferredHeight != null) { 644 return preferredHeight; 645 } 646 ValueExpression ve = getValueExpression("preferredHeight"); 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 ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this); 656 } 657 658 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) { 659 this.preferredHeight = preferredHeight; 660 } 661 662 /** 663 Position of the button label, possible values are: right, bottom, off. 664 If toolbar is facet of box: bottom is changed to right! 665 <br />Default: <code>bottom</code><br />Allowed Values: <code>bottom,right,off</code> 666 */ 667 public java.lang.String getLabelPosition() { 668 if (labelPosition != null) { 669 return labelPosition; 670 } 671 ValueExpression ve = getValueExpression("labelPosition"); 672 if (ve != null) { 673 try { 674 java.lang.String labelPosition = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 675 if (labelPosition != null) { 676 return labelPosition; 677 } 678 } catch (ELException e) { 679 throw new FacesException(e); 680 } 681 } 682 return "bottom"; 683 } 684 685 public void setLabelPosition(java.lang.String labelPosition) { 686 this.labelPosition = labelPosition; 687 } 688 689 /** 690 This attribute is for internal use only. 691 692 */ 693 public org.apache.myfaces.tobago.layout.Display getDisplay() { 694 if (display != null) { 695 return display; 696 } 697 ValueExpression ve = getValueExpression("display"); 698 if (ve != null) { 699 try { 700 return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext()); 701 } catch (ELException e) { 702 throw new FacesException(e); 703 } 704 } 705 return null; 706 } 707 708 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) { 709 this.display = display; 710 } 711 712 /** 713 This attribute is for internal use only. 714 715 */ 716 public org.apache.myfaces.tobago.layout.Measure getBorderBottom() { 717 if (borderBottom != null) { 718 return borderBottom; 719 } 720 ValueExpression ve = getValueExpression("borderBottom"); 721 if (ve != null) { 722 try { 723 Object object = ve.getValue(getFacesContext().getELContext()); 724 return Measure.valueOf(object); 725 } catch (ELException e) { 726 throw new FacesException(e); 727 } 728 } 729 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 730 getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this); 731 } 732 733 public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) { 734 this.borderBottom = borderBottom; 735 } 736 737 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() { 738 if (maximumWidth != null) { 739 return maximumWidth; 740 } 741 ValueExpression ve = getValueExpression("maximumWidth"); 742 if (ve != null) { 743 try { 744 Object object = ve.getValue(getFacesContext().getELContext()); 745 return Measure.valueOf(object); 746 } catch (ELException e) { 747 throw new FacesException(e); 748 } 749 } 750 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this); 751 } 752 753 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) { 754 this.maximumWidth = maximumWidth; 755 } 756 757 /** 758 This attribute is for internal use only. 759 760 */ 761 public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() { 762 if (paddingLeft != null) { 763 return paddingLeft; 764 } 765 ValueExpression ve = getValueExpression("paddingLeft"); 766 if (ve != null) { 767 try { 768 Object object = ve.getValue(getFacesContext().getELContext()); 769 return Measure.valueOf(object); 770 } catch (ELException e) { 771 throw new FacesException(e); 772 } 773 } 774 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 775 getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this); 776 } 777 778 public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) { 779 this.paddingLeft = paddingLeft; 780 } 781 782 /** 783 This attribute is for internal use only. 784 785 */ 786 public org.apache.myfaces.tobago.layout.Measure getPaddingRight() { 787 if (paddingRight != null) { 788 return paddingRight; 789 } 790 ValueExpression ve = getValueExpression("paddingRight"); 791 if (ve != null) { 792 try { 793 Object object = ve.getValue(getFacesContext().getELContext()); 794 return Measure.valueOf(object); 795 } catch (ELException e) { 796 throw new FacesException(e); 797 } 798 } 799 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 800 getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this); 801 } 802 803 public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) { 804 this.paddingRight = paddingRight; 805 } 806 807 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() { 808 if (preferredWidth != null) { 809 return preferredWidth; 810 } 811 ValueExpression ve = getValueExpression("preferredWidth"); 812 if (ve != null) { 813 try { 814 Object object = ve.getValue(getFacesContext().getELContext()); 815 return Measure.valueOf(object); 816 } catch (ELException e) { 817 throw new FacesException(e); 818 } 819 } 820 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this); 821 } 822 823 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) { 824 this.preferredWidth = preferredWidth; 825 } 826 827 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() { 828 if (marginBottom != null) { 829 return marginBottom; 830 } 831 ValueExpression ve = getValueExpression("marginBottom"); 832 if (ve != null) { 833 try { 834 Object object = ve.getValue(getFacesContext().getELContext()); 835 return Measure.valueOf(object); 836 } catch (ELException e) { 837 throw new FacesException(e); 838 } 839 } 840 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this); 841 } 842 843 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) { 844 this.marginBottom = marginBottom; 845 } 846 847 /** 848 Size of button images, possible values are: small, big, off. 849 <br />Default: <code>small</code><br />Allowed Values: <code>small,big,off</code> 850 */ 851 public java.lang.String getIconSize() { 852 if (iconSize != null) { 853 return iconSize; 854 } 855 ValueExpression ve = getValueExpression("iconSize"); 856 if (ve != null) { 857 try { 858 java.lang.String iconSize = (java.lang.String) ve.getValue(getFacesContext().getELContext()); 859 if (iconSize != null) { 860 return iconSize; 861 } 862 } catch (ELException e) { 863 throw new FacesException(e); 864 } 865 } 866 return "small"; 867 } 868 869 public void setIconSize(java.lang.String iconSize) { 870 this.iconSize = iconSize; 871 } 872 873 /** 874 This attribute is for internal use only. 875 876 */ 877 public java.lang.Integer getVerticalIndex() { 878 if (verticalIndex != null) { 879 return verticalIndex; 880 } 881 ValueExpression ve = getValueExpression("verticalIndex"); 882 if (ve != null) { 883 try { 884 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 885 if (number != null) { 886 return number.intValue(); 887 } 888 } catch (ELException e) { 889 throw new FacesException(e); 890 } 891 } 892 return null; 893 } 894 895 public void setVerticalIndex(java.lang.Integer verticalIndex) { 896 this.verticalIndex = verticalIndex; 897 } 898 899 /** 900 This attribute is for internal use only. 901 902 */ 903 public org.apache.myfaces.tobago.layout.Measure getBorderTop() { 904 if (borderTop != null) { 905 return borderTop; 906 } 907 ValueExpression ve = getValueExpression("borderTop"); 908 if (ve != null) { 909 try { 910 Object object = ve.getValue(getFacesContext().getELContext()); 911 return Measure.valueOf(object); 912 } catch (ELException e) { 913 throw new FacesException(e); 914 } 915 } 916 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer) 917 getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this); 918 } 919 920 public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) { 921 this.borderTop = borderTop; 922 } 923 924 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() { 925 if (currentMarkup != null) { 926 return currentMarkup; 927 } 928 return null; 929 } 930 931 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) { 932 this.currentMarkup = currentMarkup; 933 } 934 935 /** 936 This attribute is for internal use only. 937 938 */ 939 public java.lang.Integer getHorizontalIndex() { 940 if (horizontalIndex != null) { 941 return horizontalIndex; 942 } 943 ValueExpression ve = getValueExpression("horizontalIndex"); 944 if (ve != null) { 945 try { 946 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 947 if (number != null) { 948 return number.intValue(); 949 } 950 } catch (ELException e) { 951 throw new FacesException(e); 952 } 953 } 954 return null; 955 } 956 957 public void setHorizontalIndex(java.lang.Integer horizontalIndex) { 958 this.horizontalIndex = horizontalIndex; 959 } 960 961 public void restoreState(FacesContext context, Object componentState) { 962 Object[] values = (Object[]) componentState; 963 super.restoreState(context, values[0]); 964 markup = (org.apache.myfaces.tobago.context.Markup) values[1]; 965 marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2]; 966 minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[3]; 967 borderLeft = (org.apache.myfaces.tobago.layout.Measure) values[4]; 968 tip = (java.lang.String) values[5]; 969 height = (org.apache.myfaces.tobago.layout.Measure) values[6]; 970 minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[7]; 971 overflowX = (java.lang.Boolean) values[8]; 972 rowSpan = (java.lang.Integer) values[9]; 973 overflowY = (java.lang.Boolean) values[10]; 974 left = (org.apache.myfaces.tobago.layout.Measure) values[11]; 975 columnSpan = (java.lang.Integer) values[12]; 976 borderRight = (org.apache.myfaces.tobago.layout.Measure) values[13]; 977 paddingBottom = (org.apache.myfaces.tobago.layout.Measure) values[14]; 978 maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[15]; 979 top = (org.apache.myfaces.tobago.layout.Measure) values[16]; 980 orientation = (java.lang.String) values[17]; 981 currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[18]; 982 paddingTop = (org.apache.myfaces.tobago.layout.Measure) values[19]; 983 marginTop = (org.apache.myfaces.tobago.layout.Measure) values[20]; 984 marginRight = (org.apache.myfaces.tobago.layout.Measure) values[21]; 985 width = (org.apache.myfaces.tobago.layout.Measure) values[22]; 986 currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[23]; 987 preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[24]; 988 labelPosition = (java.lang.String) values[25]; 989 display = (org.apache.myfaces.tobago.layout.Display) values[26]; 990 borderBottom = (org.apache.myfaces.tobago.layout.Measure) values[27]; 991 maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[28]; 992 paddingLeft = (org.apache.myfaces.tobago.layout.Measure) values[29]; 993 paddingRight = (org.apache.myfaces.tobago.layout.Measure) values[30]; 994 preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[31]; 995 marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[32]; 996 iconSize = (java.lang.String) values[33]; 997 verticalIndex = (java.lang.Integer) values[34]; 998 borderTop = (org.apache.myfaces.tobago.layout.Measure) values[35]; 999 horizontalIndex = (java.lang.Integer) values[36]; 1000 } 1001 1002 public Object saveState(FacesContext context) { 1003 Object[] values = new Object[37]; 1004 values[0] = super.saveState(context); 1005 values[1] = markup; 1006 values[2] = marginLeft; 1007 values[3] = minimumHeight; 1008 values[4] = borderLeft; 1009 values[5] = tip; 1010 values[6] = height; 1011 values[7] = minimumWidth; 1012 values[8] = overflowX; 1013 values[9] = rowSpan; 1014 values[10] = overflowY; 1015 values[11] = left; 1016 values[12] = columnSpan; 1017 values[13] = borderRight; 1018 values[14] = paddingBottom; 1019 values[15] = maximumHeight; 1020 values[16] = top; 1021 values[17] = orientation; 1022 values[18] = currentWidth; 1023 values[19] = paddingTop; 1024 values[20] = marginTop; 1025 values[21] = marginRight; 1026 values[22] = width; 1027 values[23] = currentHeight; 1028 values[24] = preferredHeight; 1029 values[25] = labelPosition; 1030 values[26] = display; 1031 values[27] = borderBottom; 1032 values[28] = maximumWidth; 1033 values[29] = paddingLeft; 1034 values[30] = paddingRight; 1035 values[31] = preferredWidth; 1036 values[32] = marginBottom; 1037 values[33] = iconSize; 1038 values[34] = verticalIndex; 1039 values[35] = borderTop; 1040 values[36] = horizontalIndex; 1041 currentMarkup = null; 1042 return values; 1043 } 1044 1045 1046 }