Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280438 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -10,7 +10,7 @@
 ////////////////////////////////////////////////////////////////////////////////

-package mx.components
+package spark.components
 {
 import flash.events.Event;
 import flash.events.FocusEvent;
@@ -20,12 +20,13 @@
 import flash.text.TextField;
 import flash.ui.Keyboard;

-import mx.components.baseClasses.FxComponent;
-import mx.core.IViewport;
+import spark.components.supportClasses.ScrollerLayout;
+import spark.components.supportClasses.SkinnableComponent;
+import spark.core.IViewport;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
 import mx.core.ScrollPolicy;
-import mx.core.ScrollUnit;
+import spark.core.ScrollUnit;
 import mx.events.PropertyChangeEvent;
 import mx.managers.IFocusManagerComponent;
 import flash.display.InteractiveObject;
@@ -92,10 +93,10 @@

 [DefaultProperty("viewport")]

-[IconFile("FxScroller.png")]
+[IconFile("Scroller.png")]

 /**
- *  The FxScroller component displays a single scrollable component,
+ *  The Scroller component displays a single scrollable component,
  *  called a viewport, and a horizontal and vertical scrollbars.
  *  The viewport must implement the IViewport interface.
  *
@@ -109,10 +110,10 @@
  *  The auto policy means that the scrollbar will be visible and included
  *  in the layout when the viewport's content is larger than the viewport itself.

  *
- *
The FxScroller skin layout cannot be changed, it's unconditionally set to a
- *  private layout implementation that handles the scroll policies.  FxScroller skins
+ *
The Scroller skin layout cannot be changed, it's unconditionally set to a
+ *  private layout implementation that handles the scroll policies.  Scroller skins
  *  can only provide replacement scrollbars.  To gain more control over the layout
- *  of a viewport and its scrollbars, instead of using FxScroller, just add them
+ *  of a viewport and its scrollbars, instead of using Scroller, just add them
  *  to a Group and use the scrollbar viewport property
  *  to link them together.

  *
@@ -122,7 +123,7 @@
  *  @productversion Flex 4
  */

-public class FxScroller extends FxComponent
+public class Scroller extends SkinnableComponent
        implements IFocusManagerComponent, IVisualElementContainer
 {
     include "../core/Version.as";
@@ -141,7 +142,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxScroller()
+    public function Scroller()
     {
         super();
     }
@@ -172,7 +173,7 @@
      *  A skin part that defines the horizontal scrollbar.
      *
      *  This property should be considered read-only, it's only
-     *  set by the FxScroller's skin.
+     *  set by the Scroller's skin.
      *
      *  This property is Bindable.
      *
@@ -181,7 +182,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var horizontalScrollBar:FxHScrollBar;
+    public var horizontalScrollBar:HScrollBar;

     //----------------------------------
     //  verticalScrollBar
@@ -194,7 +195,7 @@
      *  A skin part that defines the vertical scrollbar.
      *
      *  This property should be considered read-only, it's only
-     *  set by the FxScroller's skin.
+     *  set by the Scroller's skin.
      *
      *  This property is Bindable.
      *
@@ -203,7 +204,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var verticalScrollBar:FxVScrollBar;
+    public var verticalScrollBar:VScrollBar;

     //----------------------------------
@@ -339,7 +340,7 @@
      *

      *
      *

-     *  The scroll policy affects the measured size of the FxScroller component.
+     *  The scroll policy affects the measured size of the Scroller component.
      *

      *
      *  @default ScrollPolicy.AUTO
@@ -397,7 +398,7 @@
      *

      *
      *

-     *  The scroll policy affects the measured size of the FxScroller component.
+     *  The scroll policy affects the measured size of the Scroller component.
      *

      *
      *  @default ScrollPolicy.AUTO
@@ -509,13 +510,13 @@
         if (element != null && element == viewport)
             return 0;
         else
-            throw ArgumentError(resourceManager.getString("components", "elementNotFoundInFxScroller", [element]));
+            throw ArgumentError(resourceManager.getString("components", "elementNotFoundInScroller", [element]));
     }

     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -532,7 +533,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -549,7 +550,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -566,7 +567,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -583,7 +584,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -600,7 +601,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -617,7 +618,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -634,7 +635,7 @@
     /**
      *  @inheritDoc
      *
-     *
This operation is not supported in FxScroller.  FxScroller only
+     *
This operation is not supported in Scroller.  Scroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

      *
@@ -660,7 +661,7 @@
     override protected function loadSkin():void
     {
         super.loadSkin();
-        skin.layout = new FxScrollerLayout();
+        skin.layout = new ScrollerLayout();
         installViewport();
     }

@@ -785,7 +786,7 @@
         }
     }

-    // To avoid unconditionally linking the TextView class we lazily
+    // To avoid unconditionally linking the RichEditableText class we lazily
     // get a reference if it's been linked already.  See below.
     private static var textViewClassLoaded:Boolean = false;
     private static var textViewClass:Class = null;
@@ -798,7 +799,7 @@

         // If a TextField has the focus, then check to see if it's already
         // handling mouse wheel events.  For now, we'll make the same
-        // assumption about TextView.
+        // assumption about RichEditableText.

         var focusOwner:InteractiveObject = getFocus();
         if ((focusOwner is TextField) && TextField(focusOwner).mouseWheelEnabled)
@@ -807,7 +808,7 @@
         if (!textViewClassLoaded)
         {
             textViewClassLoaded = true;
-            const s:String = "mx.components.TextView";
+            const s:String = "mx.components.RichEditableText";
             if (ApplicationDomain.currentDomain.hasDefinition(s))
                 textViewClass = Class(ApplicationDomain.currentDomain.getDefinition(s));
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10692
Author:   smgilson@adobe.com
Date:     2009-09-29T19:22:19.099782Z

Log Message:
-----------
Update ASDoc on Scroller.as, and add an examples/assets/logo.jpg
QE notes: -
Doc notes: -
Bugs: -
Reviewer: -
Tests run: - checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/assets/logo.jpg</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/ScrollerExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280465 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -76,19 +76,19 @@
 [Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark")]

 /**
- *  Indicates under what conditions the horizontal scrollbar is displayed.
+ *  Indicates under what conditions the horizontal scroll bar is displayed.
  *
  *

  *

- *  ScrollPolicy.ON ("on") - the scrollbar is always displayed.
+ *  ScrollPolicy.ON ("on") - the scroll bar is always displayed.
  *

  *

- *  ScrollPolicy.OFF ("off") - the scrollbar is never displayed.
+ *  ScrollPolicy.OFF ("off") - the scroll bar is never displayed.
  *  The viewport can still be scrolled programmatically, by setting its
  *  horizontalScrollPosition property.
  *

  *

- *  ScrollPolicy.AUTO ("auto") - the scrollbar is displayed when
+ *  ScrollPolicy.AUTO ("auto") - the scroll bar is displayed when
  *  the viewport's contentWidth is larger than its width.
  *

  *

@@ -129,19 +129,19 @@
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark")]

 /**
- *  Indicates under what conditions the vertical scrollbar is displayed.
+ *  Indicates under what conditions the vertical scroll bar is displayed.
  *
  *

  *

- *  ScrollPolicy.ON ("on") - the scrollbar is always displayed.
+ *  ScrollPolicy.ON ("on") - the scroll bar is always displayed.
  *

  *

- *  ScrollPolicy.OFF ("off") - the scrollbar is never displayed.
+ *  ScrollPolicy.OFF ("off") - the scroll bar is never displayed.
  *  The viewport can still be scrolled programmatically, by setting its
  *  verticalScrollPosition property.
  *

  *

- *  ScrollPolicy.AUTO ("auto") - the scrollbar is displayed when
+ *  ScrollPolicy.AUTO ("auto") - the scroll bar is displayed when
  *  the viewport's contentHeight is larger than its height.
  *

  *

@@ -174,15 +174,53 @@

 /**
  *  The Scroller component displays a single scrollable component,
- *  called a viewport, and a horizontal and vertical scrollbars.
+ *  called a viewport, and horizontal and vertical scroll bars.
  *  The viewport must implement the IViewport interface.
+ *
+ *
The Spark Group, DataGroup, and RichEditableText components implement
+ *  the IViewport interface and can be used as the children of the Scroller control,
+ *  as the following example shows:

  *
- *
The scrollbars control the viewport's horizontalScrollPosition and
+ *

+ *  <s:Scroller>
+ *       <s:Group width="100" height="100">
+ *          <mx:Image width="300" height="400"
+ *               source="@Embed(source='assets/logo.jpg')"/>
+ *       </s:Group>
+ *  </s:Scroller>

+ *
+ *
The size of the Image control is set larger than that of its parent Group container.
+ *  By default, the child extends past the boundaries of the parent container.
+ *  Rather than allow the child to extend past the boundaries of the parent container,
+ *  the Scroller specifies to clip the child to the boundaries and display scroll bars.

+ *
+ *
For Spark containers that do not implement the IViewport interface,
+ *  you can still use scroll bars.
+ *  To add scroll bars, create a custom skin for the container that
+ *  includes the Scroller control.

+ *
+ *
The IViewport interface define a viewport for the components that implement it.
+ *  A viewport is a rectangular subset of the area of a container that you want to display,
+ *  rather than displaying the entire container.
+ *  The scrollbars control the viewport's horizontalScrollPosition and
  *  verticalScrollPosition properties.
  *  Scrollbars make it possible to view the area defined by the viewport's
  *  contentWidth and contentHeight properties.

+ *
+ *
You can combine scroll bars with explicit settings for the container's viewport.
+ *  The viewport settings determine the initial position of the viewport,
+ *  and then you can use the scroll bars to move it, as the following example shows:

+ *
+ *

+ *  <s:Scroller>
+ *      <s:Group width="100" height="100"
+ *          horizontalScrollPosition="50" verticalScrollPosition="50">
+ *          <mx:Image width="300" height="400"
+ *              source="@Embed(source='assets/logo.jpg')"/>
+ *      </s:Group>
+ *  </s:Scroller>

  *
- *
The scrollbars are displayed according to the vertical and horizontal scrollbar
+ *
The scrollbars are displayed according to the vertical and horizontal scroll bar
  *  policy, which can be auto, on, or off.
  *  The auto policy means that the scrollbar will be visible and included
  *  in the layout when the viewport's content is larger than the viewport itself.

@@ -226,6 +264,7 @@
  *

  *  <s:Scroller
  *   Properties
+ *    measuredSizeIncludesScrollBars="true"
  *    minViewportInset="0"
  *    viewport="null"
  *
@@ -237,6 +276,7 @@
  *    breakOpportunity="auto"
  *    cffHinting="horizontal_stem"
  *    color="0"
+ *    contentBackgroundAlpha=""
  *    contentBackgroundColor=""
  *    digitCase="default"
  *    digitWidth="default"
@@ -284,7 +324,14 @@
  *  />
  *

  *
+ *  @see spark.core.IViewport
+ *  @see spark.components.DataGroup
+ *  @see spark.components.Group
+ *  @see spark.components.RichEditableText
  *  @see spark.skins.spark.ScrollerSkin
+ *
+ *  @includeExample examples/ScrollerExample.mxml
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
@@ -500,15 +547,15 @@
     private var _measuredSizeIncludesScrollBars:Boolean = true;

     /**
-     *  If true, the Scroller's measured size includes the space required for
+     *  If true, the Scroller's measured size includes the space required for
      *  the visible scrollbars, otherwise the Scroller's measured size depends
      *  only on its viewport.
      *
      *
Components like TextArea, which "reflow" their contents to fit the
      *  available width or height may use this property to stabilize their
-     *  measured size.  By default a TextArea's is defined by its widthInChars
-     *  and heightInChars properties and in many applications it's preferable
-     *  for the measured size to remain constant, event when scrollbars are displayed
+     *  measured size.  By default a TextArea's is defined by its widthInChars
+     *  and heightInChars properties and in many applications it's preferable
+     *  for the measured size to remain constant, event when scroll bars are displayed
      *  by the TextArea skin's Scroller.

      *
      *
In components where the content does not reflow, like a typical List's


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1284636 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/filters/BevelFilter.as
+++ frameworks/projects/spark/src/spark/filters/BevelFilter.as
@@ -1,4 +1,4 @@
-package flex.filters
+package mx.filters
 {
 import flash.events.IEventDispatcher;
 import flash.filters.BevelFilter;


[FragmentStream] Fix destruction

[FragmentStream] Fix destruction

--- src/com/pivotshare/hls/loader/FragmentStream.as
+++ src/com/pivotshare/hls/loader/FragmentStream.as
@@ -83,11 +83,12 @@
          * @method  close
          */
         public function close() : void {
+
             if (_fragmentURLStream && _fragmentURLStream.connected) {
                 _fragmentURLStream.close();
             }

-            if (_fragment) {
+            if (_fragment && _fragment.data) {

                 if (_fragment.data.decryptAES) {
                     _fragment.data.decryptAES.cancel();
@@ -96,8 +97,10 @@

                 // Explicitly release memory
                 // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html#clear()
-                _fragment.data.bytes.clear();
-                _fragment.data.bytes = null;
+                if (_fragment.data.bytes) {
+                    _fragment.data.bytes.clear();
+                    _fragment.data.bytes = null;
+                }
             }
         }


loadFile(): Added option to specify url as a URLRequest.

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -265,21 +265,22 @@
 		private var _loadFileCallback:Function;
 		/**
 		 * Loads a session state file from a URL.
-		 * @param url The URL to the session state file (.weave or .xml).
+		 * @param url The URL to the session state file (.weave or .xml) specified as a String or a URLRequest.
 		 * @param callback Either a Function or a String containing a JavaScript function definition. The callback will be invoked when the file loading completes.
-		 * @param noCacheHack If set to true, appends "?" followed by a series of numbers to prevent Flash from using a cached version of the file.
+		 * @param noCacheHack If set to true, appends "?" followed by a series of numbers to prevent Flash from using a cached version of the file.  Only works when url is given as a String.
 		 */
-		public function loadFile(url:String, callback:Object = null, noCacheHack:Boolean = false):void
-		{
-			_requestedConfigFile = url;
+		public function loadFile(url:Object, callback:Object = null, noCacheHack:Boolean = false):void
+		{
+			if (noCacheHack && url is String)
+				url = String(url) + "?" + (new Date()).getTime(); // prevent flex from using cache
+
+			var request:URLRequest = url as URLRequest || new URLRequest(String(url));
+			_requestedConfigFile = request.url;
 			_loadFileCallback = callback as Function;
 			if (callback is String)
 				_loadFileCallback = function():void { JavaScript.exec(callback + "();"); };

-			if (noCacheHack)
-				url += "?" + (new Date()).getTime(); // prevent flex from using cache
-
-			WeaveAPI.URLRequestUtils.getURL(null, new URLRequest(url), handleConfigFileDownloaded, handleConfigFileFault, _requestedConfigFile);
+			WeaveAPI.URLRequestUtils.getURL(null, request, handleConfigFileDownloaded, handleConfigFileFault, _requestedConfigFile);
 		}

 		private function downloadConfigFile():void


fixed ambiguous reference to numStreams in Geometry.dispose()

--- src/aerys/minko/scene/node/mesh/geometry/Geometry.as
+++ src/aerys/minko/scene/node/mesh/geometry/Geometry.as
@@ -201,7 +201,7 @@

 		public function dispose() : void
 		{
-			var numStreams : uint = numStreams;
+			var numStreams : uint = numVertexStreams;

 			for (var streamId : uint = 0; streamId < numStreams; ++streamId)
 				_vertexStreams[streamId].dispose();


fix coding style

fix coding style

--- src/aerys/minko/type/clone/CloneOptions.as
+++ src/aerys/minko/type/clone/CloneOptions.as
@@ -8,12 +8,12 @@
 	import aerys.minko.scene.controller.mesh.MeshVisibilityController;
 	import aerys.minko.scene.controller.mesh.skinning.SkinningController;

-	public class CloneOptions
+	public final class CloneOptions
 	{
-		private var _clonedControllerTypes		: Vector.<Class>	= new <Class>[];
-		private var _ignoredControllerTypes		: Vector.<Class>	= new <Class>[];
-		private var _reassignedControllerTypes	: Vector.<Class>	= new <Class>[];
-		private var _defaultControllerAction	: uint				= ControllerCloneAction.REASSIGN;
+		private var _clonedControllerTypes		: Vector.<Class>;
+		private var _ignoredControllerTypes		: Vector.<Class>;
+		private var _reassignedControllerTypes	: Vector.<Class>;
+		private var _defaultControllerAction	: uint;

 		public function get defaultControllerAction() : uint
 		{
@@ -31,6 +31,15 @@

 		public function CloneOptions()
 		{
+			initialize();
+		}
+
+		private function initialize() : void
+		{
+			_clonedControllerTypes = new <Class>[];
+			_ignoredControllerTypes = new <Class>[];
+			_reassignedControllerTypes = new <Class>[];
+			_defaultControllerAction = ControllerCloneAction.REASSIGN;
 		}

 		public static function get defaultOptions() : CloneOptions


Changed menubutton tooltip behavior

Changed menubutton tooltip behavior

--- src/UI/MenuButton.as
+++ src/UI/MenuButton.as
@@ -126,7 +126,7 @@
 			}

 			if (!mouseoverText)
-				U.state.upperLayer.add(mouseoverText = new FloatText(U.LABEL_FONT.configureFlxText(new FlxText( -1, -1, FlxG.width, tooltip))));
+				U.state.upperLayer.add(mouseoverText = new FloatText(U.LABEL_FONT.configureFlxText(new FlxText( -1, -1, FlxG.width / 2 - 20, tooltip))));
 			if (tooltipCallback != null && tooltip != tooltipCallback()) {
 				tooltip = tooltipCallback();
 				mouseoverText.text.text = tooltip;
@@ -134,12 +134,13 @@

 			//var adjMouse:FlxPoint = new FlxPoint(FlxG.mouse.x + FlxG.camera.scroll.x * (coreGraphic.scrollFactor.x - 1),
 												 //FlxG.mouse.y + FlxG.camera.scroll.y * (coreGraphic.scrollFactor.y - 1));
-			mouseoverText.x = FlxG.mouse.x - FlxG.camera.scroll.x - mouseoverText.width;
+			mouseoverText.x = FlxG.mouse.x - FlxG.camera.scroll.x - mouseoverText.width - 5;
 			if (mouseoverText.x < 5)
-				mouseoverText.x = 5;
+				mouseoverText.x = FlxG.mouse.x - FlxG.camera.scroll.x + 20;
+
 			mouseoverText.y = FlxG.mouse.y - FlxG.camera.scroll.y - mouseoverText.height;
 			if (mouseoverText.y < 5)
-				mouseoverText.y = 5;
+				mouseoverText.y = FlxG.mouse.y - FlxG.camera.scroll.y + 28;

 			mouseoverText.visible = true;
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5797
Author:   jimurphy@adobe.com
Date:     2009-03-31T15:35:34.544076Z

Log Message:
-----------
Merged revisions 3.x 5505,5526-5527,5535,5540,5542,5572,5616-5617,5656-5657,5671,5674,5683,5687-5688,5690,5698,5708-5709,5713-5716,5719-5723,5726,5728-5729,5736,5752,5754,5761,5774,5780,5784 -> trunk

most of these are user submitted patches! very cool.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/IResourceManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressIndeterminateSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="D">/flex/sdk/trunk/modules/compiler/FlexCompilerShell-license.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/formatters/DateFormatter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/PhoneNumberValidator.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as" copyfrom-rev="5784" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/NumberValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/CurrencyValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/CalendarLayoutChangeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/DataGridEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpMenuButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262189 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/resources/IResourceManager.as
+++ frameworks/projects/framework/src/mx/resources/IResourceManager.as
@@ -214,7 +214,18 @@
                                 IEventDispatcher;

     /**
-     *  This method has not yet been implemented.
+     *  Begins unloading a loaded resource module.
+     *
+     *
When the module is unloaded, its resource bundles
+     *  are removed from the ResourceManager, but the localeChain
+     *  is left unchanged.
+     *  If the update parameter is true,
+     *  the update() method will be called.

+     *
+     *  @param url The URL that was used to load the resource module.
+     *
+     *  @param update Whether to call
+     *  the update() method when the module finishes unloading.
      *
      *  @langversion 3.0
      *  @playerversion Flash 9


Transferred from the Adobe Open Source Subversion Repository

Revision: 17308
Author:   dthakkar@adobe.com
Date:     2010-08-12T23:22:20.533632Z

Log Message:
-----------
Flex integration feature (includes spark formatters and related checkintests.)
UIComponent.as - Added API's to support non visual style client
IAdvancedStyleClient.as - Added setter for StyleParent method
StyleProtoChain.as - Added else loop to verify if the component is IAdvancedStyleClient
StyleProxy.as - added setter for styleParent method (this class inherits IAdvancedStyleClient interface)

QE notes: No
Doc notes: No
Bugs: No
Reviewer: Gordon , Darrell
Tests run: CheckinTests, Mustella
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/CollatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CollatorTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/SortingCollator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/StringToolsTestScript.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/AdvancedStyleClientTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest/ADVStyleTestEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/NumberFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CurrencyFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CollatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/NumberFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/DateTimeFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CurrencyFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/DateTimeFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/AdvancedStyleClientTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/GlobalizationBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/formatters/IFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest/ADVStyleTestClass.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/StringToolsTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/MatchingCollator.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262445 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as
+++ frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as
@@ -0,0 +1,703 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+import flash.events.*;
+
+import mx.core.FlexGlobals;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModule;
+import mx.core.IFlexModuleFactory;
+import mx.core.IMXMLObject;
+import mx.core.UIComponent;
+import mx.styles.*;
+import mx.utils.NameUtil;
+
+/**
+ *  The AdvancedStyleClient is a base class that can be used
+ *  when implementing an object that uses the
+ *  IAdvancedStyleClient interface.  The base class supplies
+ *  implementations of the methods and properties required for an object
+ *  to participate in the style subsystem.
+ *
+ *
In addition to the IAdvancedStyleClient interface,
+ *  this object also implements the IFlexModule and
+ *  IMXMLObject interfaces. The IMXMLObject
+ *  interface contains an initialized method that is called
+ *  when the class is instantiated using an mxml declaration.
+ *  The  implementation of the initialized method provided
+ *  by this base class will add the class instance to the document object
+ *  that contains the mxml declaration. For more details see the description
+ *  of the initilized method.

+ *
+ *  @see mx.core.styles.IAdvancedStyleClient
+ *  @see #initialized
+ */
+public class AdvancedStyleClient extends EventDispatcher
+                        implements IAdvancedStyleClient,IFlexModule,IMXMLObject
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4
+     */
+    public function AdvancedStyleClient()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Keeps track of the setStyles() calls that have been deferred
+     *  until a moduleFactory is set.
+     */
+    private var deferredSetStyles:Object;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  className
+    //----------------------------------
+
+    /**
+     *  The name of the component class.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get className():String
+    {
+        return NameUtil.getUnqualifiedClassName(this);
+    }
+
+    //----------------------------------
+    //  inheritingStyles
+    //----------------------------------
+
+    private var _inheritingStyles:Object = StyleProtoChain.STYLE_UNINITIALIZED;
+
+    /**
+     *  An object containing the inheritable styles for this non-visual
+     *  style client instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get inheritingStyles():Object
+    {
+        return _inheritingStyles;
+    }
+
+    /**
+     *  @private
+     */
+    public function set inheritingStyles(value:Object):void
+    {
+        _inheritingStyles= value;
+    }
+
+    //----------------------------------
+    //  nonInheritingStyles
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the nonInheritingStyles property.
+     */
+    private var _nonInheritingStyles:Object
+                                        = StyleProtoChain.STYLE_UNINITIALIZED;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  The beginning of this component's chain of non-inheriting styles.
+     *  The getStyle() method simply accesses
+     *  nonInheritingStyles[styleName] to search the entire
+     *  prototype-linked chain.
+     *  This object is set up by initProtoChain().
+     *  Developers typically never need to access this property directly.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get nonInheritingStyles():Object
+    {
+        return _nonInheritingStyles;
+    }
+
+    /**
+     *  @private
+     */
+    public function set nonInheritingStyles(value:Object):void
+    {
+        _nonInheritingStyles = value;
+    }
+
+    //----------------------------------
+    //  styleDeclaration
+    //----------------------------------
+
+    /**
+     *  The style declaration that holds the inline styles declared by this
+     *  object.
+     *
+     *  @see mx.styles.CSSStyleDeclaration
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    private var _styleDeclarationVar:CSSStyleDeclaration;
+
+    [Inspectable(environment="none")]
+
+    public function get styleDeclaration():CSSStyleDeclaration
+    {
+        return _styleDeclarationVar;
+    }
+
+    /**
+     *  @private
+     */
+    public function set styleDeclaration(value:CSSStyleDeclaration):void
+    {
+        _styleDeclarationVar = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns the StyleManager instance used by this component.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get styleManager():IStyleManager2
+    {
+        return StyleManager.getStyleManager(moduleFactory);
+    }
+
+    private function setDeferredStyles():void
+    {
+        if (!deferredSetStyles)
+            return;
+
+        for (var styleProp:String in deferredSetStyles)
+        {
+            StyleProtoChain.setStyle(
+                                this, styleProp, deferredSetStyles[styleProp]);
+        }
+
+        deferredSetStyles = null;
+    }
+
+    [Bindable(style="true")]
+
+    /**
+     *  Gets a style property that has been set anywhere in this
+     *  component's style lookup chain.
+     *
+     *
This same method is used to get any kind of style property,
+     *  so the value returned may be a Boolean, String, Number, int,
+     *  uint (for an RGB color), Class (for a skin), or any kind of object.
+     *  Therefore the return type is specified as ~~.

+     *
+     *
If you are getting a particular style property, you will
+     *  know its type and will often want to store the result in a
+     *  variable of that type. You can use either the as
+     *  operator or coercion to do this. For example:

+     *
+     *

+     *  var backgroundColor:uint = getStyle("backgroundColor") as int;
+     *
+     *  or
+     *
+     *  var backgroundColor:uint = int(getStyle("backgroundColor"));
+     *

+     *
+     *
If the style property has not been set anywhere in the
+     *  style lookup chain, the value returned by the
+     *  getStyle() method is undefined.
+     *  Note that undefined is a special value that is
+     *  not the same as false, the empty String
+     * (""),NaN, 0, or null.
+     *  No valid style value is ever undefined.
+     *  You can use the static method
+     *  StyleManager.isValidStyleValue()
+     *  to test whether the value was set.

+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @return Style value.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function getStyle(styleProp:String):*
+    {
+        // If a moduleFactory has not be set yet, first check for any deferred
+        // styles. If there are no deferred styles or the styleProp is not in
+        // the deferred styles, the look in the proto chain.
+        if (!moduleFactory)
+        {
+            if (deferredSetStyles && deferredSetStyles[styleProp] !== undefined)
+                return deferredSetStyles[styleProp];
+        }
+
+        return styleManager.inheritingStyles[styleProp] ?
+            _inheritingStyles    ? _inheritingStyles[styleProp]    : undefined :
+            _nonInheritingStyles ? _nonInheritingStyles[styleProp] : undefined;
+    }
+
+    /**
+     *  Sets a style property on this component instance.
+     *
+     *
This can override a style that was set globally.

+     *
+     *
Calling the setStyle() method can result in decreased
+     *  performance.
+     *  Use it only when necessary.

+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @param newValue New value for the style.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function setStyle(styleProp:String, newValue:*):void
+    {
+        // If there is no module factory then defer the set
+        // style until a module factory is set.
+        if (moduleFactory)
+        {
+            StyleProtoChain.setStyle(this, styleProp, newValue);
+        }
+        else
+        {
+            if (!deferredSetStyles)
+                deferredSetStyles = new Object();
+
+            deferredSetStyles[styleProp] = newValue;
+        }
+    }
+
+    /**
+     *  Deletes a style property from this component instance.
+     *
+     *
This does not necessarily cause the getStyle()
+     *  method to return undefined.

+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function clearStyle(styleProp:String):void
+    {
+        setStyle(styleProp, undefined);
+    }
+
+    /**
+     *  Returns an Array of CSSStyleDeclaration objects for the type
+     *  selector that applies to this component, or null
+     *  if none exist.
+     *
+     *
For example, suppose that component MyButton extends Button.
+     *  This method first looks for a MyButton selector; then, it looks
+     *  for a Button type selector; finally, it looks for a UIComponent
+     *  type selector.

+     *
+     *  @return Array of CSSStyleDeclaration objects.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function getClassStyleDeclarations():Array
+    {
+        return StyleProtoChain.getClassStyleDeclarations(this);
+    }
+
+    /**
+     *  Propagates style changes to the children of this style client
+     *  instance.  A non-visual style client (i.e. a style client that is
+     *  not a DisplayObject) does not have children, therefore this method
+     *  does not do anything for non-visual style clients.
+     *
+     *  @param styleProp Name of the style property.
+     *
+     *  @param recursive Whether to propagate the style changes to the
+     *  children's children.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function notifyStyleChangeInChildren(
+                                    styleProp:String, recursive:Boolean):void
+    {
+    }
+
+    /**
+     *  Sets up the internal style cache values so that the
+     *  getStyle()
+     *  method functions.
+     *
+     *  @param recursive Regenerate the proto chains of the children.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function regenerateStyleCache(recursive:Boolean):void
+    {
+        StyleProtoChain.initProtoChain(this);
+    }
+
+    /**
+     *  Registers the EffectManager as one of the event listeners
+     *  for each effect event.
+     *
+     *  @param effects An Array of Strings of effect names.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function registerEffects(effects:Array /* of String */):void
+    {
+    }
+
+    /**
+     *  Detects changes to style properties. When any style property is set,
+     *  Flex calls the styleChanged() method,
+     *  passing to it the name of the style being set.
+     *
+     *
This is an advanced method that you might override
+     *  when creating a subclass of AdvancedStyleClient.
+     *  When you create a custom class,
+     *  you can override the styleChanged() method
+     *  to check the style name passed to it, and handle the change
+     *  accordingly.
+     *  This lets you override the default behavior of an existing style,
+     *  or add your own custom style properties.

+     *
+     *  @param styleProp The name of the style property, or null if all
+     *  styles for this
+     *  style client have changed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function styleChanged(styleProp:String):void
+    {
+        if (styleProp && (styleProp != "styleName"))
+        {
+            if (hasEventListener(styleProp + "Changed"))
+                dispatchEvent(new Event(styleProp + "Changed"));
+        }
+        else
+        {
+            if (hasEventListener("allStylesChanged"))
+                dispatchEvent(new Event("allStylesChanged"));
+        }
+    }
+
+    /**
+     *  @private
+     *  Storage for the styleName property.
+     */
+    private var _styleName:Object;
+                    // It can be String, CSSStyleDeclaration, or UIComponent.
+
+    [Inspectable(category="General")]
+
+    /**
+     *  The class style used by this component. This can be a String,
+     *  CSSStyleDeclaration or an IStyleClient.
+     *
+     *
If this is a String, it is the name of one or more whitespace
+     *  delimited class declarations in an <fx:Style> tag
+     *  or CSS file. You do not include the period in the
+     *  styleName. For example, if you have a class style named
+     *  ".bigText", set the styleName property to
+     *  "bigText" (no period).

+     *
+     *
If this is an IStyleClient, all styles in the
+     *  styleName object are used by this instance.

+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get styleName():Object
+            // Return type can be String, CSSStyleDeclaration, or UIComponent.
+    {
+        return _styleName;
+    }
+
+    /**
+     *  @private
+     */
+    public function set styleName(value:Object):void
+                // The value can be String, CSSStyleDeclaration, or UIComponent.
+    {
+        if (_styleName === value)
+            return;
+
+        _styleName = value;
+
+        styleChanged("styleName");
+    }
+
+    /**
+     *  @private
+     */
+    private var _styleParent:IAdvancedStyleClient;
+
+    //----------------------------------
+    //  IAdvancedStyleClient methods
+    //----------------------------------
+
+    //----------------------------------
+    //  id
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _id:String;
+
+    /**
+     *  ID of the component. This value becomes the instance name of the
+     *  object and should not contain any white space or special characters.
+     *  Each component throughout an application should have a unique id.
+     *
+     *
If your application is going to be tested by third party tools,
+     *  give each component a meaningful id. Testing tools use ids to
+     *  represent the control in their scripts and having a meaningful
+     *  name can make scripts more readable. For example, set the
+     *  value of a button to submit_button rather than b1 or button1.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get id():String
+    {
+        return _id;
+    }
+
+    /**
+     *  @private
+     */
+    public function set id(value:String):void
+    {
+        _id = value;
+    }
+
+    /**
+     *  A component's parent is used to evaluate descendant selectors.
+     *  A parent must also be an IAdvancedStyleClient to participate in
+     *  advanced style declarations.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get styleParent():IAdvancedStyleClient
+    {
+        return  _styleParent;
+    }
+
+    public function set styleParent(styleParent:IAdvancedStyleClient):void
+    {
+        _styleParent= styleParent;
+    }
+
+    /**
+     *  Flex calls the stylesInitialized() method when
+     *  the styles for a component are first initialized.
+     *
+     *
This is an advanced method that you might override
+     *  when creating a subclass of UIComponent. Flex guarantees that
+     *  your component's styles are fully initialized before
+     *  the first time your component's measure and
+     *  updateDisplayList methods are called.  For most
+     *  components, that is sufficient. But if you need early access to
+     *  your style values, you can override the stylesInitialized() function
+     *  to access style properties as soon as they are initialized the first
+     *  time.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function stylesInitialized():void
+    {
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+
+    public function matchesCSSState(cssState:String):Boolean
+    {
+        return false;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+
+    public function matchesCSSType(cssType:String):Boolean
+    {
+        return StyleProtoChain.matchesCSSType(this, cssType);
+    }
+
+    //----------------------------------
+    //  IFlexModule methods
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the moduleFactory property.
+     */
+    private var _moduleFactory:IFlexModuleFactory;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  A module factory is used as context for
+     *  finding the style manager that controls the styles for this
+     *  non-visual style client instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function get moduleFactory():IFlexModuleFactory
+    {
+        return _moduleFactory;
+    }
+
+    /**
+     *  @private
+     */
+    public function set moduleFactory(factory:IFlexModuleFactory):void
+    {
+        _moduleFactory = factory;
+
+        setDeferredStyles();
+    }
+
+    /**
+     *  The initialized method is called when this class or a class that
+     *  extends this class is used in an MXML declaration.
+     *  It is called after the implementing object has been created and all
+     *  component properties specified on the MXML tag have
+     *  been initialized.
+     *

+     *  If the document that created this object is a UIComponent,
+     *  (e.g. Application, Module, etc.) then the UIComponent's
+     *  addStyleClient method will be called to add this object to the
+     *  UIComponent's list of non-visual style clients. This allows the
+     *  object to inherit styles from the document.

+     *
+     *  @param document The MXML document that created this object.
+     *  @param id The identifier used by the document object to refer to
+     *  this object.
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4.5
+     */
+    public function initialized(document:Object, id:String):void
+    {
+        var uiComponent:UIComponent = document as UIComponent;
+
+        if (uiComponent == null)
+            uiComponent = FlexGlobals.topLevelApplication as UIComponent;
+
+        this.id = id;
+
+        this.moduleFactory = uiComponent.moduleFactory;
+
+        uiComponent.addStyleClient(this);
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10274
Author:   cframpto@adobe.com
Date:     2009-09-15T18:52:06.070116Z

Log Message:
-----------
Fix asdoc version info for textFieldClass and textInputClass.  They were both introduced for Flex 4 not Flex 3.

QE notes:
Doc notes:
Bugs: SDK-23168
Reviewer:
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262755 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as
+++ frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as
@@ -319,9 +319,9 @@
  *  @default mx.core.UITextField
  *
  *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="textFieldClass", type="Class", inherit="no")]


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1263102 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/validators/NumberValidator.as
+++ frameworks/projects/framework/src/mx/validators/NumberValidator.as
@@ -0,0 +1,1062 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.validators
+{
+
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+
+[ResourceBundle("validators")]
+
+/**
+ *  The NumberValidator class ensures that a String represents a valid number.
+ *  It can ensure that the input falls within a given range
+ *  (specified by minValue and maxValue),
+ *  is an integer (specified by domain),
+ *  is non-negative (specified by allowNegative),
+ *  and does not exceed the specified precision.
+ *  The validator correctly validates formatted numbers (e.g., "12,345.67")
+ *  and you can customize the thousandsSeparator and
+ *  decimalSeparator properties for internationalization.
+ *
+ *  @mxml
+ *
+ *
The <mx:NumberValidator> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:

+ *
+ *

+ *  <mx:NumberValidator
+ *    allowNegative="true|false"
+ *    decimalPointCountError="The decimal separator can only occur once."
+ *    decimalSeparator="."
+ *    domain="real|int"
+ *    exceedsMaxError="The number entered is too large."
+ *    integerError="The number must be an integer."
+ *    invalidCharError="The input contains invalid characters."
+ *    invalidFormatCharsError="One of the formatting parameters is invalid."
+ *    lowerThanMinError="The amount entered is too small."
+ *    maxValue="NaN"
+ *    minValue="NaN"
+ *    negativeError="The amount may not be negative."
+ *    precision="-1"
+ *    precisionError="The amount entered has too many digits beyond the decimal point."
+ *    separationError="The thousands separator must be followed by three digits."
+ *    thousandsSeparator=","
+ *  />
+ *

+ *
+ *  @includeExample examples/NumberValidatorExample.mxml
+ */
+public class NumberValidator extends Validator
+{
+	include "../core/Version.as";
+
+    /**
+     *  Convenience method for calling a validator
+	 *  from within a custom validation function.
+	 *  Each of the standard Flex validators has a similar convenience method.
+	 *
+	 *  @param validator The NumberValidator instance.
+	 *
+	 *  @param value A field to validate.
+	 *
+     *  @param baseField Text representation of the subfield
+	 *  specified in the value parameter.
+	 *  For example, if the value parameter specifies value.number,
+	 *  the baseField value is "number".
+	 *
+	 *  @return An Array of ValidationResult objects, with one ValidationResult
+	 *  object for each field examined by the validator.
+	 *
+	 *  @see mx.validators.ValidationResult
+     */
+    public static function validateNumber(validator:NumberValidator,
+										  value:Object,
+										  baseField:String):Array
+    {
+		var results:Array = [];
+
+		// Resource-backed properties of the validator.
+		var allowNegative:Boolean = validator.allowNegative;
+		var decimalSeparator:String = validator.decimalSeparator;
+		var domain:String = validator.domain;
+		var maxValue:Number = Number(validator.maxValue);
+		var minValue:Number = Number(validator.minValue);
+		var precision:int = int(validator.precision);
+		var thousandsSeparator:String = validator.thousandsSeparator;
+
+        var input:String = String(value);
+        var len:int = input.length;
+
+        var isNegative:Boolean = false;
+
+		var i:int;
+		var c:String;
+
+        // Make sure the formatting character parameters are unique,
+		// are not digits or the negative sign,
+		// and that the separators are one character.
+        var invalidFormChars:String = DECIMAL_DIGITS + "-";
+
+        if (decimalSeparator == thousandsSeparator ||
+            invalidFormChars.indexOf(decimalSeparator) != -1 ||
+            invalidFormChars.indexOf(thousandsSeparator) != -1 ||
+            decimalSeparator.length != 1 ||
+            thousandsSeparator.length != 1)
+        {
+            results.push(new ValidationResult(
+				true, baseField, "invalidFormatChar",
+				validator.invalidFormatCharsError));
+			return results;
+        }
+
+        // Check for invalid characters in input.
+        var validChars:String = DECIMAL_DIGITS + "-" +
+        						decimalSeparator + thousandsSeparator;
+        for (i = 0; i < len; i++)
+        {
+            c = input.charAt(i);
+            if (validChars.indexOf(c) == -1)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+            }
+        }
+
+        // Check if the input is negative.
+        if (input.charAt(0) == "-")
+        {
+			if (len == 1) // we have only '-' char
+			{
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+			}
+			else if (len == 2 && input.charAt(1) == '.') // handle "-."
+			{
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+			}
+
+            // Check if negative input is allowed.
+            if (!allowNegative)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "negative",
+					validator.negativeError));
+				return results;
+            }
+
+            // Strip off the minus sign, update some variables.
+            input = input.substring(1);
+            len--;
+            isNegative = true;
+        }
+
+        // Make sure there's only one decimal point.
+        if (input.indexOf(decimalSeparator) !=
+			input.lastIndexOf(decimalSeparator))
+        {
+            results.push(new ValidationResult(
+				true, baseField, "decimalPointCount",
+				validator.decimalPointCountError));
+			return results;
+        }
+
+        // Make sure every character after the decimal is a digit,
+		// and that there aren't too many digits after the decimal point:
+        // if domain is int there should be none,
+		// otherwise there should be no more than specified by precision.
+        var decimalSeparatorIndex:Number = input.indexOf(decimalSeparator);
+        if (decimalSeparatorIndex != -1)
+        {
+            var numDigitsAfterDecimal:Number = 0;
+
+			if (i == 1 && i == len) // we only have a '.'
+			{
+            	results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+			}
+
+            for (i = decimalSeparatorIndex + 1; i < len; i++)
+            {
+                // This character must be a digit.
+                if (DECIMAL_DIGITS.indexOf(input.charAt(i)) == -1)
+                {
+                    results.push(new ValidationResult(
+						true, baseField, "invalidChar",
+						validator.invalidCharError));
+					return results;
+                }
+
+                ++numDigitsAfterDecimal;
+
+                // There may not be any non-zero digits after the decimal
+				// if domain is int.
+                if (domain == "int" && input.charAt(i) != "0")
+                {
+                    results.push(new ValidationResult(
+						true, baseField,"integer",
+						validator.integerError));
+					return results;
+                }
+
+                // Make sure precision is not exceeded.
+                if (precision != -1 &&
+					numDigitsAfterDecimal > precision)
+                {
+                    results.push(new ValidationResult(
+						true, baseField, "precision",
+						validator.precisionError));
+					return results;
+                }
+            }
+        }
+
+        // Make sure the input begins with a digit or a decimal point.
+        if (DECIMAL_DIGITS.indexOf(input.charAt(0)) == -1 &&
+			input.charAt(0) != decimalSeparator)
+        {
+            results.push(new ValidationResult(
+				true, baseField, "invalidChar",
+				validator.invalidCharError));
+			return results;
+        }
+
+        // Make sure that every character before the decimal point
+		// is a digit or is a thousands separator.
+        // If it's a thousands separator,
+		// make sure it's followed by three consecutive digits.
+        var end:int = decimalSeparatorIndex == -1 ?
+					  len :
+					  decimalSeparatorIndex;
+        for (i = 1; i < end; i++)
+        {
+            c = input.charAt(i);
+            if (c == thousandsSeparator)
+            {
+                if (c == thousandsSeparator)
+                {
+                    if ((end - i != 4 &&
+						 input.charAt(i + 4) != thousandsSeparator) ||
+                        DECIMAL_DIGITS.indexOf(input.charAt(i + 1)) == -1 ||
+                        DECIMAL_DIGITS.indexOf(input.charAt(i + 2)) == -1 ||
+                        DECIMAL_DIGITS.indexOf(input.charAt(i + 3)) == -1)
+                    {
+                        results.push(new ValidationResult(
+							true, baseField, "separation",
+							validator.separationError));
+						return results;
+                    }
+                }
+            }
+            else if (DECIMAL_DIGITS.indexOf(c) == -1)
+            {
+                results.push(new ValidationResult(
+					true, baseField,"invalidChar",
+					validator.invalidCharError));
+				return results;
+            }
+        }
+
+        // Make sure the input is within the specified range.
+        if (!isNaN(minValue) || !isNaN(maxValue))
+        {
+            // First strip off the thousands separators.
+            for (i = 0; i < end; i++)
+            {
+                if (input.charAt(i) == thousandsSeparator)
+                {
+                    var left:String = input.substring(0, i);
+                    var right:String = input.substring(i + 1);
+                    input = left + right;
+                }
+            }
+
+            // Check bounds
+
+            var x:Number = Number(input);
+
+            if (isNegative)
+                x = -x;
+
+            if (!isNaN(minValue) && x < minValue)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "lowerThanMin",
+					validator.lowerThanMinError));
+				return results;
+            }
+
+			if (!isNaN(maxValue) && x > maxValue)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "exceedsMax",
+					validator.exceedsMaxError));
+				return results;
+            }
+        }
+
+        return results;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  Constructor.
+	 */
+	public function NumberValidator()
+	{
+		super();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  allowNegative
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the allowNegative property.
+	 */
+	private var _allowNegative:Object;
+
+    /**
+	 *  @private
+	 */
+	private var allowNegativeOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Specifies whether negative numbers are permitted.
+	 *  Valid values are true or false.
+	 *
+	 *  @default true
+     */
+	public function get allowNegative():Object
+	{
+		return _allowNegative;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set allowNegative(value:Object):void
+	{
+		allowNegativeOverride = value;
+
+		_allowNegative = value != null ?
+						 Boolean(value) :
+						 resourceManager.getBoolean(
+						     "validators", "allowNegative");
+	}
+
+	//----------------------------------
+	//  decimalSeparator
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the decimalSeparator property.
+	 */
+	private var _decimalSeparator:String;
+
+    /**
+	 *  @private
+	 */
+	private var decimalSeparatorOverride:String;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The character used to separate the whole
+	 *  from the fractional part of the number.
+	 *  Cannot be a digit and must be distinct from the
+     *  thousandsSeparator.
+	 *
+	 *  @default "."
+     */
+	public function get decimalSeparator():String
+	{
+		return _decimalSeparator;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set decimalSeparator(value:String):void
+	{
+		decimalSeparatorOverride = value;
+
+		_decimalSeparator = value != null ?
+							value :
+							resourceManager.getString(
+							    "validators", "decimalSeparator");
+	}
+
+	//----------------------------------
+	//  domain
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the domain property.
+	 */
+	private var _domain:String;
+
+    /**
+	 *  @private
+	 */
+	private var domainOverride:String;
+
+    [Inspectable(category="General", enumeration="int,real", defaultValue="null")]
+
+    /**
+     *  Type of number to be validated.
+	 *  Permitted values are "real" and "int".
+	 *
+	 *  @default "real"
+     */
+	public function get domain():String
+	{
+		return _domain;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set domain(value:String):void
+	{
+		domainOverride = value;
+
+		_domain = value != null ?
+				  value :
+				  resourceManager.getString(
+				      "validators", "numberValidatorDomain");
+	}
+
+	//----------------------------------
+	//  maxValue
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the maxValue property.
+	 */
+	private var _maxValue:Object;
+
+    /**
+	 *  @private
+	 */
+	private var maxValueOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Maximum value for a valid number. A value of NaN means there is no maximum.
+	 *
+	 *  @default NaN
+     */
+	public function get maxValue():Object
+	{
+		return _maxValue;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set maxValue(value:Object):void
+	{
+		maxValueOverride = value;
+
+		_maxValue = value != null ?
+					Number(value) :
+					resourceManager.getNumber(
+						"validators", "maxValue");
+	}
+
+	//----------------------------------
+	//  minValue
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the minValue property.
+	 */
+	private var _minValue:Object;
+
+    /**
+	 *  @private
+	 */
+	private var minValueOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Minimum value for a valid number. A value of NaN means there is no minimum.
+	 *
+	 *  @default NaN
+     */
+	public function get minValue():Object
+	{
+		return _minValue;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set minValue(value:Object):void
+	{
+		minValueOverride = value;
+
+		_minValue = value != null ?
+					Number(value) :
+					resourceManager.getNumber(
+						"validators", "minValue");
+	}
+
+	//----------------------------------
+	//  precision
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the precision property.
+	 */
+	private var _precision:Object;
+
+    /**
+	 *  @private
+	 */
+	private var precisionOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The maximum number of digits allowed to follow the decimal point.
+	 *  Can be any nonnegative integer.
+	 *  Note: Setting to 0 has the same effect
+	 *  as setting domain to "int".
+	 *  A value of -1 means it is ignored.
+	 *
+	 *  @default -1
+     */
+	public function get precision():Object
+	{
+		return _precision;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set precision(value:Object):void
+	{
+		precisionOverride = value;
+
+		_precision = value != null ?
+					 int(value) :
+					 resourceManager.getInt(
+					     "validators", "numberValidatorPrecision");
+	}
+
+ 	//----------------------------------
+	//  thousandsSeparator
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the thousandsSeparator property.
+	 */
+	private var _thousandsSeparator:String;
+
+    /**
+	 *  @private
+	 */
+	private var thousandsSeparatorOverride:String;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The character used to separate thousands
+	 *  in the whole part of the number.
+	 *  Cannot be a digit and must be distinct from the
+     *  decimalSeparator.
+	 *
+	 *  @default ","
+     */
+	public function get thousandsSeparator():String
+	{
+		return _thousandsSeparator;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set thousandsSeparator(value:String):void
+	{
+		thousandsSeparatorOverride = value;
+
+		_thousandsSeparator = value != null ?
+							  value :
+							  resourceManager.getString(
+							      "validators", "thousandsSeparator");
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties: Errors
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  decimalPointCountError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the decimalPointCountError property.
+	 */
+	private var _decimalPointCountError:String;
+
+    /**
+	 *  @private
+	 */
+	private var decimalPointCountErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the decimal separator character occurs more than once.
+	 *
+	 *  @default "The decimal separator can occur only once."
+     */
+	public function get decimalPointCountError():String
+	{
+		return _decimalPointCountError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set decimalPointCountError(value:String):void
+	{
+		decimalPointCountErrorOverride = value;
+
+		_decimalPointCountError = value != null ?
+								  value :
+								  resourceManager.getString(
+								      "validators", "decimalPointCountError");
+	}
+
+	//----------------------------------
+	//  exceedsMaxError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the exceedsMaxError property.
+	 */
+	private var _exceedsMaxError:String;
+
+    /**
+	 *  @private
+	 */
+	private var exceedsMaxErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value exceeds the maxValue property.
+	 *
+	 *  @default "The number entered is too large."
+     */
+	public function get exceedsMaxError():String
+	{
+		return _exceedsMaxError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set exceedsMaxError(value:String):void
+	{
+		exceedsMaxErrorOverride = value;
+
+		_exceedsMaxError = value != null ?
+						   value :
+						   resourceManager.getString(
+						       "validators", "exceedsMaxErrorNV");
+	}
+
+	//----------------------------------
+	//  integerError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the integerError property.
+	 */
+	private var _integerError:String;
+
+    /**
+	 *  @private
+	 */
+	private var integerErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the number must be an integer, as defined
+     * by the domain property.
+	 *
+	 *  @default "The number must be an integer."
+     */
+	public function get integerError():String
+	{
+		return _integerError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set integerError(value:String):void
+	{
+		integerErrorOverride = value;
+
+		_integerError = value != null ?
+						value :
+						resourceManager.getString(
+						    "validators", "integerError");
+	}
+
+	//----------------------------------
+	//  invalidCharError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the invalidCharError property.
+	 */
+	private var _invalidCharError:String;
+
+    /**
+	 *  @private
+	 */
+	private var invalidCharErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value contains invalid characters.
+	 *
+	 *  @default The input contains invalid characters."
+     */
+	public function get invalidCharError():String
+	{
+		return _invalidCharError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set invalidCharError(value:String):void
+	{
+		invalidCharErrorOverride = value;
+
+		_invalidCharError = value != null ?
+							value :
+							resourceManager.getString(
+								"validators", "invalidCharError");
+	}
+
+	//----------------------------------
+	//  invalidFormatCharsError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the invalidFormatCharsError property.
+	 */
+	private var _invalidFormatCharsError:String;
+
+    /**
+	 *  @private
+	 */
+	private var invalidFormatCharsErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value contains invalid format characters, which means that
+     *  it contains a digit or minus sign (-) as a separator character,
+     *  or it contains two or more consecutive separator characters.
+	 *
+	 *  @default "One of the formatting parameters is invalid."
+     */
+	public function get invalidFormatCharsError():String
+	{
+		return _invalidFormatCharsError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set invalidFormatCharsError(value:String):void
+	{
+		invalidFormatCharsErrorOverride = value;
+
+		_invalidFormatCharsError = value != null ?
+								   value :
+								   resourceManager.getString(
+								       "validators", "invalidFormatCharsError");
+	}
+
+	//----------------------------------
+	//  lowerThanMinError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the lowerThanMinError property.
+	 */
+	private var _lowerThanMinError:String;
+
+    /**
+	 *  @private
+	 */
+	private var lowerThanMinErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is less than minValue.
+	 *
+	 *  @default "The amount entered is too small."
+     */
+	public function get lowerThanMinError():String
+	{
+		return _lowerThanMinError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set lowerThanMinError(value:String):void
+	{
+		lowerThanMinErrorOverride = value;
+
+		_lowerThanMinError = value != null ?
+							 value :
+							 resourceManager.getString(
+							     "validators", "lowerThanMinError");
+	}
+
+	//----------------------------------
+	//  negativeError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the negativeError property.
+	 */
+	private var _negativeError:String;
+
+    /**
+	 *  @private
+	 */
+	private var negativeErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is negative and the
+     *  allowNegative property is false.
+	 *
+	 *  @default "The amount may not be negative."
+     */
+	public function get negativeError():String
+	{
+		return _negativeError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set negativeError(value:String):void
+	{
+		negativeErrorOverride = value;
+
+		_negativeError = value != null ?
+						 value :
+						 resourceManager.getString(
+						     "validators", "negativeError");
+	}
+
+	//----------------------------------
+	//  precisionError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the precisionError property.
+	 */
+	private var _precisionError:String;
+
+    /**
+	 *  @private
+	 */
+	private var precisionErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value has a precision that exceeds the value defined
+     *  by the precision property.
+	 *
+	 *  @default "The amount entered has too many digits beyond the decimal point."
+     */
+	public function get precisionError():String
+	{
+		return _precisionError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set precisionError(value:String):void
+	{
+		precisionErrorOverride = value;
+
+		_precisionError = value != null ?
+						  value :
+						  resourceManager.getString(
+						      "validators", "precisionError");
+	}
+
+	//----------------------------------
+	//  separationError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the separationError property.
+	 */
+	private var _separationError:String;
+
+    /**
+	 *  @private
+	 */
+	private var separationErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the thousands separator is in the wrong location.
+	 *
+	 *  @default "The thousands separator must be followed by three digits."
+     */
+	public function get separationError():String
+	{
+		return _separationError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set separationError(value:String):void
+	{
+		separationErrorOverride = value;
+
+		_separationError = value != null ?
+						   value :
+						   resourceManager.getString(
+						       "validators", "separationError");
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private
+     */
+	override protected function resourcesChanged():void
+	{
+		super.resourcesChanged();
+
+		allowNegative = allowNegativeOverride;
+		decimalSeparator = decimalSeparatorOverride;
+		domain = domainOverride;
+		maxValue = maxValueOverride;
+		minValue = minValueOverride;
+		precision = precisionOverride;
+		thousandsSeparator = thousandsSeparatorOverride;
+
+		decimalPointCountError = decimalPointCountErrorOverride;
+		exceedsMaxError = exceedsMaxErrorOverride;
+		integerError = integerErrorOverride;
+		invalidCharError = invalidCharErrorOverride;
+		invalidFormatCharsError = invalidFormatCharsErrorOverride;
+		lowerThanMinError = lowerThanMinErrorOverride;
+		negativeError = negativeErrorOverride;
+		precisionError = precisionErrorOverride;
+		separationError = separationErrorOverride;
+	}
+
+    /**
+     *  Override of the base class doValidation() method
+     *  to validate a number.
+     *
+	 *
You do not call this method directly;
+	 *  Flex calls it as part of performing a validation.
+	 *  If you create a custom Validator class, you must implement this method.

+	 *
+     *  @param value Object to validate.
+     *
+	 *  @return An Array of ValidationResult objects, with one ValidationResult
+	 *  object for each field examined by the validator.
+     */
+    override protected function doValidation(value:Object):Array
+    {
+        var results:Array = super.doValidation(value);
+
+		// Return if there are errors
+		// or if the required property is set to false and length is 0.
+		var val:String = value ? String(value) : "";
+		if (results.length > 0 || ((val.length == 0) && !required))
+			return results;
+		else
+		    return NumberValidator.validateNumber(this, value, null);
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 8577
Author:   cframpto@adobe.com
Date:     2009-07-15T14:32:04.519553Z

Log Message:
-----------
"Flicker" issue, when auto-sizing, particularly with constraints such as percentWidth or percentHeight which aren't know until display update after the text has been initially measured.

Move size invalidation to RichEditableTextEditManager.updateAllContainers() from damageHandler.  This gets the size update and the display update in the same frame the majority of the time.

Change validateProperties() from last submit back to validateNow() since calling validateProperties() from something called by commitProperties() is very bad.

QA Notes: mustella TextArea and TextInput tests pass
Doc Notes: SDK-21837
Reviewers: Alex

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/RichEditableTextEditManager.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280151 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -418,8 +418,6 @@
         // The focusOutHandler is called by the TCMContainer focusOutHandler.
         // The keyDownHandler is called by the TCMContainer keyDownHandler.

-        addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
-
         // Add event listeners on its TextContainerManager.

         _textContainerManager.addEventListener(
@@ -1003,7 +1001,6 @@
         _textContainerManager.editingMode = value;
     }

-
     //----------------------------------
     //  heightInLines
     //----------------------------------
@@ -1048,6 +1045,8 @@
         _heightInLines = value;
         heightInLinesChanged = true;

+        heightConstraint = NaN;
+
         invalidateProperties();
         invalidateSize();
         invalidateDisplayList();
@@ -1581,6 +1580,8 @@

         _widthInChars = value;
         widthInCharsChanged = true;
+
+        widthConstraint = NaN;

         invalidateProperties();
         invalidateSize();
@@ -1772,7 +1773,12 @@
             }

             // Must preserve the selection, if there was one.
-            selectRange(oldAnchorPosition, oldActivePosition);
+            var selectionManager:ISelectionManager = getSelectionManager();
+
+            // The visible selection will be refreshed during the update.
+            selectionManager.selectRange(oldAnchorPosition, oldActivePosition);
+
+            releaseSelectionManager();

             displayAsPasswordChanged = false;
         }
@@ -1978,8 +1984,12 @@
         // to be remeasured.  If one of the dimension changes, the text may
         // compose differently and have a different size which the layout
         // manager needs to know.
-        if (autoSize && remeasureText(unscaledWidth, unscaledHeight))
-            return;
+        if (autoSize)
+        {
+            autoSize = remeasureText(unscaledWidth, unscaledHeight)
+            if (autoSize)
+                return;
+        }

         super.updateDisplayList(unscaledWidth, unscaledHeight);

@@ -1993,11 +2003,11 @@
         // FIXME:(cframpto) remove NaN check when TLF setter is fixed
         // to check for NaN correctly

-        _textContainerManager.compositionWidth = unscaledWidth;
         if (!autoSize)
+        {
+            _textContainerManager.compositionWidth = unscaledWidth;
             _textContainerManager.compositionHeight = unscaledHeight;
-        else if (!isNaN(_textContainerManager.compositionHeight))
-            _textContainerManager.compositionHeight = NaN;
+        }

         if (debug)
             trace("updateContainer()");
@@ -2073,6 +2083,8 @@
     {
         super.explicitHeight = value;

+        heightConstraint = NaN;
+
         // Because of autoSizing, the size and display might be impacted.
         invalidateSize();
         invalidateDisplayList();
@@ -2086,6 +2098,8 @@
     {
         super.explicitWidth = value;

+        widthConstraint = NaN;
+
         // Because of autoSizing, the size and display might be impacted.
         invalidateSize();
         invalidateDisplayList();
@@ -2099,6 +2113,8 @@
     {
         super.percentHeight = value;

+        heightConstraint = NaN;
+
         // If we were autoSizing and now we are not we need to remeasure.
         invalidateSize();
         invalidateDisplayList();
@@ -2112,6 +2128,8 @@
     {
         super.percentWidth = value;

+        widthConstraint = NaN;
+
         // If we were autoSizing and now we are not we need to remeasure.
         invalidateSize();
         invalidateDisplayList();
@@ -2387,7 +2405,7 @@
      *  @private
      *  Return true if there is a width and height to use for the measure.
      */
-    private function isMeasureFixed():Boolean
+    mx_internal function isMeasureFixed():Boolean
     {
         return ((!isNaN(explicitWidth) || !isNaN(_widthInChars)) &&
                 (!isNaN(explicitHeight) || !isNaN(_heightInLines)) ||
@@ -2474,13 +2492,10 @@
             // Do we have a constrained width and an explicit height?
             // If so, the sizes are set so no need to remeasure now.
             if (!isNaN(explicitHeight) || !isNaN(_heightInLines))
-            {
-                autoSize = false;
                 return false;
-            }

-            // Did we already constrain the width or is there no width?
-            if (widthConstraint == width || width == 0)
+            // Is there no width?
+            if (width == 0)
                 return false;

             // No reflow for explicit lineBreak
@@ -2494,21 +2509,18 @@
             // Do we have a constrained height and an explicit width?
             // If so, the sizes are set so no need to remeasure now.
             if (!isNaN(explicitWidth) || !isNaN(_widthInChars))
-            {
-                autoSize = false;
                 return false;
-            }
-
-            // Did we already constrain the height or is there no height?
+
+            // Is there no height?
             if (height == heightConstraint || height == 0)
                 return false;

             heightConstraint = height;
         }
-
-        // Force the remeasure now.  We don't want to do it in two passes
-        // because there is flicker as the display objects are updated with the
-        // sizes and positions from layout pass1 and then from layout pass 2.
+
+        // Width or height is different than what was measured.  Since we're
+        // auto-sizing, need to remeasure, so the layout manager leaves the
+        // correct amount of space for the component.
         invalidateSize();

         return true;
@@ -2728,7 +2740,7 @@
                                 activePosition:int):void
     {
         // Make sure all properties are committed before doing the operation.
-        validateProperties();
+        validateNow();

         var selectionManager:ISelectionManager = getSelectionManager();

@@ -2751,8 +2763,8 @@
     public function scrollToRange(anchorPosition:int = 0,
                                   activePosition:int = int.MAX_VALUE):void
     {
-        // Make sure all properties are committed before doing the operation.
-        validateProperties();
+        // Make sure the properties are commited and the text is composed.
+        validateNow();

         // Scrolls so that the text position is visible in the container.
         textContainerManager.scrollToRange(anchorPosition, activePosition);
@@ -2818,7 +2830,7 @@
         var format:TextLayoutFormat = new TextLayoutFormat();

          // Make sure all properties are committed before doing the operation.
-        validateProperties();
+        validateNow();

         var selectionManager:ISelectionManager = getSelectionManager();

@@ -2946,7 +2958,7 @@
                                      activePosition:int=-1):void
     {
          // Make sure all properties are committed before doing the operation.
-        validateProperties();
+        validateNow();

         var editManager:IEditManager = getEditManager();

@@ -3013,7 +3025,7 @@
     private function handleInsertText(text:String, isAppend:Boolean=false):void
     {
         // Make sure all properties are committed before doing the append.
-        validateProperties();
+        validateNow();

         // Always use the EditManager regardless of the values of
         // selectable, editable and enabled.
@@ -3045,7 +3057,7 @@
     {
         if (!restrict && !maxChars && !displayAsPassword)
             return;
-
+
         // If copied/cut from displayAsPassword field the pastedText
         // is '*' characters but this is correct.
         var pastedText:String = TextUtil.extractText(op.textScrap.textFlow);
@@ -3203,17 +3215,6 @@

     /**
      *  @private
-     */
-    private function updateCompleteHandler(event:FlexEvent):void
-    {
-        // Make sure that if we did a double pass, next time around we'll
-        // measure normally
-        widthConstraint = NaN;
-        heightConstraint = NaN;
-    }
-
-    /**
-     *  @private
      *  Called when the TextContainerManager dispatches a 'compositionComplete'
      *  event when it has recomposed the text into TextLines.
      */
@@ -3319,7 +3320,15 @@
         // We don't need to call invalidateProperties()
         // because the hostFormat and the _textFlow are still valid.

-        invalidateSize();
+        // We don't need to call invalidateSize() for isMeasureFixed()
+        // because the width and height are still valid.  For the other cases,
+        // our override of EditManager.updateAllContainers(), will invalidate
+        // the size, if the content size has actually changed.
+
+        // Style change by changing textFlow directly could change size.
+        if (_textContainerManager.hostFormat != _textFlow.hostFormat)
+            invalidateSize();
+
         invalidateDisplayList();
     }

@@ -3336,6 +3345,8 @@

         if (newHorizontalScrollPosition != oldHorizontalScrollPosition)
         {
+            //trace("hsp scroll", oldHorizontalScrollPosition, "->", newHorizontalScrollPosition);
+
             _horizontalScrollPosition = newHorizontalScrollPosition;

             dispatchPropertyChangeEvent("horizontalScrollPosition",