1//////////////////////////////////////////////////////////////////////////////// 2// 3// ADOBE SYSTEMS INCORPORATED 4// Copyright 2009 Adobe Systems Incorporated 5// All Rights Reserved. 6// 7// NOTICE: Adobe permits you to use, modify, and distribute this file 8// in accordance with the terms of the license agreement accompanying it. 9// 10//////////////////////////////////////////////////////////////////////////////// 11 12package mx.core 13{ 14 15import flash.display.DisplayObject; 16import flash.display.DisplayObjectContainer; 17import flash.display.Sprite; 18import flash.events.Event; 19import flash.geom.Matrix; 20import flash.text.TextFieldAutoSize; 21import flash.text.TextFieldType; 22import flash.text.TextFormat; 23import flash.text.TextFormatAlign; 24import flash.text.TextLineMetrics; 25 26import flashx.textLayout.elements.GlobalSettings; 27 28import mx.automation.IAutomationObject; 29import mx.managers.ISystemManager; 30import mx.managers.IToolTipManagerClient; 31import mx.managers.SystemManager; 32import mx.managers.ToolTipManager; 33import mx.resources.IResourceManager; 34import mx.resources.ResourceManager; 35import mx.styles.ISimpleStyleClient; 36import mx.styles.IStyleClient; 37import mx.styles.IStyleManager2; 38import mx.styles.StyleManager; 39import mx.styles.StyleProtoChain; 40import mx.utils.NameUtil; 41import mx.utils.StringUtil; 42 43import spark.utils.TextUtil; 44 45use namespace mx_internal; 46 47//include "../styles/metadata/LeadingStyle.as" 48//include "../styles/metadata/PaddingStyles.as" 49//include "../styles/metadata/TextStyles.as" 50 51[ResourceBundle("core")] 52 53/** 54 * The UIFTETextField class is an alternative to the UITextField class 55 * for displaying text in MX components. 56 * 57 * <p>UIFTETextField extends FTETextField in the same way 58 * that UITextField extends TextField. 59 * By extending FTETextField, it makes it possible 60 * for MX components to use the Flash Text Engine. 61 * Benefits of using FTE over TextField include 62 * higher-quality typography, bidirectional text, and rotatable text.</p> 63 * 64 * <p>When MX components use FTE, they can use the same 65 * embedded fonts as Spark components, which always use FTE. 66 * Otherwise, a font must be embedded with <code>embedAsCFF="false"</code> 67 * for use by TextField-based components, and with 68 * <code>embedAsCFF="true"</code> for use by FTE-based components.</p> 69 * 70 * <p>MX components that display text use the <code>textFieldClass</code> 71 * style to determine whether to create instances 72 * of UITextField or UIFTETextField. 73 * They are able to use either class because both classes implement 74 * the IUITextField interface.</p> 75 * 76 * <p>Warning: if UIFTETextField inherits <code>layoutDirection="rtl"</code>, it 77 * will modify its own <code>transform.matrix</code> to restore the default 78 * coordinate system locally.</p> 79 * 80 * @see mx.core.UITextField 81 * @see mx.core.FTETextField 82 * 83 * @langversion 3.0 84 * @playerversion Flash 10 85 * @playerversion AIR 1.5 86 * @productversion Flex 4 87 */ 88public class UIFTETextField extends FTETextField 89 implements IAutomationObject, IIMESupport, 90 IFlexModule, 91 IInvalidating, ISimpleStyleClient, 92 IToolTipManagerClient, IUITextField 93 94{ 95 include "../../spark/core/Version.as"; 96 97 //-------------------------------------------------------------------------- 98 // 99 // Implementation notes 100 // 101 //-------------------------------------------------------------------------- 102 103 /* 104 105 UITextField extends the Player's TextField class, 106 so here are some notes about TextField. 107 108 The property values of a new TextField are as follows: 109 110 alwaysShowSelection = false 111 autoSize = TextFieldAutoSize.NONE 112 background = false 113 backgroundColor = 0xFFFFFF 114 border = false 115 borderColor = 0x000000 116 caretIndex = 0 117 condenseWhite = false 118 displayAsPassword = false 119 embedFonts = false 120 height = 100 121 htmlText = "" 122 length = 0 123 maxChars = 0 124 mouseWheelEnabled = true 125 multiline = false 126 numLines = 1 127 restrict = null 128 selectable = true 129 selectionBeginIndex = 0 130 selectionEndIndex = 0 131 text = "" 132 textColor = 0x000000 133 textHeight = 0 134 textWidth = 0 135 type = TextFieldType.DYNAMIC 136 width = 100 137 wordWrap = false 138 139 Many of these properties are coupled. 140 For example, setting 'text' affects 'htmlText', 'length', 141 'textWidth', and 'textHeight'. 142 If 'autoSize' isn't "none", it also affects 'width' and 'height'. 143 144 The 'htmlText' getter and setter aren't symmetrical; 145 if you set it and then get it, you don't get what you just set; 146 you'll get additional HTML markup corresponding to the 147 defaultTextFormat. 148 149 If you set both the 'text' and the 'htmlText' properties 150 of a TextField, the last one set wins. 151 152 These setters do a lot of work; for example, suppose you set the 'text'. 153 If it is an autosizing TextField, it computes the new width and height. 154 If it is a wordwrapping TextField, it computes the appropriate line 155 breaks. 156 157 If you then get the 'text' property, it is what you just set. 158 If you get the 'length', it is the length of the 'text' string. 159 If you get the 'htmlText', it will contain a lot of autogenerated 160 HTML markup corresponding to the defaultTextFormat, which was applied 161 as a run across the entire new text. 162 163 Now suppose you set the 'htmlText' property. 164 The Player parses the string, separating the text characters 165 from the markup. 166 It first applies the defaultTextFormat as a run across the entire new 167 text; it then uses the markup to modify this TextFormat or create 168 additional TextFormat runs. 169 When it's done it discards the 'htmlText' string that you set. 170 171 If you then get the 'htmlText', it will not be what you just set; it 172 will contain additional HTML markup corresponding to defaultTextFormat 173 If you get the 'text', it will be text characters in the 'htmlText', 174 without any of the HTML markup. 175 If you get the 'length', it is the length of the 'text' string. 176 177 If you set a TextFormat run with setTextFormat(), it will change the 178 runs created from the HTML markup in the 'htmlText' that was last set. 179 This is why, in the validateNow() method in UITextField, the original 180 'htmlText' is reapplied after the TextFormat is changed. 181 182 The 'condenseWhite' property only applies when setting 'htmlText', 183 not 'text'. 184 Changing 'condenseWhite' after setting 'htmlText' doesn't affect 185 anything except future settings of 'htmlText'. 186 187 The width and height of the TextField are 4 pixels greater than 188 the textWidth and textHeight. 189 190 */ 191 192 //-------------------------------------------------------------------------- 193 // 194 // Class constants 195 // 196 //-------------------------------------------------------------------------- 197 198 /** 199 * @private 200 * The padding to be added to textWidth to get the width 201 * of a TextField that can display the text without clipping. 202 */ 203 mx_internal static const TEXT_WIDTH_PADDING:int = 5; 204 205 /** 206 * @private 207 * The padding to be added to textHeight to get the height 208 * of a TextField that can display the text without clipping. 209 */ 210 mx_internal static const TEXT_HEIGHT_PADDING:int = 4; 211 212 //-------------------------------------------------------------------------- 213 // 214 // Class variables 215 // 216 //-------------------------------------------------------------------------- 217 218 /** 219 * @private 220 * Most resources are fetched on the fly from the ResourceManager, 221 * so they automatically get the right resource when the locale changes. 222 * But since truncateToFit() can be called frequently, 223 * this class caches this resource value in this variable 224 * and updates it when the locale changes. 225 */ 226 private static var truncationIndicatorResource:String; 227 228 /** 229 * @private 230 */ 231 mx_internal static var debuggingBorders:Boolean = false; 232 233 //-------------------------------------------------------------------------- 234 // 235 // Class properties 236 // 237 //-------------------------------------------------------------------------- 238 239 //---------------------------------- 240 // embeddedFontRegistry 241 //---------------------------------- 242 243 private static var noEmbeddedFonts:Boolean; 244 245 /** 246 * @private 247 * Storage for the _embeddedFontRegistry property. 248 * Note: This gets initialized on first access, 249 * not when this class is initialized, in order to ensure 250 * that the Singleton registry has already been initialized. 251 */ 252 private static var _embeddedFontRegistry:IEmbeddedFontRegistry; 253 254 /** 255 * @private 256 * A reference to the embedded font registry. 257 * Single registry in the system. 258 * Used to look up the moduleFactory of a font. 259 */ 260 private static function get embeddedFontRegistry():IEmbeddedFontRegistry 261 { 262 if (!_embeddedFontRegistry && !noEmbeddedFonts) 263 { 264 try 265 { 266 _embeddedFontRegistry = IEmbeddedFontRegistry( 267 Singleton.getInstance("mx.core::IEmbeddedFontRegistry")); 268 } 269 catch (e:Error) 270 { 271 noEmbeddedFonts = true; 272 } 273 } 274 275 return _embeddedFontRegistry; 276 } 277 278 //-------------------------------------------------------------------------- 279 // 280 // Constructor 281 // 282 //-------------------------------------------------------------------------- 283 284 /** 285 * Constructor. 286 * 287 * @langversion 3.0 288 * @playerversion Flash 10 289 * @playerversion AIR 1.5 290 * @productversion Flex 4 291 */ 292 public function UIFTETextField() 293 { 294 super(); 295 296 /** 297 * Set the TLF hook used for localizing runtime error messages. 298 * TLF itself has English-only messages, 299 * but higher layers like Flex can provide localized versions. 300 */ 301 GlobalSettings.resourceStringFunction = TextUtil.getResourceString; 302 303 // Although a TextField's 'text' is initially "", 304 // getLineMetrics() will return bad values until some text is set. 305 super.text = ""; 306 307 focusRect = false; 308 selectable = false; 309 tabEnabled = false; 310 311 if (debuggingBorders) 312 border = true; 313 314 if (!truncationIndicatorResource) 315 { 316 truncationIndicatorResource = resourceManager.getString( 317 "core", "truncationIndicator"); 318 } 319 320 addEventListener(Event.CHANGE, changeHandler); 321 addEventListener("textFieldStyleChange", textFieldStyleChangeHandler); 322 323 // Register as a weak listener for "change" events from ResourceManager. 324 // If UITextFields registered as a strong listener, 325 // they wouldn't get garbage collected. 326 resourceManager.addEventListener( 327 Event.CHANGE, resourceManager_changeHandler, false, 0, true); 328 } 329 330 //-------------------------------------------------------------------------- 331 // 332 // Variables 333 // 334 //-------------------------------------------------------------------------- 335 336 /** 337 * @private 338 * Cached value of the TextFormat read from the Styles. 339 */ 340 private var cachedTextFormat:TextFormat; 341 342 /** 343 * @private 344 * 345 * Cache last value of embedded font. 346 */ 347 private var cachedEmbeddedFont:EmbeddedFont = null; 348 349 /** 350 * @private 351 */ 352 private var invalidateDisplayListFlag:Boolean = true; 353 354 /** 355 * @private 356 */ 357 mx_internal var styleChangedFlag:Boolean = true; 358 359 /** 360 * @private 361 * This var is either the last value of 'htmlText' that was set 362 * or null (if 'text' was set instead of 'htmlText'). 363 * 364 * This var is different from getting the 'htmlText', 365 * because when you set 'htmlText' into a TextField and then get it, 366 * you don't get what you set; what you get includes additional 367 * HTML markup generated from the defaultTextFormat 368 * (which for a Flex component is based on the CSS styles). 369 * 370 * When you set 'htmlText', a TextField parses through it 371 * and creates TextFormat runs based on the HTML markup. 372 * It applies these on top of the defaultTextFormat. 373 * A TextField saves the non-markup characters as the 'text', 374 * but it doesn't save the original 'htmlText', 375 * so we have to do this ourselves. 376 * 377 * If the CSS styles change, validateNow() will get called 378 * and a new TextFormat based on the new CSS styles 379 * will get applied to the entire TextField, wiping 380 * out any TextFormats that came from the HTML markup. 381 * So we use this var to re-apply the original markup 382 * after a CSS change. 383 */ 384 private var explicitHTMLText:String = null; 385 386 /** 387 * @private 388 * Color set explicitly by setColor(); overrides style lookup. 389 */ 390 mx_internal var explicitColor:uint = StyleManager.NOT_A_COLOR; 391 392 /** 393 * @private 394 */ 395 private var resourceManager:IResourceManager = 396 ResourceManager.getInstance(); 397 398 /** 399 * @private 400 */ 401 private var untruncatedText:String; 402 403 /** 404 * @private 405 * TextField only has a width. Need to remember if explicitWidth should 406 * be used or width should be used. 407 */ 408 private var useExplicitWidth:Boolean = false; 409 410 /** 411 * @private 412 * TextField only has a height. Need to remember if explicitHeight should 413 * be used or height should be used. 414 */ 415 private var useExplicitHeight:Boolean = false; 416 417 /** 418 * @private 419 * True if we've inherited layoutDirection="rtl". 420 */ 421 private var mirror:Boolean = false; 422 423 //-------------------------------------------------------------------------- 424 // 425 // Overridden properties 426 // 427 //-------------------------------------------------------------------------- 428 429 //---------------------------------- 430 // height 431 //---------------------------------- 432 433 /** 434 * @private 435 */ 436 override public function set height(value:Number):void 437 { 438 super.height = value; 439 useExplicitHeight = false; 440 } 441 442 //---------------------------------- 443 // htmlText 444 //---------------------------------- 445 446 /** 447 * @private 448 */ 449 override public function set htmlText(value:String):void 450 { 451 // TextField's htmlText property can't be set to null. 452 if (!value) 453 value = ""; 454 455 // Performance optimization: if the htmlText hasn't changed, 456 // don't let the player think that we're dirty. 457 if (isHTML && super.htmlText == value) 458 return; 459 460 // Reapply the format because TextField would otherwise reset to 461 // black, Times New Roman, 12 462 if (cachedTextFormat && styleSheet == null) 463 defaultTextFormat = cachedTextFormat; 464 465 super.htmlText = value; 466 467 // Remember the htmlText that we've set, 468 // because the TextField doesn't remember it for us. 469 // We need it so that we can re-apply the HTML markup 470 // in validateNow() after the CSS styles change 471 explicitHTMLText = value; 472 473 if (invalidateDisplayListFlag) 474 validateNow(); 475 } 476 477 //---------------------------------- 478 // parent 479 //---------------------------------- 480 481 /** 482 * @private 483 * Reference to this component's virtual parent container. 484 * "Virtual" means that this parent may not be the same 485 * as the one that the Player returns as the 'parent' 486 * property of a DisplayObject. 487 * For example, if a Container has created a contentPane 488 * to improve scrolling performance, 489 * then its "children" are really its grandchildren 490 * and their "parent" is actually their grandparent, 491 * because we don't want developers to be concerned with 492 * whether a contentPane exists or not. 493 */ 494 mx_internal var _parent:DisplayObjectContainer; 495 496 /** 497 * The parent container or component for this component. 498 * 499 * @langversion 3.0 500 * @playerversion Flash 10 501 * @playerversion AIR 1.5 502 * @productversion Flex 4 503 */ 504 override public function get parent():DisplayObjectContainer 505 { 506 // Flash PlaceObject tags can have super.parent set 507 // before we get to setting the _parent property. 508 return _parent ? _parent : super.parent; 509 } 510 511 //---------------------------------- 512 // text 513 //---------------------------------- 514 515 /** 516 * @private 517 */ 518 override public function set text(value:String):void 519 { 520 // TextField's text property can't be set to null. 521 if (!value) 522 value = ""; 523 524 // Performance optimization: if the text hasn't changed, 525 // don't let the player think that we're dirty. 526 if (!isHTML && super.text == value) 527 return; 528 529 super.text = value; 530 531 explicitHTMLText = null; 532 533 if (invalidateDisplayListFlag) 534 validateNow(); 535 } 536 537 //---------------------------------- 538 // textColor 539 //---------------------------------- 540 541 /** 542 * @private 543 */ 544 override public function set textColor(value:uint):void 545 { 546 setColor(value); 547 } 548 549 //---------------------------------- 550 // width 551 //---------------------------------- 552 553 /** 554 * @private 555 */ 556 override public function set width(value:Number):void 557 { 558 super.width = value; 559 if (mirror) 560 validateTransformMatrix(); 561 562 useExplicitWidth = false; 563 } 564 565 //---------------------------------- 566 // x 567 //---------------------------------- 568 569 private var _x:Number = 0; 570 571 /** 572 * @private 573 */ 574 override public function set x(value:Number):void 575 { 576 _x = value; 577 super.x = value; 578 if (mirror) 579 validateTransformMatrix(); 580 } 581 582 /** 583 * @private 584 */ 585 override public function get x():Number 586 { 587 // TODO(hmuller): by default get x returns transform.matrix.tx rounded to the nearest 20th. 588 // should do the same here, if we're returning _x. 589 return (mirror) ? _x : super.x; 590 } 591 592 //-------------------------------------------------------------------------- 593 // 594 // Properties 595 // 596 //-------------------------------------------------------------------------- 597 598 //---------------------------------- 599 // automationDelegate 600 //---------------------------------- 601 602 /** 603 * @private 604 */ 605 private var _automationDelegate:IAutomationObject; 606 607 /** 608 * The delegate object which is handling the automation related functionality. 609 * 610 * 611 * @langversion 3.0 612 * @playerversion Flash 10 613 * @playerversion AIR 1.5 614 * @productversion Flex 4 615 */ 616 public function get automationDelegate():Object 617 { 618 return _automationDelegate; 619 } 620 621 /** 622 * @private 623 */ 624 public function set automationDelegate(value:Object):void 625 { 626 _automationDelegate = value as IAutomationObject; 627 } 628 629 //---------------------------------- 630 // automationName 631 //---------------------------------- 632 633 /** 634 * @private 635 * Storage for the automationName property. 636 */ 637 private var _automationName:String; 638 639 /** 640 * @inheritDoc 641 * 642 * @langversion 3.0 643 * @playerversion Flash 10 644 * @playerversion AIR 1.5 645 * @productversion Flex 4 646 */ 647 public function get automationName():String 648 { 649 if (_automationName) 650 return _automationName; 651 if (automationDelegate) 652 return automationDelegate.automationName; 653 654 return ""; 655 } 656 657 /** 658 * @private 659 */ 660 public function set automationName(value:String):void 661 { 662 _automationName = value; 663 } 664 665 /** 666 * @inheritDoc 667 * 668 * @langversion 3.0 669 * @playerversion Flash 10 670 * @playerversion AIR 1.5 671 * @productversion Flex 4 672 */ 673 public function get automationValue():Array 674 { 675 if (automationDelegate) 676 return automationDelegate.automationValue; 677 678 return [""]; 679 } 680 681 //---------------------------------- 682 // automationOwner 683 //---------------------------------- 684 685 /** 686 * @inheritDoc 687 * 688 * @langversion 3.0 689 * @playerversion Flash 9 690 * @playerversion AIR 1.1 691 * @productversion Flex 4 692 */ 693 public function get automationOwner():DisplayObjectContainer 694 { 695 return owner; 696 } 697 698 //---------------------------------- 699 // automationParent 700 //---------------------------------- 701 702 /** 703 * @inheritDoc 704 * 705 * @langversion 3.0 706 * @playerversion Flash 9 707 * @playerversion AIR 1.1 708 * @productversion Flex 4 709 */ 710 public function get automationParent():DisplayObjectContainer 711 { 712 return parent; 713 } 714 715 //---------------------------------- 716 // automationEnabled 717 //---------------------------------- 718 719 /** 720 * @inheritDoc 721 * 722 * @langversion 3.0 723 * @playerversion Flash 9 724 * @playerversion AIR 1.1 725 * @productversion Flex 4 726 */ 727 public function get automationEnabled():Boolean 728 { 729 return enabled; 730 } 731 732 //---------------------------------- 733 // automationVisible 734 //---------------------------------- 735 736 /** 737 * @inheritDoc 738 * 739 * @langversion 3.0 740 * @playerversion Flash 9 741 * @playerversion AIR 1.1 742 * @productversion Flex 4 743 */ 744 public function get automationVisible():Boolean 745 { 746 return visible; 747 } 748 749 //---------------------------------- 750 // baselinePosition 751 //---------------------------------- 752 753 /** 754 * The y-coordinate of the baseline of the first line of text. 755 * 756 * @langversion 3.0 757 * @playerversion Flash 10 758 * @playerversion AIR 1.5 759 * @productversion Flex 4 760 */ 761 public function get baselinePosition():Number 762 { 763 var tlm:TextLineMetrics; 764 765 // The text styles aren't known until there is a parent. 766 if (!parent) 767 return NaN; 768 769 // Ensure a textLine gets created. Either a width and height must 770 // be set or autoSize. 771 var oldAutoSize:String; 772 if (autoSize == TextFieldAutoSize.NONE && (width == 0 || height == 0)) 773 { 774 oldAutoSize = autoSize; 775 autoSize = TextFieldAutoSize.LEFT; 776 } 777 778 // getLineMetrics() returns strange numbers for an empty string, 779 // so instead we get the metrics for a non-empty string. 780 var isEmpty:Boolean = text == ""; 781 if (isEmpty) 782 super.text = "Wj"; 783 784 tlm = getLineMetrics(0); 785 786 // Restore values. 787 if (isEmpty) 788 super.text = ""; 789 790 if (oldAutoSize != null) 791 autoSize = oldAutoSize; 792 793 // TextFields have 2 pixels of padding all around. 794 return 2 + tlm.ascent; 795 } 796 797 //---------------------------------- 798 // className 799 //---------------------------------- 800 801 /** 802 * The name of this instance's class, such as 803 * <code>"DataGridItemRenderer"</code>. 804 * 805 * <p>This string does not include the package name. 806 * If you need the package name as well, call the 807 * <code>getQualifiedClassName()</code> method in the flash.utils package. 808 * It will return a string such as 809 * <code>"mx.controls.dataGridClasses::DataGridItemRenderer"</code>.</p> 810 * 811 * @langversion 3.0 812 * @playerversion Flash 10 813 * @playerversion AIR 1.5 814 * @productversion Flex 4 815 */ 816 public function get className():String 817 { 818 return NameUtil.getUnqualifiedClassName(this); 819 } 820 821 //---------------------------------- 822 // document 823 //---------------------------------- 824 825 /** 826 * @private 827 * Storage for the enabled property. 828 */ 829 private var _document:Object; 830 831 /** 832 * A reference to the document object associated with this UITextField object. 833 * A document object is an Object at the top of the hierarchy of an application, 834 * MXML component, or ActionScript component. 835 * 836 * @langversion 3.0 837 * @playerversion Flash 10 838 * @playerversion AIR 1.5 839 * @productversion Flex 4 840 */ 841 public function get document():Object 842 { 843 return _document; 844 } 845 846 /** 847 * @private 848 */ 849 public function set document(value:Object):void 850 { 851 _document = value; 852 } 853 854 //---------------------------------- 855 // enableIME 856 //---------------------------------- 857 858 /** 859 * A flag that indicates whether the IME should 860 * be enabled when the component receives focus. 861 * 862 * @langversion 3.0 863 * @playerversion Flash 10 864 * @playerversion AIR 1.5 865 * @productversion Flex 4 866 */ 867 public function get enableIME():Boolean 868 { 869 return type == TextFieldType.INPUT; 870 } 871 872 //---------------------------------- 873 // enabled 874 //---------------------------------- 875 876 /** 877 * @private 878 * Storage for the enabled property. 879 */ 880 private var _enabled:Boolean = true; 881 882 /** 883 * A Boolean value that indicates whether the component is enabled. 884 * This property only affects 885 * the color of the text and not whether the UITextField is editable. 886 * To control editability, use the 887 * <code>flash.text.TextField.type</code> property. 888 * 889 * @default true 890 * @see flash.text.TextField 891 * 892 * @langversion 3.0 893 * @playerversion Flash 10 894 * @playerversion AIR 1.5 895 * @productversion Flex 4 896 */ 897 public function get enabled():Boolean 898 { 899 return _enabled; 900 } 901 902 /** 903 * @private 904 */ 905 public function set enabled(value:Boolean):void 906 { 907 mouseEnabled = value; 908 _enabled = value; 909 910 styleChanged("color"); 911 } 912 913 //---------------------------------- 914 // explicitHeight 915 //---------------------------------- 916 917 /** 918 * @private 919 * Storage for the explicitHeight property. 920 */ 921 private var _explicitHeight:Number; 922 923 /** 924 * @copy mx.core.UIComponent#explicitHeight 925 * 926 * @langversion 3.0 927 * @playerversion Flash 10 928 * @playerversion AIR 1.5 929 * @productversion Flex 4 930 */ 931 public function get explicitHeight():Number 932 { 933 return _explicitHeight; 934 } 935 936 /** 937 * @private 938 */ 939 public function set explicitHeight(value:Number):void 940 { 941 _explicitHeight = value; 942 useExplicitHeight = true; 943 } 944 945 //---------------------------------- 946 // explicitMaxHeight 947 //---------------------------------- 948 949 /** 950 * Number that specifies the maximum height of the component, 951 * in pixels, in the component's coordinates, if the maxHeight property 952 * is set. Because maxHeight is read-only, this method returns NaN. 953 * You must override this method and add a setter to use this 954 * property. 955 * 956 * @see mx.core.UIComponent#explicitMaxHeight 957 * 958 * @default NaN 959 * 960 * @langversion 3.0 961 * @playerversion Flash 10 962 * @playerversion AIR 1.5 963 * @productversion Flex 4 964 */ 965 public function get explicitMaxHeight():Number 966 { 967 return NaN; 968 } 969 970 //---------------------------------- 971 // explicitMaxWidth 972 //---------------------------------- 973 974 /** 975 * Number that specifies the maximum width of the component, 976 * in pixels, in the component's coordinates, if the <code>maxWidth</code> property 977 * is set. Because the <code>maxWidth</code> property is read-only, this method returns <code>NaN</code>. 978 * You must override this method and add a setter to use this 979 * property. 980 * 981 * @see mx.core.UIComponent#explicitMaxWidth 982 * 983 * @default NaN 984 * 985 * @langversion 3.0 986 * @playerversion Flash 10 987 * @playerversion AIR 1.5 988 * @productversion Flex 4 989 */ 990 public function get explicitMaxWidth():Number 991 { 992 return NaN; 993 } 994 995 //---------------------------------- 996 // explicitMinHeight 997 //---------------------------------- 998 999 /** 1000 * @copy mx.core.UIComponent#explicitMinHeight 1001 * 1002 * @langversion 3.0 1003 * @playerversion Flash 10 1004 * @playerversion AIR 1.5 1005 * @productversion Flex 4 1006 */ 1007 public function get explicitMinHeight():Number 1008 { 1009 return NaN; 1010 } 1011 1012 //---------------------------------- 1013 // explicitMinWidth 1014 //---------------------------------- 1015 1016 /** 1017 * @copy mx.core.UIComponent#explicitMinWidth 1018 * 1019 * @langversion 3.0 1020 * @playerversion Flash 10 1021 * @playerversion AIR 1.5 1022 * @productversion Flex 4 1023 */ 1024 public function get explicitMinWidth():Number 1025 { 1026 return NaN; 1027 } 1028 1029 //---------------------------------- 1030 // explicitWidth 1031 //---------------------------------- 1032 1033 /** 1034 * @private 1035 * Storage for the explicitWidth property. 1036 */ 1037 private var _explicitWidth:Number; 1038 1039 /** 1040 * @copy mx.core.UIComponent#explicitWidth 1041 * 1042 * @langversion 3.0 1043 * @playerversion Flash 10 1044 * @playerversion AIR 1.5 1045 * @productversion Flex 4 1046 */ 1047 public function get explicitWidth():Number 1048 { 1049 return _explicitWidth; 1050 } 1051 1052 /** 1053 * @private 1054 */ 1055 public function set explicitWidth(value:Number):void 1056 { 1057 _explicitWidth = value; 1058 useExplicitWidth = true; 1059 } 1060 1061 //---------------------------------- 1062 // focusPane 1063 //---------------------------------- 1064 1065 /** 1066 * @inheritDoc 1067 * 1068 * @langversion 3.0 1069 * @playerversion Flash 10 1070 * @playerversion AIR 1.5 1071 * @productversion Flex 4 1072 */ 1073 public function get focusPane():Sprite 1074 { 1075 return null; 1076 } 1077 1078 /** 1079 * @private 1080 */ 1081 public function set focusPane(value:Sprite):void 1082 { 1083 } 1084 1085 //---------------------------------- 1086 // ignorePadding 1087 //---------------------------------- 1088 1089 /** 1090 * @private 1091 * Storage for the ignorePadding property. 1092 */ 1093 private var _ignorePadding:Boolean = true; 1094 1095 /** 1096 * If <code>true</code>, the <code>paddingLeft</code> and 1097 * <code>paddingRight</code> styles will not add space 1098 * around the text of the component. 1099 * 1100 * @default true 1101 * 1102 * @langversion 3.0 1103 * @playerversion Flash 10 1104 * @playerversion AIR 1.5 1105 * @productversion Flex 4 1106 */ 1107 public function get ignorePadding():Boolean 1108 { 1109 return _ignorePadding; 1110 } 1111 1112 /** 1113 * @private 1114 */ 1115 public function set ignorePadding(value:Boolean):void 1116 { 1117 _ignorePadding = value; 1118 1119 styleChanged(null); 1120 } 1121 1122 //---------------------------------- 1123 // imeMode 1124 //---------------------------------- 1125 1126 /** 1127 * @private 1128 * Storage for the imeMode property. 1129 */ 1130 private var _imeMode:String = null; 1131 1132 /** 1133 * Specifies the IME (input method editor) mode. 1134 * The IME enables users to enter text in Chinese, Japanese, and Korean. 1135 * Flex sets the specified IME mode when the control gets the focus, 1136 * and sets it back to the previous value when the control loses the focus. 1137 * 1138 * <p>The flash.system.IMEConversionMode class defines constants for the 1139 * valid values for this property. 1140 * You can also specify <code>null</code> to specify no IME.</p> 1141 * 1142 * @see flash.system.IMEConversionMode 1143 * 1144 * @default null 1145 * 1146 * @langversion 3.0 1147 * @playerversion Flash 10 1148 * @playerversion AIR 1.5 1149 * @productversion Flex 4 1150 */ 1151 public function get imeMode():String 1152 { 1153 return _imeMode; 1154 } 1155 1156 /** 1157 * @private 1158 */ 1159 public function set imeMode(value:String):void 1160 { 1161 _imeMode = value; 1162 } 1163 1164 //---------------------------------- 1165 // includeInLayout 1166 //---------------------------------- 1167 1168 /** 1169 * @private 1170 * Storage for the includeInLayout property. 1171 */ 1172 private var _includeInLayout:Boolean = true; 1173 1174 /** 1175 * @copy mx.core.UIComponent#includeInLayout 1176 * 1177 * @langversion 3.0 1178 * @playerversion Flash 10 1179 * @playerversion AIR 1.5 1180 * @productversion Flex 4 1181 */ 1182 public function get includeInLayout():Boolean 1183 { 1184 return _includeInLayout; 1185 } 1186 1187 /** 1188 * @private 1189 */ 1190 public function set includeInLayout(value:Boolean):void 1191 { 1192 if (_includeInLayout != value) 1193 { 1194 _includeInLayout = value; 1195 1196 var p:IInvalidating = parent as IInvalidating; 1197 if (p) 1198 { 1199 p.invalidateSize(); 1200 p.invalidateDisplayList(); 1201 } 1202 } 1203 } 1204 1205 //---------------------------------- 1206 // inheritingStyles 1207 //---------------------------------- 1208 1209 /** 1210 * @private 1211 * Storage for the inheritingStyles property. 1212 */ 1213 private var _inheritingStyles:Object = StyleProtoChain.STYLE_UNINITIALIZED; 1214 1215 /** 1216 * The beginning of this UITextField's chain of inheriting styles. 1217 * The <code>getStyle()</code> method accesses 1218 * <code>inheritingStyles[<i>styleName</i>]</code> to search the entire 1219 * prototype-linked chain. 1220 * This object is set up by the <code>initProtoChain()</code> method. 1221 * You typically never need to access this property directly. 1222 * 1223 * @langversion 3.0 1224 * @playerversion Flash 10 1225 * @playerversion AIR 1.5 1226 * @productversion Flex 4 1227 */ 1228 public function get inheritingStyles():Object 1229 { 1230 return _inheritingStyles; 1231 } 1232 1233 /** 1234 * @private 1235 */ 1236 public function set inheritingStyles(value:Object):void 1237 { 1238 _inheritingStyles = value; 1239 } 1240 1241 //---------------------------------- 1242 // initialized 1243 //---------------------------------- 1244 1245 /** 1246 * @private 1247 * Storage for the initialize property. 1248 */ 1249 private var _initialized:Boolean = false; 1250 1251 /** 1252 * A flag that determines if an object has been through all three phases 1253 * of layout validation (provided that any were required). 1254 * 1255 * @langversion 3.0 1256 * @playerversion Flash 10 1257 * @playerversion AIR 1.5 1258 * @productversion Flex 4 1259 */ 1260 public function get initialized():Boolean 1261 { 1262 return _initialized; 1263 } 1264 1265 /** 1266 * @private 1267 */ 1268 public function set initialized(value:Boolean):void 1269 { 1270 _initialized = value; 1271 } 1272 1273 //---------------------------------- 1274 // isHTML 1275 //---------------------------------- 1276 1277 /** 1278 * @private 1279 */ 1280 private function get isHTML():Boolean 1281 { 1282 return explicitHTMLText != null; 1283 } 1284 1285 //---------------------------------- 1286 // isPopUp 1287 //---------------------------------- 1288 /** 1289 * @copy mx.core.UIComponent#isPopUp 1290 * 1291 * @langversion 3.0 1292 * @playerversion Flash 10 1293 * @playerversion AIR 1.5 1294 * @productversion Flex 4 1295 */ 1296 public function get isPopUp():Boolean 1297 { 1298 return false; 1299 } 1300 1301 /** 1302 * @private 1303 */ 1304 public function set isPopUp(value:Boolean):void 1305 { 1306 } 1307 1308 //---------------------------------- 1309 // maxHeight 1310 //---------------------------------- 1311 1312 /** 1313 * @copy mx.core.UIComponent#maxHeight 1314 * 1315 * @langversion 3.0 1316 * @playerversion Flash 10 1317 * @playerversion AIR 1.5 1318 * @productversion Flex 4 1319 */ 1320 public function get maxHeight():Number 1321 { 1322 return UIComponent.DEFAULT_MAX_HEIGHT; 1323 } 1324 1325 //---------------------------------- 1326 // maxWidth 1327 //---------------------------------- 1328 1329 /** 1330 * @copy mx.core.UIComponent#maxWidth 1331 * 1332 * @langversion 3.0 1333 * @playerversion Flash 10 1334 * @playerversion AIR 1.5 1335 * @productversion Flex 4 1336 */ 1337 public function get maxWidth():Number 1338 { 1339 return UIComponent.DEFAULT_MAX_WIDTH; 1340 } 1341 1342 //---------------------------------- 1343 // measuredHeight 1344 //---------------------------------- 1345 1346 /** 1347 * @copy mx.core.UIComponent#measuredHeight 1348 * 1349 * @langversion 3.0 1350 * @playerversion Flash 10 1351 * @playerversion AIR 1.5 1352 * @productversion Flex 4 1353 */ 1354 public function get measuredHeight():Number 1355 { 1356 validateNow(); 1357 1358 return textHeight + TEXT_HEIGHT_PADDING; 1359 } 1360 1361 //---------------------------------- 1362 // measuredMinHeight 1363 //---------------------------------- 1364 1365 /** 1366 * @copy mx.core.UIComponent#measuredMinHeight 1367 * 1368 * @langversion 3.0 1369 * @playerversion Flash 10 1370 * @playerversion AIR 1.5 1371 * @productversion Flex 4 1372 */ 1373 public function get measuredMinHeight():Number 1374 { 1375 return 0; 1376 } 1377 1378 /** 1379 * @private 1380 */ 1381 public function set measuredMinHeight(value:Number):void 1382 { 1383 } 1384 1385 //---------------------------------- 1386 // measuredMinWidth 1387 //---------------------------------- 1388 1389 /** 1390 * @copy mx.core.UIComponent#measuredMinWidth 1391 * 1392 * @langversion 3.0 1393 * @playerversion Flash 10 1394 * @playerversion AIR 1.5 1395 * @productversion Flex 4 1396 */ 1397 public function get measuredMinWidth():Number 1398 { 1399 return 0; 1400 } 1401 1402 /** 1403 * @private 1404 */ 1405 public function set measuredMinWidth(value:Number):void 1406 { 1407 } 1408 1409 //---------------------------------- 1410 // measuredWidth 1411 //---------------------------------- 1412 1413 /** 1414 * @copy mx.core.UIComponent#measuredWidth 1415 * 1416 * @langversion 3.0 1417 * @playerversion Flash 10 1418 * @playerversion AIR 1.5 1419 * @productversion Flex 4 1420 */ 1421 public function get measuredWidth():Number 1422 { 1423 validateNow(); 1424 1425 return textWidth + TEXT_WIDTH_PADDING; 1426 } 1427 1428 //---------------------------------- 1429 // minHeight 1430 //---------------------------------- 1431 1432 /** 1433 * @copy mx.core.UIComponent#minHeight 1434 * 1435 * @langversion 3.0 1436 * @playerversion Flash 10 1437 * @playerversion AIR 1.5 1438 * @productversion Flex 4 1439 */ 1440 public function get minHeight():Number 1441 { 1442 return 0; 1443 } 1444 1445 //---------------------------------- 1446 // minWidth 1447 //---------------------------------- 1448 1449 /** 1450 * @copy mx.core.UIComponent#minWidth 1451 * 1452 * @langversion 3.0 1453 * @playerversion Flash 10 1454 * @playerversion AIR 1.5 1455 * @productversion Flex 4 1456 */ 1457 public function get minWidth():Number 1458 { 1459 return 0; 1460 } 1461 1462 //---------------------------------- 1463 // moduleFactory 1464 //---------------------------------- 1465 1466 /** 1467 * @private 1468 * Storage for the moduleFactory property. 1469 */ 1470 private var _moduleFactory:IFlexModuleFactory; 1471 1472 [Inspectable(environment="none")] 1473 1474 /** 1475 * The moduleFactory that is used to create TextFields in the correct SWF context. This is necessary so that 1476 * embedded fonts will work. 1477 * 1478 * @langversion 3.0 1479 * @playerversion Flash 10 1480 * @playerversion AIR 1.5 1481 * @productversion Flex 4 1482 */ 1483 public function get moduleFactory():IFlexModuleFactory 1484 { 1485 return _moduleFactory; 1486 } 1487 1488 /** 1489 * @private 1490 */ 1491 public function set moduleFactory(factory:IFlexModuleFactory):void 1492 { 1493 _moduleFactory = factory; 1494 } 1495 1496 //---------------------------------- 1497 // nestLevel 1498 //---------------------------------- 1499 1500 /** 1501 * @private 1502 * Storage for the nestLevel property. 1503 */ 1504 private var _nestLevel:int = 0; 1505 1506 /** 1507 * @copy mx.core.UIComponent#nestLevel 1508 * 1509 * @langversion 3.0 1510 * @playerversion Flash 10 1511 * @playerversion AIR 1.5 1512 * @productversion Flex 4 1513 */ 1514 public function get nestLevel():int 1515 { 1516 return _nestLevel; 1517 } 1518 1519 /** 1520 * @private 1521 */ 1522 public function set nestLevel(value:int):void 1523 { 1524 // If my parent hasn't been attached to the display list, then its nestLevel 1525 // will be zero. If it tries to set my nestLevel to 1, ignore it. We'll 1526 // update nest levels again after the parent is added to the display list. 1527 // 1528 // Also punt if the new value for nestLevel is the same as my current value. 1529 if (value > 1 && _nestLevel != value) 1530 { 1531 _nestLevel = value; 1532 1533 StyleProtoChain.initTextField(this); 1534 styleChangedFlag = true; 1535 validateNow(); 1536 } 1537 } 1538 1539 //---------------------------------- 1540 // nonInheritingStyles 1541 //---------------------------------- 1542 1543 /** 1544 * @private 1545 * Storage for the nonInheritingStyles property. 1546 */ 1547 private var _nonInheritingStyles:Object = StyleProtoChain.STYLE_UNINITIALIZED; 1548 1549 /** 1550 * The beginning of this UITextField's chain of non-inheriting styles. 1551 * The <code>getStyle()</code> method accesses 1552 * <code>nonInheritingStyles[styleName]</code> method to search the entire 1553 * prototype-linked chain. 1554 * This object is set up by the <code>initProtoChain()</code> method. 1555 * You typically never need to access this property directly. 1556 * 1557 * @langversion 3.0 1558 * @playerversion Flash 10 1559 * @playerversion AIR 1.5 1560 * @productversion Flex 4 1561 */ 1562 public function get nonInheritingStyles():Object 1563 { 1564 return _nonInheritingStyles; 1565 } 1566 1567 /** 1568 * @private 1569 */ 1570 public function set nonInheritingStyles(value:Object):void 1571 { 1572 _nonInheritingStyles = value; 1573 } 1574 1575 //---------------------------------- 1576 // percentHeight 1577 //---------------------------------- 1578 1579 /** 1580 * @copy mx.core.UIComponent#percentHeight 1581 * 1582 * @langversion 3.0 1583 * @playerversion Flash 10 1584 * @playerversion AIR 1.5 1585 * @productversion Flex 4 1586 */ 1587 public function get percentHeight():Number 1588 { 1589 return NaN; 1590 } 1591 1592 /** 1593 * @private 1594 */ 1595 public function set percentHeight(value:Number):void 1596 { 1597 } 1598 1599 //---------------------------------- 1600 // percentWidth 1601 //---------------------------------- 1602 1603 /** 1604 * @copy mx.core.UIComponent#percentWidth 1605 * 1606 * @langversion 3.0 1607 * @playerversion Flash 10 1608 * @playerversion AIR 1.5 1609 * @productversion Flex 4 1610 */ 1611 public function get percentWidth():Number 1612 { 1613 return NaN; 1614 } 1615 1616 /** 1617 * @private 1618 */ 1619 public function set percentWidth(value:Number):void 1620 { 1621 } 1622 1623 //---------------------------------- 1624 // processedDescriptors 1625 //---------------------------------- 1626 1627 /** 1628 * @private 1629 */ 1630 private var _processedDescriptors:Boolean = true; 1631 1632 /** 1633 * Set to <code>true</code> after the <code>createChildren()</code> 1634 * method creates any internal component children. 1635 * 1636 * @langversion 3.0 1637 * @playerversion Flash 10 1638 * @playerversion AIR 1.5 1639 * @productversion Flex 4 1640 */ 1641 public function get processedDescriptors():Boolean 1642 { 1643 return _processedDescriptors; 1644 } 1645 1646 /** 1647 * @private 1648 */ 1649 public function set processedDescriptors(value:Boolean):void 1650 { 1651 _processedDescriptors = value; 1652 } 1653 1654 //---------------------------------- 1655 // styleManager 1656 //---------------------------------- 1657 1658 /** 1659 * @private 1660 * 1661 * Returns the style manager used by this component. 1662 * 1663 * @langversion 3.0 1664 * @playerversion Flash 10 1665 * @playerversion AIR 1.5 1666 * @productversion Flex 4 1667 */ 1668 public function get styleManager():IStyleManager2 1669 { 1670 return StyleManager.getStyleManager(moduleFactory); 1671 } 1672 1673 //---------------------------------- 1674 // styleName 1675 //---------------------------------- 1676 1677 /** 1678 * @private 1679 * Storage for the styleName property. 1680 */ 1681 private var _styleName:Object /* String, CSSStyleDeclaration, or UIComponent */; 1682 1683 /** 1684 * @copy mx.core.UIComponent#styleName 1685 * 1686 * @langversion 3.0 1687 * @playerversion Flash 10 1688 * @playerversion AIR 1.5 1689 * @productversion Flex 4 1690 */ 1691 public function get styleName():Object /* String, CSSStyleDeclaration, or UIComponent */ 1692 { 1693 return _styleName; 1694 } 1695 1696 /** 1697 * @private 1698 */ 1699 public function set styleName(value:Object /* String, CSSStyleDeclaration, or UIComponent */):void 1700 { 1701 if (_styleName === value) 1702 return; 1703 1704 _styleName = value; 1705 1706 if (parent) 1707 { 1708 StyleProtoChain.initTextField(this); 1709 styleChanged("styleName"); 1710 } 1711 1712 // If we don't have a parent pointer yet, then we'll wait 1713 // and initialize the proto chain when the parentChanged() 1714 // method is called. 1715 } 1716 1717 //---------------------------------- 1718 // systemManager 1719 //---------------------------------- 1720 1721 /** 1722 * @copy mx.core.UIComponent#systemManager 1723 * 1724 * @langversion 3.0 1725 * @playerversion Flash 10 1726 * @playerversion AIR 1.5 1727 * @productversion Flex 4 1728 */ 1729 public function get systemManager():ISystemManager 1730 { 1731 var o:DisplayObject = parent; 1732 while (o) 1733 { 1734 var ui:IUIComponent = o as IUIComponent; 1735 if (ui) 1736 return ui.systemManager; 1737 1738 o = o.parent; 1739 } 1740 1741 return null; 1742 } 1743 1744 /** 1745 * @private 1746 */ 1747 public function set systemManager(value:ISystemManager):void 1748 { 1749 // Not supported 1750 } 1751 1752 //---------------------------------- 1753 // nonZeroTextHeight 1754 //---------------------------------- 1755 1756 /** 1757 * The height of the text, in pixels. Unlike the <code>textHeight</code> property, 1758 * the <code>nonZeroTextHeight</code> property returns a non-zero value of what the 1759 * height of the text would be, even if the text is empty. 1760 * 1761 * @langversion 3.0 1762 * @playerversion Flash 10 1763 * @playerversion AIR 1.5 1764 * @productversion Flex 4 1765 */ 1766 public function get nonZeroTextHeight():Number 1767 { 1768 if (super.text == "") 1769 { 1770 super.text = "Wj"; 1771 var result:Number = textHeight; 1772 super.text = ""; 1773 return result; 1774 } 1775 1776 return textHeight; 1777 } 1778 1779 //---------------------------------- 1780 // toolTip 1781 //---------------------------------- 1782 1783 /** 1784 * @private 1785 * Storage for the toolTip property. 1786 */ 1787 mx_internal var _toolTip:String; 1788 1789 /** 1790 * @copy mx.core.UIComponent#toolTip 1791 * 1792 * @langversion 3.0 1793 * @playerversion Flash 10 1794 * @playerversion AIR 1.5 1795 * @productversion Flex 4 1796 */ 1797 public function get toolTip():String 1798 { 1799 return _toolTip; 1800 } 1801 1802 /** 1803 * @private 1804 */ 1805 public function set toolTip(value:String):void 1806 { 1807 var oldValue:String = _toolTip; 1808 _toolTip = value; 1809 1810 ToolTipManager.registerToolTip(this, oldValue, value); 1811 } 1812 1813 //---------------------------------- 1814 // tweeningProperties 1815 //---------------------------------- 1816 1817 /** 1818 * @copy mx.core.UIComponent#tweeningProperties 1819 * 1820 * @langversion 3.0 1821 * @playerversion Flash 10 1822 * @playerversion AIR 1.5 1823 * @productversion Flex 4 1824 */ 1825 public function get tweeningProperties():Array 1826 { 1827 return null; 1828 } 1829 1830 /** 1831 * @private 1832 */ 1833 public function set tweeningProperties(value:Array):void 1834 { 1835 } 1836 1837 //---------------------------------- 1838 // updateCompletePendingFlag 1839 //---------------------------------- 1840 1841 /** 1842 * @private 1843 * Storage for the updateCompletePendingFlag property. 1844 */ 1845 private var _updateCompletePendingFlag:Boolean = false; 1846 1847 /** 1848 * A flag that determines if an object has been through all three phases 1849 * of layout validation (provided that any were required) 1850 * 1851 * @langversion 3.0 1852 * @playerversion Flash 10 1853 * @playerversion AIR 1.5 1854 * @productversion Flex 4 1855 */ 1856 public function get updateCompletePendingFlag():Boolean 1857 { 1858 return _updateCompletePendingFlag; 1859 } 1860 1861 /** 1862 * @private 1863 */ 1864 public function set updateCompletePendingFlag(value:Boolean):void 1865 { 1866 _updateCompletePendingFlag = value; 1867 } 1868 1869 //-------------------------------------------------------------------------- 1870 // 1871 // Overridden methods: TextField 1872 // 1873 //-------------------------------------------------------------------------- 1874 1875 /** 1876 * @private 1877 */ 1878 override public function setTextFormat(format:TextFormat, 1879 beginIndex:int = -1, 1880 endIndex:int = -1):void 1881 { 1882 // It is an exception to call setTextFormat() 1883 // when styleSheet is applied. 1884 if (styleSheet) 1885 return; 1886 1887 super.setTextFormat(format, beginIndex, endIndex); 1888 1889 // Since changing the TextFormat will change the htmlText, 1890 // dispatch an event so that listeners can react to this. 1891 dispatchEvent(new Event("textFormatChange")); 1892 } 1893 1894 /** 1895 * @private 1896 */ 1897/* 1898 override public function insertXMLText(beginIndex:int, endIndex:int, 1899 richText:String, 1900 pasting:Boolean = false):void 1901 { 1902 super.insertXMLText(beginIndex, endIndex, richText, pasting); 1903 1904 dispatchEvent(new Event("textInsert")); 1905 } 1906*/ 1907 1908 /** 1909 * @private 1910 */ 1911 override public function replaceText(beginIndex:int, endIndex:int, 1912 newText:String):void 1913 { 1914 super.replaceText(beginIndex, endIndex, newText); 1915 1916 dispatchEvent(new Event("textReplace")); 1917 } 1918 1919 /** 1920 * @private 1921 */ 1922 override mx_internal function getErrorMessage(key:String, 1923 param:String = null):String 1924 { 1925 return resourceManager.getString("core", key, [ param ]); 1926 } 1927 1928 //-------------------------------------------------------------------------- 1929 // 1930 // Methods 1931 // 1932 //-------------------------------------------------------------------------- 1933 1934 /** 1935 * Initializes this component. 1936 * 1937 * <p>This method is required by the IUIComponent interface, 1938 * but it actually does nothing for a UITextField.</p> 1939 * 1940 * @langversion 3.0 1941 * @playerversion Flash 10 1942 * @playerversion AIR 1.5 1943 * @productversion Flex 4 1944 */ 1945 public function initialize():void 1946 { 1947 } 1948 1949 /** 1950 * @copy mx.core.UIComponent#getExplicitOrMeasuredWidth() 1951 * 1952 * @langversion 3.0 1953 * @playerversion Flash 10 1954 * @playerversion AIR 1.5 1955 * @productversion Flex 4 1956 */ 1957 public function getExplicitOrMeasuredWidth():Number 1958 { 1959 return !isNaN(explicitWidth) ? explicitWidth : measuredWidth; 1960 } 1961 1962 /** 1963 * @copy mx.core.UIComponent#getExplicitOrMeasuredHeight() 1964 * 1965 * @langversion 3.0 1966 * @playerversion Flash 10 1967 * @playerversion AIR 1.5 1968 * @productversion Flex 4 1969 */ 1970 public function getExplicitOrMeasuredHeight():Number 1971 { 1972 return !isNaN(explicitHeight) ? explicitHeight : measuredHeight; 1973 } 1974 1975 /** 1976 * Sets the <code>visible</code> property of this UITextField object. 1977 * 1978 * @param visible <code>true</code> to make this UITextField visible, 1979 * and <code>false</code> to make it invisible. 1980 * 1981 * @param noEvent <code>true</code> to suppress generating an event when you change visibility. 1982 * 1983 * @langversion 3.0 1984 * @playerversion Flash 10 1985 * @playerversion AIR 1.5 1986 * @productversion Flex 4 1987 */ 1988 public function setVisible(visible:Boolean, noEvent:Boolean = false):void 1989 { 1990 this.visible = visible 1991 } 1992 1993 /** 1994 * @copy mx.core.UIComponent#setFocus() 1995 * 1996 * @langversion 3.0 1997 * @playerversion Flash 10 1998 * @playerversion AIR 1.5 1999 * @productversion Flex 4 2000 */ 2001 public function setFocus():void 2002 { 2003 systemManager.stage.focus = this; 2004 } 2005 2006 /** 2007 * Returns a UITextFormat object that contains formatting information for this component. 2008 * This method is similar to the <code>getTextFormat()</code> method of the 2009 * flash.text.TextField class, but it returns a UITextFormat object instead 2010 * of a TextFormat object. 2011 * 2012 * <p>The UITextFormat class extends the TextFormat class to add the text measurement methods 2013 * <code>measureText()</code> and <code>measureHTMLText()</code>.</p> 2014 * 2015 * @return An object that contains formatting information for this component. 2016 * 2017 * @see mx.core.UITextFormat 2018 * @see flash.text.TextField 2019 * 2020 * @langversion 3.0 2021 * @playerversion Flash 10 2022 * @playerversion AIR 1.5 2023 * @productversion Flex 4 2024 */ 2025 public function getUITextFormat():UITextFormat 2026 { 2027 validateNow(); 2028 2029 var textFormat:UITextFormat = new UITextFormat(creatingSystemManager()); 2030 textFormat.moduleFactory = moduleFactory; 2031 2032 textFormat.copyFrom(getTextFormat()); 2033 2034 textFormat.antiAliasType = antiAliasType; 2035 textFormat.gridFitType = gridFitType; 2036 textFormat.sharpness = sharpness; 2037 textFormat.thickness = thickness; 2038 2039 textFormat.useFTE = true; 2040 textFormat.direction = direction; 2041 textFormat.locale = locale; 2042 2043 return textFormat; 2044 } 2045 2046 /** 2047 * @copy mx.core.UIComponent#move() 2048 * 2049 * @langversion 3.0 2050 * @playerversion Flash 10 2051 * @playerversion AIR 1.5 2052 * @productversion Flex 4 2053 */ 2054 public function move(x:Number, y:Number):void 2055 { 2056 // Performance optimization: if the position hasn't changed, don't let 2057 // the player think that we're dirty 2058 if (this.x != x) 2059 this.x = x; 2060 if (this.y != y) 2061 this.y = y; 2062 } 2063 2064 /** 2065 * @copy mx.core.UIComponent#setActualSize() 2066 * 2067 * @langversion 3.0 2068 * @playerversion Flash 10 2069 * @playerversion AIR 1.5 2070 * @productversion Flex 4 2071 */ 2072 public function setActualSize(w:Number, h:Number):void 2073 { 2074 // Performance optimization: if the size hasn't changed, don't let 2075 // the player think that we're dirty 2076 if (width != w) 2077 width = w; 2078 if (height != h) 2079 height = h; 2080 } 2081 2082 /** 2083 * @copy mx.core.UIComponent#getStyle() 2084 * 2085 * @langversion 3.0 2086 * @playerversion Flash 10 2087 * @playerversion AIR 1.5 2088 * @productversion Flex 4 2089 */ 2090 public function getStyle(styleProp:String):* 2091 { 2092 if (styleManager.inheritingStyles[styleProp]) 2093 { 2094 return inheritingStyles ? 2095 inheritingStyles[styleProp] : 2096 IStyleClient(parent).getStyle(styleProp); 2097 } 2098 else 2099 { 2100 return nonInheritingStyles ? 2101 nonInheritingStyles[styleProp] : 2102 IStyleClient(parent).getStyle(styleProp); 2103 } 2104 } 2105 2106 /** 2107 * Does nothing. 2108 * A UITextField cannot have inline styles. 2109 * 2110 * @param styleProp n/a 2111 * 2112 * @param newValue n/a 2113 * 2114 * @langversion 3.0 2115 * @playerversion Flash 10 2116 * @playerversion AIR 1.5 2117 * @productversion Flex 4 2118 */ 2119 public function setStyle(styleProp:String, value:*):void 2120 { 2121 } 2122 2123 /** 2124 * This function is called when a UITextField object is assigned 2125 * a parent. 2126 * You typically never need to call this method. 2127 * 2128 * @param p The parent of this UITextField object. 2129 * 2130 * @langversion 3.0 2131 * @playerversion Flash 10 2132 * @playerversion AIR 1.5 2133 * @productversion Flex 4 2134 */ 2135 public function parentChanged(p:DisplayObjectContainer):void 2136 { 2137 if (!p) 2138 { 2139 _parent = null; 2140 _nestLevel = 0; 2141 } 2142 else if (p is IStyleClient) 2143 { 2144 _parent = p; 2145 } 2146 else if (p is SystemManager) 2147 { 2148 _parent = p; 2149 } 2150 else 2151 { 2152 _parent = p.parent; 2153 } 2154 } 2155 2156 /** 2157 * @copy mx.core.UIComponent#styleChanged() 2158 * 2159 * @langversion 3.0 2160 * @playerversion Flash 10 2161 * @playerversion AIR 1.5 2162 * @productversion Flex 4 2163 */ 2164 public function styleChanged(styleProp:String):void 2165 { 2166 styleChangedFlag = true; 2167 2168 if (!invalidateDisplayListFlag) 2169 { 2170 invalidateDisplayListFlag = true; 2171 if ("callLater" in parent) 2172 Object(parent).callLater(validateNow); 2173 } 2174 } 2175 2176 /** 2177 * @copy mx.core.UIComponent#validateNow() 2178 * 2179 * @langversion 3.0 2180 * @playerversion Flash 10 2181 * @playerversion AIR 1.5 2182 * @productversion Flex 4 2183 */ 2184 public function validateNow():void 2185 { 2186 // If we don't have a parent pointer yet, then any attempts to get 2187 // style information will fail. Do nothing now - this function will 2188 // be called again when parentChanged is called. 2189 if (!parent) 2190 return; 2191 2192 // If the explicitWidth was set, and the width wasn't set after that, 2193 // for example by setLayoutBoundsSize(), push the explicit width 2194 // down to the TextField to use as its width. 2195 if (useExplicitWidth && !isNaN(explicitWidth) && width != explicitWidth) 2196 { 2197 super.width = (explicitWidth > 4) ? explicitWidth : 4; 2198 // Update the transform matrix with the new width. 2199 if (mirror) 2200 validateTransformMatrix(); 2201 } 2202 2203 // Same as for width above. 2204 if (useExplicitHeight && !isNaN(explicitHeight) && height != explicitHeight) 2205 super.height = explicitHeight; 2206 2207 // If ancestor is mirroring, need to flip this so it is not 2208 // mirroring, by updating transform.matrix to compenstate for layout 2209 // mirroring. layoutDirection should not be set directly on 2210 // UIFTETextField. 2211 if (styleChangedFlag) 2212 { 2213 const oldMirror:Boolean = mirror; 2214 mirror = getStyle("layoutDirection") == LayoutDirection.RTL; 2215 if (mirror || oldMirror) 2216 validateTransformMatrix(); 2217 } 2218 2219 // Set the text format. 2220 if (styleChangedFlag) 2221 { 2222 // direction is used by getTextStyles() so update it first. 2223 super.direction = getStyle("direction"); 2224 super.locale = getStyle("locale"); 2225 2226 var textFormat:TextFormat = getTextStyles(); 2227 if (textFormat.font) 2228 { 2229 var fontModuleFactory:IFlexModuleFactory = (noEmbeddedFonts || !embeddedFontRegistry) ? 2230 null : 2231 embeddedFontRegistry.getAssociatedModuleFactory( 2232 textFormat.font, textFormat.bold, textFormat.italic, 2233 this, moduleFactory, creatingSystemManager(), true); 2234 2235 // if we found the font, then it is embedded. 2236 // Some fonts are not listed in info(), so are not in the above registry. 2237 // Call isFontFaceEmbedded() which get the list of embedded fonts from the player. 2238 if (fontModuleFactory != null) 2239 { 2240 fontContext = fontModuleFactory; 2241 embedFonts = true; 2242 } 2243 } 2244 else 2245 { 2246 embedFonts = getStyle("embedFonts"); 2247 if (embedFonts) 2248 fontContext = moduleFactory; 2249 else 2250 fontContext = null; 2251 } 2252 2253 if (getStyle("fontAntiAliasType") != undefined) 2254 { 2255 antiAliasType = getStyle("fontAntiAliasType"); 2256 gridFitType = getStyle("fontGridFitType"); 2257 sharpness = getStyle("fontSharpness"); 2258 thickness = getStyle("fontThickness"); 2259 } 2260 2261 if (!styleSheet) 2262 { 2263 super.setTextFormat(textFormat); 2264 defaultTextFormat = textFormat; 2265 } 2266 2267 // Since changing the TextFormat will change the htmlText, 2268 // dispatch an event so that listeners can react to this. 2269 dispatchEvent(new Event("textFieldStyleChange")); 2270 } 2271 2272 styleChangedFlag = false; 2273 invalidateDisplayListFlag = false; 2274 } 2275 2276 /** 2277 * @private 2278 * Update the transform.matrix based on the mirror flag. This method must be 2279 * called when x, width, or layoutDirection changes. 2280 */ 2281 private function validateTransformMatrix():void 2282 { 2283 if (mirror) 2284 { 2285 const mirrorMatrix:Matrix = this.transform.matrix; 2286 mirrorMatrix.a = -1; 2287 mirrorMatrix.tx = _x + width; 2288 transform.matrix = mirrorMatrix; 2289 } 2290 else // layoutDirection changed, mirror=false, reset transform.matrix to its default 2291 { 2292 const defaultMatrix:Matrix = new Matrix(); 2293 defaultMatrix.tx = _x; 2294 defaultMatrix.ty = y; 2295 transform.matrix = defaultMatrix; 2296 } 2297 } 2298 2299 /** 2300 * Returns the TextFormat object that represents 2301 * character formatting information for this UITextField object. 2302 * 2303 * @return A TextFormat object. 2304 * 2305 * @see flash.text.TextFormat 2306 * 2307 * @langversion 3.0 2308 * @playerversion Flash 10 2309 * @playerversion AIR 1.5 2310 * @productversion Flex 4 2311 */ 2312 public function getTextStyles():TextFormat 2313 { 2314 var textFormat:TextFormat = new TextFormat(); 2315 2316 var textAlign:String = getStyle("textAlign"); 2317 // Map new Spark values that might be set in a selector 2318 // affecting both Halo and Spark components. 2319 if (textAlign == "start") 2320 textAlign = direction == "ltr" ? TextFormatAlign.LEFT : TextFormatAlign.RIGHT; 2321 else if (textAlign == "end") 2322 textAlign = direction == "ltr" ? TextFormatAlign.RIGHT : TextFormatAlign.LEFT; 2323 textFormat.align = textAlign; 2324 textFormat.bold = getStyle("fontWeight") == "bold"; 2325 if (enabled) 2326 { 2327 if (explicitColor == StyleManager.NOT_A_COLOR) 2328 textFormat.color = getStyle("color"); 2329 else 2330 textFormat.color = explicitColor; 2331 } 2332 else 2333 { 2334 textFormat.color = getStyle("disabledColor"); 2335 } 2336 textFormat.font = StringUtil.trimArrayElements(getStyle("fontFamily"),","); 2337 textFormat.indent = getStyle("textIndent"); 2338 textFormat.italic = getStyle("fontStyle") == "italic"; 2339 var kerning:* = getStyle("kerning"); 2340 // In Halo components based on TextField, 2341 // kerning is supposed to be true or false. 2342 // The default in TextField and Flex 3 is false 2343 // because kerning doesn't work for device fonts 2344 // and is slow for embedded fonts. 2345 // In Spark components based on TLF and FTE, 2346 // kerning is "auto", "on", or, "off". 2347 // The default in TLF and FTE is "auto" 2348 // (which means kern non-Asian characters) 2349 // because kerning works even on device fonts 2350 // and has miminal performance impact. 2351 // Since a CSS selector or parent container 2352 // can affect both Halo and Spark components, 2353 // we need to map "auto" and "on" to true 2354 // and "off" to false for Halo components 2355 // here and in FTETextField. 2356 // For Spark components, Label and CSSTextLayoutFormat, 2357 // do the opposite mapping of true to "on" and false to "off". 2358 // We also support a value of "default" 2359 // (which we set in the global selector) 2360 // to mean false for Halo and "auto" for Spark, 2361 // to get the recommended behavior in both sets of components. 2362 if (kerning == "auto" || kerning == "on") 2363 kerning = true; 2364 else if (kerning == "default" || kerning == "off") 2365 kerning = false; 2366 textFormat.kerning = kerning; 2367 textFormat.leading = getStyle("leading"); 2368 textFormat.leftMargin = ignorePadding ? 0 : getStyle("paddingLeft"); 2369 textFormat.letterSpacing = getStyle("letterSpacing"); 2370 textFormat.rightMargin = ignorePadding ? 0 : getStyle("paddingRight"); 2371 textFormat.size = getStyle("fontSize"); 2372 textFormat.underline = getStyle("textDecoration") == "underline"; 2373 2374 cachedTextFormat = textFormat; 2375 return textFormat; 2376 } 2377 2378 /** 2379 * Sets the font color of the text. 2380 * 2381 * @param color The new font color. 2382 * 2383 * @langversion 3.0 2384 * @playerversion Flash 10 2385 * @playerversion AIR 1.5 2386 * @productversion Flex 4 2387 */ 2388 public function setColor(color:uint):void 2389 { 2390 explicitColor = color; 2391 styleChangedFlag = true; 2392 invalidateDisplayListFlag = true; 2393 2394 validateNow(); 2395 } 2396 2397 /** 2398 * @copy mx.core.UIComponent#invalidateSize() 2399 * 2400 * @langversion 3.0 2401 * @playerversion Flash 10 2402 * @playerversion AIR 1.5 2403 * @productversion Flex 4 2404 */ 2405 public function invalidateSize():void 2406 { 2407 invalidateDisplayListFlag = true; 2408 } 2409 2410 /** 2411 * @copy mx.core.UIComponent#invalidateDisplayList() 2412 * 2413 * @langversion 3.0 2414 * @playerversion Flash 10 2415 * @playerversion AIR 1.5 2416 * @productversion Flex 4 2417 */ 2418 public function invalidateDisplayList():void 2419 { 2420 invalidateDisplayListFlag = true; 2421 } 2422 2423 /** 2424 * @copy mx.core.UIComponent#invalidateProperties() 2425 * 2426 * @langversion 3.0 2427 * @playerversion Flash 10 2428 * @playerversion AIR 1.5 2429 * @productversion Flex 4 2430 */ 2431 public function invalidateProperties():void 2432 { 2433 } 2434 2435 /** 2436 * Truncate text to make it fit horizontally in the area defined for the control, 2437 * and append an ellipsis, three periods (...), to the text. 2438 * 2439 * @param truncationIndicator The text to be appended after truncation. 2440 * If you pass <code>null</code>, a localizable string 2441 * such as <code>"..."</code> will be used. 2442 * 2443 * @return <code>true</code> if the text needed truncation. 2444 * 2445 * @langversion 3.0 2446 * @playerversion Flash 10 2447 * @playerversion AIR 1.5 2448 * @productversion Flex 4 2449 */ 2450 public function truncateToFit(truncationIndicator:String = null):Boolean 2451 { 2452 if (!truncationIndicator) 2453 truncationIndicator = truncationIndicatorResource; 2454 2455 // Ensure that the proper CSS styles get applied to the textField 2456 // before measuring text. 2457 // Otherwise the callLater(validateNow) in styleChanged() 2458 // can apply the CSS styles too late. 2459 validateNow(); 2460 2461 var originalText:String = super.text; 2462 2463 untruncatedText = originalText; 2464 2465 var w:Number = width; 2466 2467 // Need to check if we should truncate, but it 2468 // could be due to rounding error. Let's check that it's not. 2469 // Examples of rounding errors happen with "South Africa" and "Game" 2470 // with verdana.ttf. 2471 if (originalText != "" && textWidth + TEXT_WIDTH_PADDING > w + 0.00000000000001) 2472 { 2473 // This should get us into the ballpark. 2474 var s:String = super.text = originalText; 2475 originalText.slice(0, 2476 Math.floor((w / (textWidth + TEXT_WIDTH_PADDING)) * originalText.length)); 2477 2478 while (s.length > 1 && textWidth + TEXT_WIDTH_PADDING > w) 2479 { 2480 s = s.slice(0, -1); 2481 super.text = s + truncationIndicator; 2482 } 2483 2484 return true; 2485 } 2486 2487 return false; 2488 } 2489 2490 //-------------------------------------------------------------------------- 2491 // 2492 // Event handlers 2493 // 2494 //-------------------------------------------------------------------------- 2495 2496 /** 2497 * @private 2498 */ 2499 private function changeHandler(event:Event):void 2500 { 2501 // If the user changes the text displayed by the TextField, 2502 // whatever htmlText might have been set is now irrelevant. 2503 // This means that we can no longer re-apply any HTML markup 2504 // after a CSS style change. 2505 explicitHTMLText = null; 2506 } 2507 2508 /** 2509 * @private 2510 */ 2511 private function textFieldStyleChangeHandler(event:Event):void 2512 { 2513 // Some TextFormat in the TextField just changed. 2514 // If the TextField is displaying htmlText we need 2515 // to reset the htmlText that was last set 2516 // so that its markup is applied on top of the new TextFormat. 2517 if (explicitHTMLText != null) 2518 super.htmlText = explicitHTMLText; 2519 } 2520 2521 /** 2522 * @private 2523 */ 2524 private function resourceManager_changeHandler(event:Event):void 2525 { 2526 truncationIndicatorResource = resourceManager.getString( 2527 "core", "truncationIndicator"); 2528 2529 if (untruncatedText != null) 2530 { 2531 super.text = untruncatedText; 2532 truncateToFit(); 2533 } 2534 } 2535 2536 //-------------------------------------------------------------------------- 2537 // 2538 // IUIComponent 2539 // 2540 //-------------------------------------------------------------------------- 2541 2542 /** 2543 * Returns <code>true</code> if the child is parented or owned by this object. 2544 * 2545 * @param child The child DisplayObject. 2546 * 2547 * @return <code>true</code> if the child is parented or owned by this UITextField object. 2548 * 2549 * @see #owner 2550 * 2551 * @langversion 3.0 2552 * @playerversion Flash 10 2553 * @playerversion AIR 1.5 2554 * @productversion Flex 4 2555 */ 2556 public function owns(child:DisplayObject):Boolean 2557 { 2558 return child == this; 2559 } 2560 2561 //---------------------------------- 2562 // owner 2563 //---------------------------------- 2564 2565 /** 2566 * @private 2567 */ 2568 private var _owner:DisplayObjectContainer; 2569 2570 /** 2571 * By default, set to the parent container of this object. 2572 * However, if this object is a child component that is 2573 * popped up by its parent, such as the dropdown list of a ComboBox control, 2574 * the owner is the component that popped up this object. 2575 * 2576 * <p>This property is not managed by Flex, but by each component. 2577 * Therefore, if you use the <code>PopUpManger.createPopUp()</code> or 2578 * <code>PopUpManger.addPopUp()</code> method to pop up a child component, 2579 * you should set the <code>owner</code> property of the child component 2580 * to the component that popped it up.</p> 2581 * 2582 * <p>The default value is the value of the <code>parent</code> property.</p> 2583 * 2584 * @langversion 3.0 2585 * @playerversion Flash 10 2586 * @playerversion AIR 1.5 2587 * @productversion Flex 4 2588 */ 2589 public function get owner():DisplayObjectContainer 2590 { 2591 return _owner ? _owner : parent; 2592 } 2593 2594 public function set owner(value:DisplayObjectContainer):void 2595 { 2596 _owner = value; 2597 } 2598 2599 private function creatingSystemManager():ISystemManager 2600 { 2601 return ((moduleFactory != null) && (moduleFactory is ISystemManager)) 2602 ? ISystemManager(moduleFactory) 2603 : systemManager; 2604 } 2605 2606 /** 2607 * @private 2608 * 2609 * Get the embedded font for a set of font attributes. 2610 */ 2611 private function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont 2612 { 2613 // Check if we can reuse a cached value. 2614 if (cachedEmbeddedFont) 2615 { 2616 if (cachedEmbeddedFont.fontName == fontName && 2617 cachedEmbeddedFont.fontStyle == embeddedFontRegistry.getFontStyle(bold, italic)) 2618 { 2619 return cachedEmbeddedFont; 2620 } 2621 } 2622 2623 cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic); 2624 2625 return cachedEmbeddedFont; 2626 } 2627 2628 //---------------------------------- 2629 // IAutomationObject interface 2630 //---------------------------------- 2631 2632 /** 2633 * @inheritDoc 2634 * 2635 * @langversion 3.0 2636 * @playerversion Flash 10 2637 * @playerversion AIR 1.5 2638 * @productversion Flex 4 2639 */ 2640 public function replayAutomatableEvent(event:Event):Boolean 2641 { 2642 if (automationDelegate) 2643 return automationDelegate.replayAutomatableEvent(event); 2644 return false; 2645 } 2646 2647 /** 2648 * @private 2649 */ 2650 public function createAutomationIDPart(child:IAutomationObject):Object 2651 { 2652 return null; 2653 } 2654 2655 /** 2656 * @private 2657 */ 2658 public function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, 2659 properties:Array):Object 2660 { 2661 return null; 2662 } 2663 2664 /** 2665 * @private 2666 */ 2667 public function resolveAutomationIDPart(criteria:Object):Array 2668 { 2669 return []; 2670 } 2671 2672 /** 2673 * @private 2674 */ 2675 public function getAutomationChildAt(index:int):IAutomationObject 2676 { 2677 return null; 2678 } 2679 2680 /** 2681 * @private 2682 */ 2683 public function getAutomationChildren():Array 2684 { 2685 return null; 2686 } 2687 2688 /** 2689 * @private 2690 */ 2691 public function get numAutomationChildren():int 2692 { 2693 return 0; 2694 } 2695 2696 /** 2697 * @private 2698 */ 2699 public function get showInAutomationHierarchy():Boolean 2700 { 2701 return true; 2702 } 2703 2704 /** 2705 * @private 2706 */ 2707 public function set showInAutomationHierarchy(value:Boolean):void 2708 { 2709 } 2710 2711 /** 2712 * @private 2713 */ 2714 public function get automationTabularData():Object 2715 { 2716 return null; 2717 } 2718 2719} 2720 2721} 2722