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.AbstractUIToolBarCommand; 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 Renders a command button within a toolbar. 044 * UIComponent class, generated from template {@code component1.2.stg} with class 045 * {@link org.apache.myfaces.tobago.internal.taglib.component.ToolBarCommandTagDeclaration}. 046 */ 047 public class UIToolBarCommand 048 extends AbstractUIToolBarCommand implements SupportsMarkup { 049 050 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ToolBarCommand"; 051 052 private org.apache.myfaces.tobago.context.Markup markup; 053 private java.lang.Character accessKey; 054 private org.apache.myfaces.tobago.layout.Measure marginLeft; 055 private java.lang.String link; 056 private java.lang.String labelWithAccessKey; 057 private org.apache.myfaces.tobago.layout.Measure minimumHeight; 058 private java.lang.String tip; 059 private org.apache.myfaces.tobago.layout.Measure height; 060 private org.apache.myfaces.tobago.layout.Measure minimumWidth; 061 private java.lang.Integer rowSpan; 062 private org.apache.myfaces.tobago.layout.Measure left; 063 private java.lang.Integer columnSpan; 064 private org.apache.myfaces.tobago.layout.Measure top; 065 private org.apache.myfaces.tobago.layout.Measure maximumHeight; 066 private org.apache.myfaces.tobago.layout.Measure currentWidth; 067 private org.apache.myfaces.tobago.layout.Measure marginTop; 068 private org.apache.myfaces.tobago.layout.Measure width; 069 private org.apache.myfaces.tobago.layout.Measure marginRight; 070 private org.apache.myfaces.tobago.layout.Measure preferredHeight; 071 private java.lang.String resource; 072 private java.lang.Boolean jsfResource; 073 private org.apache.myfaces.tobago.layout.Measure currentHeight; 074 private java.lang.Boolean transition; 075 private java.lang.String image; 076 private java.lang.String label; 077 private org.apache.myfaces.tobago.layout.Display display; 078 private org.apache.myfaces.tobago.layout.Measure maximumWidth; 079 private org.apache.myfaces.tobago.layout.Measure preferredWidth; 080 private java.lang.Boolean immediate; 081 private org.apache.myfaces.tobago.layout.Measure marginBottom; 082 private java.lang.Integer verticalIndex; 083 private org.apache.myfaces.tobago.context.Markup currentMarkup; 084 private java.lang.String[] renderedPartially; 085 private java.lang.String target; 086 private java.lang.String onclick; 087 private java.lang.Integer horizontalIndex; 088 private java.lang.Boolean disabled; 089 090 091 public org.apache.myfaces.tobago.context.Markup getMarkup() { 092 if (markup != null) { 093 return markup; 094 } 095 ValueExpression ve = getValueExpression("markup"); 096 if (ve != null) { 097 try { 098 Object object = ve.getValue(getFacesContext().getELContext()); 099 return Markup.valueOf(object); 100 } catch (ELException e) { 101 throw new FacesException(e); 102 } 103 } 104 return null; 105 } 106 107 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) { 108 this.markup = markup; 109 } 110 111 /** 112 Deprecated! Has not longer any function. 113 114 @deprecated*/ 115 @Deprecated 116 public java.lang.Character getAccessKey() { 117 if (accessKey != null) { 118 return accessKey; 119 } 120 ValueExpression ve = getValueExpression("accessKey"); 121 if (ve != null) { 122 try { 123 return (java.lang.Character) ve.getValue(getFacesContext().getELContext()); 124 } catch (ELException e) { 125 throw new FacesException(e); 126 } 127 } 128 return null; 129 } 130 131 @Deprecated 132 public void setAccessKey(java.lang.Character accessKey) { 133 this.accessKey = accessKey; 134 } 135 136 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() { 137 if (marginLeft != null) { 138 return marginLeft; 139 } 140 ValueExpression ve = getValueExpression("marginLeft"); 141 if (ve != null) { 142 try { 143 Object object = ve.getValue(getFacesContext().getELContext()); 144 return Measure.valueOf(object); 145 } catch (ELException e) { 146 throw new FacesException(e); 147 } 148 } 149 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this); 150 } 151 152 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) { 153 this.marginLeft = marginLeft; 154 } 155 156 /** 157 Link to an arbitrary URL, either an internal link or an external link. 158 159 <dl> 160 <dt>internal absolute link</dt> 161 <dd>Starts with a slash '/' character. The context path will be added. 162 A session id will be added, if needed.</dd> 163 <dt>external link</dt> 164 <dd>Contains a colon ':' character. 165 The link will not be modified.</dd> 166 <dt>internal relative link</dt> 167 <dd>Any other strings. A session id will be added, if needed.</dd> 168 </dl> 169 170 */ 171 public java.lang.String getLink() { 172 if (link != null) { 173 return link; 174 } 175 ValueExpression ve = getValueExpression("link"); 176 if (ve != null) { 177 try { 178 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 179 } catch (ELException e) { 180 throw new FacesException(e); 181 } 182 } 183 return null; 184 } 185 186 public void setLink(java.lang.String link) { 187 this.link = link; 188 } 189 190 /** 191 Deprecated! Use 'label' instead. 192 Text value to display as label. 193 If text contains an underscore the next character overwrites 'accesskey'. 194 195 @deprecated*/ 196 @Deprecated 197 public java.lang.String getLabelWithAccessKey() { 198 if (labelWithAccessKey != null) { 199 return labelWithAccessKey; 200 } 201 ValueExpression ve = getValueExpression("labelWithAccessKey"); 202 if (ve != null) { 203 try { 204 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 205 } catch (ELException e) { 206 throw new FacesException(e); 207 } 208 } 209 return null; 210 } 211 212 @Deprecated 213 public void setLabelWithAccessKey(java.lang.String labelWithAccessKey) { 214 this.labelWithAccessKey = labelWithAccessKey; 215 } 216 217 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() { 218 if (minimumHeight != null) { 219 return minimumHeight; 220 } 221 ValueExpression ve = getValueExpression("minimumHeight"); 222 if (ve != null) { 223 try { 224 Object object = ve.getValue(getFacesContext().getELContext()); 225 return Measure.valueOf(object); 226 } catch (ELException e) { 227 throw new FacesException(e); 228 } 229 } 230 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this); 231 } 232 233 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) { 234 this.minimumHeight = minimumHeight; 235 } 236 237 /** 238 Text value to display as tooltip. 239 240 */ 241 public java.lang.String getTip() { 242 if (tip != null) { 243 return tip; 244 } 245 ValueExpression ve = getValueExpression("tip"); 246 if (ve != null) { 247 try { 248 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 249 } catch (ELException e) { 250 throw new FacesException(e); 251 } 252 } 253 return null; 254 } 255 256 public void setTip(java.lang.String tip) { 257 this.tip = tip; 258 } 259 260 /** 261 This value will usually be set by the layout manager. 262 263 */ 264 public org.apache.myfaces.tobago.layout.Measure getHeight() { 265 if (height != null) { 266 return height; 267 } 268 ValueExpression ve = getValueExpression("height"); 269 if (ve != null) { 270 try { 271 Object object = ve.getValue(getFacesContext().getELContext()); 272 return Measure.valueOf(object); 273 } catch (ELException e) { 274 throw new FacesException(e); 275 } 276 } 277 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this); 278 } 279 280 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) { 281 this.height = height; 282 } 283 284 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() { 285 if (minimumWidth != null) { 286 return minimumWidth; 287 } 288 ValueExpression ve = getValueExpression("minimumWidth"); 289 if (ve != null) { 290 try { 291 Object object = ve.getValue(getFacesContext().getELContext()); 292 return Measure.valueOf(object); 293 } catch (ELException e) { 294 throw new FacesException(e); 295 } 296 } 297 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this); 298 } 299 300 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) { 301 this.minimumWidth = minimumWidth; 302 } 303 304 public java.lang.Integer getRowSpan() { 305 if (rowSpan != null) { 306 return rowSpan; 307 } 308 ValueExpression ve = getValueExpression("rowSpan"); 309 if (ve != null) { 310 try { 311 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 312 if (number != null) { 313 return number.intValue(); 314 } 315 } catch (ELException e) { 316 throw new FacesException(e); 317 } 318 } 319 return 1; 320 } 321 322 public void setRowSpan(java.lang.Integer rowSpan) { 323 this.rowSpan = rowSpan; 324 } 325 326 /** 327 This value will usually be set by the layout manager. 328 329 */ 330 public org.apache.myfaces.tobago.layout.Measure getLeft() { 331 if (left != null) { 332 return left; 333 } 334 ValueExpression ve = getValueExpression("left"); 335 if (ve != null) { 336 try { 337 Object object = ve.getValue(getFacesContext().getELContext()); 338 return Measure.valueOf(object); 339 } catch (ELException e) { 340 throw new FacesException(e); 341 } 342 } 343 return null; 344 } 345 346 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) { 347 this.left = left; 348 } 349 350 public java.lang.Integer getColumnSpan() { 351 if (columnSpan != null) { 352 return columnSpan; 353 } 354 ValueExpression ve = getValueExpression("columnSpan"); 355 if (ve != null) { 356 try { 357 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 358 if (number != null) { 359 return number.intValue(); 360 } 361 } catch (ELException e) { 362 throw new FacesException(e); 363 } 364 } 365 return 1; 366 } 367 368 public void setColumnSpan(java.lang.Integer columnSpan) { 369 this.columnSpan = columnSpan; 370 } 371 372 /** 373 This value will usually be set by the layout manager. 374 375 */ 376 public org.apache.myfaces.tobago.layout.Measure getTop() { 377 if (top != null) { 378 return top; 379 } 380 ValueExpression ve = getValueExpression("top"); 381 if (ve != null) { 382 try { 383 Object object = ve.getValue(getFacesContext().getELContext()); 384 return Measure.valueOf(object); 385 } catch (ELException e) { 386 throw new FacesException(e); 387 } 388 } 389 return null; 390 } 391 392 public void setTop(org.apache.myfaces.tobago.layout.Measure top) { 393 this.top = top; 394 } 395 396 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() { 397 if (maximumHeight != null) { 398 return maximumHeight; 399 } 400 ValueExpression ve = getValueExpression("maximumHeight"); 401 if (ve != null) { 402 try { 403 Object object = ve.getValue(getFacesContext().getELContext()); 404 return Measure.valueOf(object); 405 } catch (ELException e) { 406 throw new FacesException(e); 407 } 408 } 409 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this); 410 } 411 412 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) { 413 this.maximumHeight = maximumHeight; 414 } 415 416 /** 417 This value will usually be set by the layout manager. It holds the current width computed by the layout manager. 418 419 */ 420 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() { 421 if (currentWidth != null) { 422 return currentWidth; 423 } 424 ValueExpression ve = getValueExpression("currentWidth"); 425 if (ve != null) { 426 try { 427 Object object = ve.getValue(getFacesContext().getELContext()); 428 return Measure.valueOf(object); 429 } catch (ELException e) { 430 throw new FacesException(e); 431 } 432 } 433 return getWidth(); 434 } 435 436 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) { 437 this.currentWidth = currentWidth; 438 } 439 440 public org.apache.myfaces.tobago.layout.Measure getMarginTop() { 441 if (marginTop != null) { 442 return marginTop; 443 } 444 ValueExpression ve = getValueExpression("marginTop"); 445 if (ve != null) { 446 try { 447 Object object = ve.getValue(getFacesContext().getELContext()); 448 return Measure.valueOf(object); 449 } catch (ELException e) { 450 throw new FacesException(e); 451 } 452 } 453 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this); 454 } 455 456 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) { 457 this.marginTop = marginTop; 458 } 459 460 /** 461 This value will usually be set by the layout manager. 462 463 */ 464 public org.apache.myfaces.tobago.layout.Measure getWidth() { 465 if (width != null) { 466 return width; 467 } 468 ValueExpression ve = getValueExpression("width"); 469 if (ve != null) { 470 try { 471 Object object = ve.getValue(getFacesContext().getELContext()); 472 return Measure.valueOf(object); 473 } catch (ELException e) { 474 throw new FacesException(e); 475 } 476 } 477 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this); 478 } 479 480 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) { 481 this.width = width; 482 } 483 484 public org.apache.myfaces.tobago.layout.Measure getMarginRight() { 485 if (marginRight != null) { 486 return marginRight; 487 } 488 ValueExpression ve = getValueExpression("marginRight"); 489 if (ve != null) { 490 try { 491 Object object = ve.getValue(getFacesContext().getELContext()); 492 return Measure.valueOf(object); 493 } catch (ELException e) { 494 throw new FacesException(e); 495 } 496 } 497 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this); 498 } 499 500 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) { 501 this.marginRight = marginRight; 502 } 503 504 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() { 505 if (preferredHeight != null) { 506 return preferredHeight; 507 } 508 ValueExpression ve = getValueExpression("preferredHeight"); 509 if (ve != null) { 510 try { 511 Object object = ve.getValue(getFacesContext().getELContext()); 512 return Measure.valueOf(object); 513 } catch (ELException e) { 514 throw new FacesException(e); 515 } 516 } 517 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this); 518 } 519 520 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) { 521 this.preferredHeight = preferredHeight; 522 } 523 524 /** 525 Link to an internal resource. 526 Resources will be processed by the resource management. 527 E. g. define help.html and it will be served help_es.html or help_de.html if available. 528 For JSF-Pages you have to set the jsfResource attribute. 529 530 */ 531 public java.lang.String getResource() { 532 if (resource != null) { 533 return resource; 534 } 535 ValueExpression ve = getValueExpression("resource"); 536 if (ve != null) { 537 try { 538 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 539 } catch (ELException e) { 540 throw new FacesException(e); 541 } 542 } 543 return null; 544 } 545 546 public void setResource(java.lang.String resource) { 547 this.resource = resource; 548 } 549 550 /** 551 Flag indicating that the resource referenced by the resource attribute is a jsf resource. 552 That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or 553 /faces/*). Default is false. 554 <br />Default: <code>false</code> 555 */ 556 public boolean isJsfResource() { 557 if (jsfResource != null) { 558 return jsfResource; 559 } 560 ValueExpression ve = getValueExpression("jsfResource"); 561 if (ve != null) { 562 try { 563 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 564 if (bool != null) { 565 return bool; 566 } 567 } catch (ELException e) { 568 throw new FacesException(e); 569 } 570 } 571 return false; 572 } 573 574 public void setJsfResource(boolean jsfResource) { 575 this.jsfResource = jsfResource; 576 } 577 578 /** 579 This value will usually be set by the layout manager. It holds the current height computed by the layout manager. 580 581 */ 582 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() { 583 if (currentHeight != null) { 584 return currentHeight; 585 } 586 ValueExpression ve = getValueExpression("currentHeight"); 587 if (ve != null) { 588 try { 589 Object object = ve.getValue(getFacesContext().getELContext()); 590 return Measure.valueOf(object); 591 } catch (ELException e) { 592 throw new FacesException(e); 593 } 594 } 595 return getHeight(); 596 } 597 598 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) { 599 this.currentHeight = currentHeight; 600 } 601 602 /** 603 Specify, if the command calls an JSF-Action. 604 Useful to switch off the Double-Submit-Check and Waiting-Behavior. 605 <br />Default: <code>true</code> 606 */ 607 public boolean isTransition() { 608 if (transition != null) { 609 return transition; 610 } 611 ValueExpression ve = getValueExpression("transition"); 612 if (ve != null) { 613 try { 614 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 615 if (bool != null) { 616 return bool; 617 } 618 } catch (ELException e) { 619 throw new FacesException(e); 620 } 621 } 622 return true; 623 } 624 625 public void setTransition(boolean transition) { 626 this.transition = transition; 627 } 628 629 /** 630 Url to an image to display. 631 632 */ 633 public java.lang.String getImage() { 634 if (image != null) { 635 return image; 636 } 637 ValueExpression ve = getValueExpression("image"); 638 if (ve != null) { 639 try { 640 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 641 } catch (ELException e) { 642 throw new FacesException(e); 643 } 644 } 645 return null; 646 } 647 648 public void setImage(java.lang.String image) { 649 this.image = image; 650 } 651 652 /** 653 Text value to display as label. 654 If text contains an underscore the next character is used as accesskey. 655 656 */ 657 public java.lang.String getLabel() { 658 if (label != null) { 659 return label; 660 } 661 ValueExpression ve = getValueExpression("label"); 662 if (ve != null) { 663 try { 664 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 665 } catch (ELException e) { 666 throw new FacesException(e); 667 } 668 } 669 return null; 670 } 671 672 public void setLabel(java.lang.String label) { 673 this.label = label; 674 } 675 676 /** 677 This attribute is for internal use only. 678 679 */ 680 public org.apache.myfaces.tobago.layout.Display getDisplay() { 681 if (display != null) { 682 return display; 683 } 684 ValueExpression ve = getValueExpression("display"); 685 if (ve != null) { 686 try { 687 return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext()); 688 } catch (ELException e) { 689 throw new FacesException(e); 690 } 691 } 692 return null; 693 } 694 695 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) { 696 this.display = display; 697 } 698 699 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() { 700 if (maximumWidth != null) { 701 return maximumWidth; 702 } 703 ValueExpression ve = getValueExpression("maximumWidth"); 704 if (ve != null) { 705 try { 706 Object object = ve.getValue(getFacesContext().getELContext()); 707 return Measure.valueOf(object); 708 } catch (ELException e) { 709 throw new FacesException(e); 710 } 711 } 712 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this); 713 } 714 715 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) { 716 this.maximumWidth = maximumWidth; 717 } 718 719 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() { 720 if (preferredWidth != null) { 721 return preferredWidth; 722 } 723 ValueExpression ve = getValueExpression("preferredWidth"); 724 if (ve != null) { 725 try { 726 Object object = ve.getValue(getFacesContext().getELContext()); 727 return Measure.valueOf(object); 728 } catch (ELException e) { 729 throw new FacesException(e); 730 } 731 } 732 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this); 733 } 734 735 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) { 736 this.preferredWidth = preferredWidth; 737 } 738 739 /** 740 Flag indicating that, if this component is activated by the user, 741 notifications should be delivered to interested listeners and actions 742 immediately (that is, during Apply Request Values phase) rather than 743 waiting until Invoke Application phase. 744 <br />Default: <code>false</code> 745 */ 746 public boolean isImmediate() { 747 if (immediate != null) { 748 return immediate; 749 } 750 ValueExpression ve = getValueExpression("immediate"); 751 if (ve != null) { 752 try { 753 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 754 if (bool != null) { 755 return bool; 756 } 757 } catch (ELException e) { 758 throw new FacesException(e); 759 } 760 } 761 return false; 762 } 763 764 public void setImmediate(boolean immediate) { 765 this.immediate = immediate; 766 } 767 768 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() { 769 if (marginBottom != null) { 770 return marginBottom; 771 } 772 ValueExpression ve = getValueExpression("marginBottom"); 773 if (ve != null) { 774 try { 775 Object object = ve.getValue(getFacesContext().getELContext()); 776 return Measure.valueOf(object); 777 } catch (ELException e) { 778 throw new FacesException(e); 779 } 780 } 781 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this); 782 } 783 784 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) { 785 this.marginBottom = marginBottom; 786 } 787 788 /** 789 This attribute is for internal use only. 790 791 */ 792 public java.lang.Integer getVerticalIndex() { 793 if (verticalIndex != null) { 794 return verticalIndex; 795 } 796 ValueExpression ve = getValueExpression("verticalIndex"); 797 if (ve != null) { 798 try { 799 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 800 if (number != null) { 801 return number.intValue(); 802 } 803 } catch (ELException e) { 804 throw new FacesException(e); 805 } 806 } 807 return null; 808 } 809 810 public void setVerticalIndex(java.lang.Integer verticalIndex) { 811 this.verticalIndex = verticalIndex; 812 } 813 814 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() { 815 if (currentMarkup != null) { 816 return currentMarkup; 817 } 818 ValueExpression ve = getValueExpression("currentMarkup"); 819 if (ve != null) { 820 try { 821 Object object = ve.getValue(getFacesContext().getELContext()); 822 return Markup.valueOf(object); 823 } catch (ELException e) { 824 throw new FacesException(e); 825 } 826 } 827 return null; 828 } 829 830 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) { 831 this.currentMarkup = currentMarkup; 832 } 833 834 /** 835 Indicate the partially rendered Components in a case of a submit. 836 837 */ 838 public String[] getRenderedPartially() { 839 if (renderedPartially != null) { 840 return renderedPartially; 841 } 842 ValueExpression ve = getValueExpression("renderedPartially"); 843 if (ve != null) { 844 try { 845 Object strArray = ve.getValue(getFacesContext().getELContext()); 846 if (strArray instanceof String[]) { 847 return (String[]) strArray; 848 } else if (strArray instanceof String) { 849 String[] strings = StringUtils.split((String) strArray, ", "); 850 List<String> result = new ArrayList<String>(strings.length); 851 for (String string : strings) { 852 if (string.trim().length() != 0) { 853 result.add(string.trim()); 854 } 855 } 856 return result.toArray(new String[result.size()]); 857 } else if (strArray == null) { 858 return ArrayUtils.EMPTY_STRING_ARRAY; 859 } else { 860 return new String[]{strArray.toString()}; 861 } 862 } catch (ELException e) { 863 throw new FacesException(e); 864 } 865 } 866 return ArrayUtils.EMPTY_STRING_ARRAY; 867 } 868 869 public void setRenderedPartially(String[] renderedPartially) { 870 this.renderedPartially = renderedPartially; 871 } 872 873 /** 874 Name of a frame where the resource retrieved via this hyperlink is to be 875 displayed. 876 877 */ 878 public java.lang.String getTarget() { 879 if (target != null) { 880 return target; 881 } 882 ValueExpression ve = getValueExpression("target"); 883 if (ve != null) { 884 try { 885 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 886 } catch (ELException e) { 887 throw new FacesException(e); 888 } 889 } 890 return null; 891 } 892 893 public void setTarget(java.lang.String target) { 894 this.target = target; 895 } 896 897 /** 898 Script to be invoked when clicked 899 900 */ 901 public java.lang.String getOnclick() { 902 if (onclick != null) { 903 return onclick; 904 } 905 ValueExpression ve = getValueExpression("onclick"); 906 if (ve != null) { 907 try { 908 return (java.lang.String) ve.getValue(getFacesContext().getELContext()); 909 } catch (ELException e) { 910 throw new FacesException(e); 911 } 912 } 913 return null; 914 } 915 916 public void setOnclick(java.lang.String onclick) { 917 this.onclick = onclick; 918 } 919 920 /** 921 This attribute is for internal use only. 922 923 */ 924 public java.lang.Integer getHorizontalIndex() { 925 if (horizontalIndex != null) { 926 return horizontalIndex; 927 } 928 ValueExpression ve = getValueExpression("horizontalIndex"); 929 if (ve != null) { 930 try { 931 Number number = (Number) ve.getValue(getFacesContext().getELContext()); 932 if (number != null) { 933 return number.intValue(); 934 } 935 } catch (ELException e) { 936 throw new FacesException(e); 937 } 938 } 939 return null; 940 } 941 942 public void setHorizontalIndex(java.lang.Integer horizontalIndex) { 943 this.horizontalIndex = horizontalIndex; 944 } 945 946 /** 947 Flag indicating that this element is disabled. 948 <br />Default: <code>false</code> 949 */ 950 public boolean isDisabled() { 951 if (disabled != null) { 952 return disabled; 953 } 954 ValueExpression ve = getValueExpression("disabled"); 955 if (ve != null) { 956 try { 957 Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext()); 958 if (bool != null) { 959 return bool; 960 } 961 } catch (ELException e) { 962 throw new FacesException(e); 963 } 964 } 965 return false; 966 } 967 968 public void setDisabled(boolean disabled) { 969 this.disabled = disabled; 970 } 971 972 public void restoreState(FacesContext context, Object componentState) { 973 Object[] values = (Object[]) componentState; 974 super.restoreState(context, values[0]); 975 markup = (org.apache.myfaces.tobago.context.Markup) values[1]; 976 accessKey = (java.lang.Character) values[2]; 977 marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[3]; 978 link = (java.lang.String) values[4]; 979 labelWithAccessKey = (java.lang.String) values[5]; 980 minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[6]; 981 tip = (java.lang.String) values[7]; 982 height = (org.apache.myfaces.tobago.layout.Measure) values[8]; 983 minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[9]; 984 rowSpan = (java.lang.Integer) values[10]; 985 left = (org.apache.myfaces.tobago.layout.Measure) values[11]; 986 columnSpan = (java.lang.Integer) values[12]; 987 top = (org.apache.myfaces.tobago.layout.Measure) values[13]; 988 maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[14]; 989 currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[15]; 990 marginTop = (org.apache.myfaces.tobago.layout.Measure) values[16]; 991 width = (org.apache.myfaces.tobago.layout.Measure) values[17]; 992 marginRight = (org.apache.myfaces.tobago.layout.Measure) values[18]; 993 preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[19]; 994 resource = (java.lang.String) values[20]; 995 jsfResource = (java.lang.Boolean) values[21]; 996 currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[22]; 997 transition = (java.lang.Boolean) values[23]; 998 image = (java.lang.String) values[24]; 999 label = (java.lang.String) values[25]; 1000 display = (org.apache.myfaces.tobago.layout.Display) values[26]; 1001 maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[27]; 1002 preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[28]; 1003 immediate = (java.lang.Boolean) values[29]; 1004 marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[30]; 1005 verticalIndex = (java.lang.Integer) values[31]; 1006 currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[32]; 1007 renderedPartially = (java.lang.String[]) values[33]; 1008 target = (java.lang.String) values[34]; 1009 onclick = (java.lang.String) values[35]; 1010 horizontalIndex = (java.lang.Integer) values[36]; 1011 disabled = (java.lang.Boolean) values[37]; 1012 } 1013 1014 public Object saveState(FacesContext context) { 1015 Object[] values = new Object[38]; 1016 values[0] = super.saveState(context); 1017 values[1] = markup; 1018 values[2] = accessKey; 1019 values[3] = marginLeft; 1020 values[4] = link; 1021 values[5] = labelWithAccessKey; 1022 values[6] = minimumHeight; 1023 values[7] = tip; 1024 values[8] = height; 1025 values[9] = minimumWidth; 1026 values[10] = rowSpan; 1027 values[11] = left; 1028 values[12] = columnSpan; 1029 values[13] = top; 1030 values[14] = maximumHeight; 1031 values[15] = currentWidth; 1032 values[16] = marginTop; 1033 values[17] = width; 1034 values[18] = marginRight; 1035 values[19] = preferredHeight; 1036 values[20] = resource; 1037 values[21] = jsfResource; 1038 values[22] = currentHeight; 1039 values[23] = transition; 1040 values[24] = image; 1041 values[25] = label; 1042 values[26] = display; 1043 values[27] = maximumWidth; 1044 values[28] = preferredWidth; 1045 values[29] = immediate; 1046 values[30] = marginBottom; 1047 values[31] = verticalIndex; 1048 values[32] = currentMarkup; 1049 values[33] = renderedPartially; 1050 values[34] = target; 1051 values[35] = onclick; 1052 values[36] = horizontalIndex; 1053 values[37] = disabled; 1054 return values; 1055 } 1056 1057 1058 }