Transferred from the Adobe Open Source Subversion Repository

Revision: 18514
Author:   dthakkar@adobe.com
Date:     2010-11-10T00:38:39.528767Z

Log Message:
-----------
QE notes: Some testcases in spark formatters are failing because of behavior change. These testcases are excluded prior to submission. Globalization QE team has been informed about this.
Doc notes: Spark Formatters ASDocs are updated and also added samples for the spark formatters.
Bugs: SDK-28145, SDK-28345 ,SDK-28320 ,SDK-28287,SDK-28314
Reviewer: Gordon , Craig, Masa, Xie
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/MatchingCollatorExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/NumberValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CurrencyValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/NumberValidatorTests.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CurrencyValidatorTests.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/CollatorBase.as</path>
<path kind="file" action="M">/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/asdoc/en_US/spark/formatters/examples/NumberFormatterExample1.mxml</path>
<path kind="file" action="D">/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/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample1.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/bundles/en_US/validators.properties</path>
<path kind="file" action="M">/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/projects/spark/asdoc/en_US/spark/globalization/SortingCollatorExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/StringToolsExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/IValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/NumberFormatterExample2.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample2.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/Validator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationUtils.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/GlobalizationBase.as</path>
<path kind="file" action="M">/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/projects/spark/asdoc/en_US/spark/formatters/examples/DateTimeFormatterExample.mxml</path>
<path kind="file" action="M">/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/projects/spark/src/spark/formatters/supportClasses/NumberFormatterBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/MatchingCollator.as</path>

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

--- frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as
+++ frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as
@@ -0,0 +1,1718 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.validators.supportClasses
+{
+
+import flash.globalization.NationalDigitsType;
+import flash.globalization.NumberFormatter;
+
+import mx.core.mx_internal;
+import mx.validators.NumberValidatorDomainType;
+import mx.validators.ValidationResult;
+
+import spark.formatters.CurrencyFormatter;
+import spark.formatters.NumberFormatter;
+import spark.globalization.LastOperationStatus;
+import spark.globalization.supportClasses.GlobalizationBase;
+import spark.validators.supportClasses.GlobalizationUtils;
+import spark.validators.supportClasses.GlobalizationValidatorBase;
+
+use namespace mx_internal;
+/**
+ *  The NumberValidatorBase class contains all the common functionality that is
+ *  required by the NumberValidator and
+ *  CurrencyValidator classes.
+ *
 This class is similar to the NumberFormatterBase class used
+ *  by the spark NumberFormatter and CurrencyFormatter
+ *  classes.

+ *
+ *  @see spark.formatters.NumberFormatterBase
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class NumberValidatorBase extends GlobalizationValidatorBase
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class Constants
+    //
+    //--------------------------------------------------------------------------
+
+    private static const ALLOW_NEGATIVE:String = "allowNegative";
+    private static const DECIMAL_SEPARATOR:String = "decimalSeparator";
+    private static const FRACTIONAL_DIGITS:String = "fractionalDigits";
+    private static const GROUPING_PATTERN:String = "groupingPattern";
+    private static const GROUPING_SEPARATOR:String = "groupingSeparator";
+    private static const NEGATIVE_SYMBOL:String = "negativeSymbol";
+
+    // Used by inheritors.
+    mx_internal static const NUMBER_VALIDATOR_TYPE:int = 1;
+    mx_internal static const CURRENCY_VALIDATOR_TYPE:int = 2;
+
+    // Follows flash.globalization limit.
+    private static const PATTERN_LENGTH_LIMIT:int = 10;
+    private static const DECIMAL_SEP_STD:String = ".";
+
+    /**
+     *  @private
+     *  A String containing the decimal digits 0 through 9.
+     *
+     */
+    mx_internal static const DECIMAL_DIGITS:String = "0123456789";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function NumberValidatorBase()
+    {
+        super();
+        // Previously allowNegative was an object. If it was null, the default
+        // value was loaded from resource manager in the setter. But now it
+        // is a boolean. Hence load it explicitly.
+        _allowNegative = allowNegativeOverride = resourceManager.getBoolean(
+            "validators", "allowNegative");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Underlying working instance of flash.globalizaiton.NumberFormatter or
+     *  CurrencyFormatter class.
+     *
+     *  Because it can be either type and they don't have common base except
+     *  Object, it is defined as Object.
+     */
+    protected var g11nWorkingInstance:Object = null;
+
+    /**
+    *  @private
+    *  Basic properies of the actual underlying working instance.
+    *
+    *  It can be flash.globalization.NumberFormatter/CurrencyFormatter OR
+    *  the fallback's propery set.
+    */
+    protected var properties:Object = null;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  lastOperationStatus
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  @inheritDoc
+     *
+     *  @see spark.Globalization.LastOperationStatus
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override public function get lastOperationStatus():String
+    {
+        return g11nWorkingInstance ?
+            g11nWorkingInstance.lastOperationStatus :
+            fallbackLastOperationStatus;
+    }
+
+    //----------------------------------
+    //  useFallback
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  @private
+     */
+    override mx_internal function get useFallback():Boolean
+    {
+        return g11nWorkingInstance.useFallback;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  allowNegative
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the allowNegative property.
+     */
+    private var _allowNegative:Boolean;
+
+    /**
+     *  @private
+     */
+    protected var allowNegativeOverride:Boolean;
+
+    [Inspectable(category="General", defaultValue="true")]
+    [Bindable("change")]
+
+    /**
+     *  Specifies whether negative numbers are permitted.
+     *  Valid values are true or false.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get allowNegative():Boolean
+    {
+        return _allowNegative;
+    }
+
+    public function set allowNegative(value:Boolean):void
+    {
+        allowNegativeOverride = value;
+
+        _allowNegative = value;
+        update();
+    }
+
+
+    //----------------------------------
+    //  decimalSeparator
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  The decimal separator character used for validating numbers that have
+     *  a decimal part.
+     *
+     *
This property is initially set based on the locale that
+     *  is selected when the validator object
+     *  is constructed.

+     *
+     *  @throws TypeError if this property is assigned a null value.
+     *
+     *  @default dependent on the locale and operating system.
+     *
+     *  @see #validate()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get decimalSeparator():String
+    {
+        return getBasicProperty(properties, DECIMAL_SEPARATOR);
+    }
+
+    public function set decimalSeparator(value:String):void
+    {
+        setBasicProperty(properties, DECIMAL_SEPARATOR, value);
+    }
+
+
+    //----------------------------------
+    //  domain
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the domain property.
+     */
+    private var _domain:String;
+
+    /**
+     *  @private
+     */
+    protected var domainOverride:String = "real";
+
+    [Inspectable(category="General", enumeration="int,real",
+                                     defaultValue="real")]
+    [Bindable("change")]
+
+    /**
+     *  Type of number to be validated.
+     *  Permitted values are "real" and "int".
+     *
+     *
In ActionScript, you can use the following constants to set this
+     *  property:
+     *  NumberValidatorDomainType.REAL or
+     *  NumberValidatorDomainType.INT.

+     *
+     *  @default "real"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get domain():String
+    {
+        return _domain;
+    }
+
+    /**
+     *  @private
+     */
+    public function set domain(value:String):void
+    {
+        domainOverride = value;
+
+        if (!value)
+        {
+            _domain = resourceManager.getString(
+                "validators", "numberValidatorDomain");
+        }
+        else if ((value != NumberValidatorDomainType.INT) &&
+            (value != NumberValidatorDomainType.REAL))
+        {
+            throw new ArgumentError();
+        }
+        else
+        {
+            _domain = value;
+        }
+
+        update();
+    }
+
+    //----------------------------------
+    //  fractionalDigits
+    //----------------------------------
+
+    [Bindable("change")]
+    [Inspectable(category="General", minValue="0")]
+
+    /**
+     *  The maximum number of digits that can appear after the decimal
+     *  separator.
+     *
+     *  @default dependent on the locale and operating system.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get fractionalDigits():int
+    {
+        return getBasicProperty(properties, FRACTIONAL_DIGITS);
+    }
+
+    public function set fractionalDigits(value:int):void
+    {
+        setBasicProperty(properties, FRACTIONAL_DIGITS, value);
+    }
+
+    //----------------------------------
+    //  groupingPattern
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  Describes the placement of grouping separators within the
+     *  validated number string.
+     *
+     *
The grouping pattern is defined as a string containing
+     *  numbers separated by semicolons and optionally may end
+     *  with an asterisk. For example: "3;2;*".
+     *  Each number in the string represents the number of digits
+     *  in a group. The grouping separator is placed before each
+     *  group of digits. An asterisk at the end of the string
+     *  indicates that groups with that number of digits should be
+     *  repeated for the rest of the formatted string.
+     *  If there is no asterisk then there are no additional groups
+     *  or separators for the rest of the formatted string.

+     *
+     *
The first number in the string corresponds to the first
+     *  group of digits to the left of the decimal separator.
+     *  Subsequent numbers define the number of digits in subsequent
+     *  groups to the left. Thus the string "3;2;*"
+     *  indicates that a grouping separator is placed after the first
+     *  group of 3 digits, followed by groups of 2 digits.
+     *  For example: 98,76,54,321

+     *
+     *
The following table shows examples of formatting the
+     *  number 123456789.12 with various grouping patterns.
+     *  The grouping separator is a comma and the decimal separator
+     *  is a period.
+     *

+     *

+     *

+     *                Grouping Pattern
+     *                Sample Format
+     *

+     *

+     *                3;*
+     *                123,456,789.12
+     *

+     *

+     *                3;2;*
+     *                12,34,56,789.12
+     *

+     *

+     *                3
+     *                123456,789.12
+     *

+     *

+     *
+     *
Only a limited number of grouping sizes can be defined.
+     *  On some operating systems, grouping patterns can only contain
+     *  two numbers plus an asterisk. Other operating systems can
+     *  support up to four numbers and an asterisk.
+     *  For patterns without an asterisk, some operating systems
+     *  only support one number while others support up to three numbers.
+     *  If the maximum number of grouping pattern elements is exceeded,
+     *  then additional elements
+     *  are ignored and the lastOperationStatus property
+     *  is set to indicate that a fall back value is
+     *  being used.
+     *

+     *
+     *  @throws TypeError if this property is assigned a null value.
+     *
+     *  @default dependent on the locale and operating system.
+     *
+     *  @see #groupingSeparator
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get groupingPattern():String
+    {
+        return getBasicProperty(properties, GROUPING_PATTERN);
+    }
+
+    public function set groupingPattern(value:String):void
+    {
+        setBasicProperty(properties, GROUPING_PATTERN, value);
+        // donot override the default if grouping pattern is incorrect.
+        if (!parseGroupingPattern(value))
+            return;
+    }
+
+    //----------------------------------
+    //  groupingSeparator
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  The character or string used for the grouping separator.
+     *
+     *
The value of this property is used as the grouping
+     *  separator when validating numbers.  This
+     *  property is initially set based on the locale that is selected
+     *  when the validator object is constructed.

+     *
+     *  @throws TypeError if this property is assigned a null value.
+     *
+     *  @default dependent on the locale and operating system.
+     *
+     *  @see #validate()
+     *  @see #groupingPattern
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get groupingSeparator():String
+    {
+        return getBasicProperty(properties, GROUPING_SEPARATOR);
+    }
+
+    public function set groupingSeparator(value:String):void
+    {
+        setBasicProperty(properties, GROUPING_SEPARATOR, value);
+    }
+
+    //----------------------------------
+    //  maxValue
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the maxValue property.
+     */
+    private var _maxValue:Number;
+
+    /**
+     *  @private
+     */
+    protected var maxValueOverride:Number;
+
+    [Inspectable(category="General", defaultValue="null")]
+    [Bindable("change")]
+
+    /**
+     *  Maximum value for a valid number. A value of NaN means there is no
+     *  maximum.
+     *
+     *  @default NaN
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get maxValue():Number
+    {
+        return _maxValue;
+    }
+
+    /**
+     *  @private
+     */
+    public function set maxValue(value:Number):void
+    {
+        maxValueOverride = value;
+
+        _maxValue = value;
+        update();
+    }
+
+    //----------------------------------
+    //  minValue
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the minValue property.
+     */
+    private var _minValue:Number;
+
+    /**
+     *  @private
+     */
+    protected var minValueOverride:Number;
+
+    [Inspectable(category="General", defaultValue="null")]
+    [Bindable("change")]
+
+    /**
+     *  Minimum value for a valid number. A value of NaN means there is no
+     *  minimum.
+     *
+     *  @default NaN
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get minValue():Number
+    {
+        return _minValue;
+    }
+
+    public function set minValue(value:Number):void
+    {
+        minValueOverride = value;
+
+        _minValue = value;
+        update();
+    }
+
+    //----------------------------------
+    //  negativeSymbol
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  The negative symbol to be used when validating negative values.
+     *
+     *
This symbol is used when validating a negative number.
+     *  This is read-only property as not all operating systems allow
+     *  customizing of this property.

+     *
+     *
 This property is set to a default value specified by the locale.

+     *
+     *  @see #negativeNumberFormat
+     *  @see #validate()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get negativeSymbol():String
+    {
+        return getBasicProperty(properties, NEGATIVE_SYMBOL);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: Errors
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  decimalPointCountError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the decimalPointCountError property.
+     */
+    private var _decimalPointCountError:String;
+
+    /**
+     *  @private
+     */
+    protected 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."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get decimalPointCountError():String
+    {
+        return _decimalPointCountError;
+    }
+
+    public function set decimalPointCountError(value:String):void
+    {
+        decimalPointCountErrorOverride = value;
+
+        _decimalPointCountError = value ? value :
+              resourceManager.getString("validators", "decimalPointCountError");
+    }
+
+    //----------------------------------
+    //  fractionalDigitsError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the fractionalDigitsError property.
+     */
+    private var _fractionalDigitsError:String;
+
+    /**
+     *  @private
+     */
+    protected var fractionalDigitsErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when fraction digits exceeds the value specified
+     *  by the fractionalDigits property.
+     *
+     *  @default "The amount entered has too many digits beyond the decimal
+     *  point."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get fractionalDigitsError():String
+    {
+        return _fractionalDigitsError;
+    }
+
+    public function set fractionalDigitsError(value:String):void
+    {
+        fractionalDigitsErrorOverride = value;
+
+        _fractionalDigitsError = value ? value :
+            resourceManager.getString("validators", "fractionalDigitsError");
+    }
+
+    //----------------------------------
+    //  greaterThanMaxError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the exceedsMaxError property.
+     */
+    private var _greaterThanMaxError:String;
+
+    /**
+     *  @private
+     */
+    protected var greaterThanMaxErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value exceeds the maxValue property.
+     *
+     *  @default "The number entered is too large."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get greaterThanMaxError():String
+    {
+        return _greaterThanMaxError;
+    }
+
+    /**
+     *  @private
+     */
+    public function set greaterThanMaxError(value:String):void
+    {
+        greaterThanMaxErrorOverride = value;
+
+        _greaterThanMaxError = value ? value :
+                   resourceManager.getString("validators", "exceedsMaxErrorNV");
+    }
+
+    //----------------------------------
+    //  groupingSeparationError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the groupingSeparationError property.
+     */
+    private var _groupingSeparationError:String;
+
+    /**
+     *  @private
+     */
+    protected var groupingSeparationErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the grouping separator is in incorrect location.
+     *
+     *  @default "The number digits grouping is not following the grouping
+     *  pattern."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get groupingSeparationError():String
+    {
+        return _groupingSeparationError;
+    }
+
+    public function set groupingSeparationError(value:String):void
+    {
+        groupingSeparationErrorOverride = value;
+
+        _groupingSeparationError = value ? value :
+            resourceManager.getString("validators", "groupingSeparationError");
+    }
+
+    //----------------------------------
+    //  invalidCharError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the invalidCharError property.
+     */
+    private var _invalidCharError:String;
+
+    /**
+     *  @private
+     */
+    protected var invalidCharErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value contains invalid characters.
+     *
+     *  @default The input contains invalid characters."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get invalidCharError():String
+    {
+        return _invalidCharError;
+    }
+
+    /**
+     *  @private
+     */
+    public function set invalidCharError(value:String):void
+    {
+        invalidCharErrorOverride = value;
+
+        _invalidCharError = value ? value :
+            resourceManager.getString("validators", "invalidCharError");
+    }
+
+    //----------------------------------
+    //  invalidFormatCharsError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the invalidFormatCharsError property.
+     */
+    private var _invalidFormatCharsError:String;
+
+    /**
+     *  @private
+     */
+    protected 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."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get invalidFormatCharsError():String
+    {
+        return _invalidFormatCharsError;
+    }
+
+    public function set invalidFormatCharsError(value:String):void
+    {
+        invalidFormatCharsErrorOverride = value;
+
+        _invalidFormatCharsError = value ? value :
+            resourceManager.getString("validators", "invalidFormatCharsError");
+    }
+
+    //----------------------------------
+    //  lessThanMinError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the lowerThanMinError property.
+     */
+    private var _lessThanMinError:String;
+
+    /**
+     *  @private
+     */
+    protected var lessThanMinErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is less than the minValue.
+     *
+     *  @default "The amount entered is too small."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get lessThanMinError():String
+    {
+        return _lessThanMinError;
+    }
+
+    public function set lessThanMinError(value:String):void
+    {
+        lessThanMinErrorOverride = value;
+
+        _lessThanMinError = value ? value :
+            resourceManager.getString("validators", "lowerThanMinError");
+    }
+
+    //----------------------------------
+    //  localeUndefinedError
+    //----------------------------------
+
+    private var _localeUndefinedError:String;
+    /**
+     *  @private
+     */
+    protected var localeUndefinedErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+    /**
+     *  Error message when the locale is undefined or is not available.
+     *
+     *  @default "Locale is undefined."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get localeUndefinedError():String
+    {
+        return _localeUndefinedError;
+    }
+
+    public function set localeUndefinedError(value:String):void
+    {
+        localeUndefinedErrorOverride = value;
+
+        _localeUndefinedError = value ? value :
+            resourceManager.getString("validators", "localeUndefinedError");
+    }
+
+    //----------------------------------
+    //  negativeError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the negativeError property.
+     */
+    private var _negativeError:String;
+
+    /**
+     *  @private
+     */
+    protected 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."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get negativeError():String
+    {
+        return _negativeError;
+    }
+
+    public function set negativeError(value:String):void
+    {
+        negativeErrorOverride = value;
+
+        _negativeError = value ? value :
+                       resourceManager.getString("validators", "negativeError");
+    }
+
+    //----------------------------------
+    //  negativeSymbolError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the negativeSymbolError property.
+     */
+    private var _negativeSymbolError:String;
+
+    /**
+     *  @private
+     */
+    protected var negativeSymbolErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the negative symbol is repeated or is in wrong place.
+     *
+     *  @default "The negative symbol is repeated or not in right place."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get negativeSymbolError():String
+    {
+        return _negativeSymbolError;
+    }
+
+    public function set negativeSymbolError(value:String):void
+    {
+        negativeSymbolErrorOverride = value;
+
+        _negativeSymbolError = value ? value :
+            resourceManager.getString("validators", "negativeSymbolError");
+    }
+
+    //----------------------------------
+    //  notAnIntegerError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the integerError property.
+     */
+    private var _notAnIntegerError:String;
+
+    /**
+     *  @private
+     */
+    protected var notAnIntegerErrorOverride: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."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get notAnIntegerError():String
+    {
+        return _notAnIntegerError;
+    }
+
+    public function set notAnIntegerError(value:String):void
+    {
+        notAnIntegerErrorOverride = value;
+
+        _notAnIntegerError = value ? value :
+            resourceManager.getString("validators", "integerError");
+    }
+
+    //----------------------------------
+    //  parseError
+    //----------------------------------
+
+    private var _parseError:String;
+    /**
+     *  @private
+     */
+    protected var parseErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+    /**
+     *  Error message when number could not be parsed.
+     *
+     *  @default "The input string could not be parsed."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get parseError():String
+    {
+        return _parseError;
+    }
+
+    /**
+     *  @private
+     */
+    public function set parseError(value:String):void
+    {
+        parseErrorOverride = value;
+
+        _parseError = value ? value :
+            resourceManager.getString("validators", "parseError");
+    }
+
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Create underlying formatter object for currency or number validator.
+     *  This method has the common code that is needed by both currency and
+     *  number validator object's createWorkingInstance().
+     *
+     *
 Create locale specific formatter object using localeStyle property.
+     *  If localeStyle is null, this method sets fallbackLastOperationStatus to
+     *  LOCALE_UNDEFINED_ERROR and returns.
+     *  If localeStyle is specified and fallback is enforced, then fallback
+     *  formatter object is created using "en-US" locale. Otherwise creates
+     *  the flash.globalization formatter. The formatter properties are updated
+     *  with the user overriden values.

+     *
+     *  @param validatorType An integer specifying currency or number validator.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     *
+     */
+    mx_internal function createWorkingInstanceCore(validatorType:int):void
+    {
+        // release this array as it contains symbols based on previous locale
+        // grouping pattern.
+        groupingPatternSymbols = null;
+
+        if (validatorType == NUMBER_VALIDATOR_TYPE)
+            g11nWorkingInstance
+            = new spark.formatters.NumberFormatter();
+        else if (validatorType == CURRENCY_VALIDATOR_TYPE)
+            g11nWorkingInstance
+            = new spark.formatters.CurrencyFormatter();
+
+        if (!g11nWorkingInstance)
+        {
+            throw new Error("Internal failure: " +
+                "spark formatter creation failure.");
+        }
+        g11nWorkingInstance.enforceFallback = enforceFallback;
+        g11nWorkingInstance.setStyle("locale", localeStyle);
+
+        if (g11nWorkingInstance.lastOperationStatus
+            != LastOperationStatus.UNSUPPORTED_ERROR)
+        {
+            properties = g11nWorkingInstance
+            propagateBasicProperties(g11nWorkingInstance);
+            return;
+        }
+
+    }
+
+    /**
+     *  @private
+     *  Return the actual locale id name.
+     *
+     *
 This method gets the actual locale id name from the internal
+     *  formatter object. If the formatter object is not available, returns
+     *  "en-US" as the ultimate fallback locale id name.

+     *
+     *  @param validatorType  int having the validator type: currency or number
+     *  @returns String Actual locale id name
+     *
+     */
+    mx_internal function getActualLocaleIDName(validatorType:int):String
+    {
+        if (g11nWorkingInstance)
+        {
+            return (validatorType == NUMBER_VALIDATOR_TYPE)
+            ? (g11nWorkingInstance
+                as spark.formatters.NumberFormatter).actualLocaleIDName
+                : (g11nWorkingInstance
+                    as spark.formatters.CurrencyFormatter).actualLocaleIDName;
+        }
+            // Flex binding allows a situation of getting actual locale id name even
+            // before createWorkingInstance() is called.
+        else
+        {
+            fallbackLastOperationStatus =
+                LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+    }
+
+    /**
+     *  @private
+     *  Load the error strings overrides.
+     */
+    mx_internal function loadChangedResources():void
+    {
+        allowNegative = allowNegativeOverride;
+        domain = domainOverride;
+        maxValue = maxValueOverride;
+        minValue = minValueOverride;
+        decimalPointCountError = decimalPointCountErrorOverride;
+        greaterThanMaxError = greaterThanMaxErrorOverride;
+        notAnIntegerError = notAnIntegerErrorOverride;
+        invalidCharError = invalidCharErrorOverride;
+        invalidFormatCharsError = invalidFormatCharsErrorOverride;
+        lessThanMinError = lessThanMinErrorOverride;
+        negativeError = negativeErrorOverride;
+        negativeSymbolError = negativeSymbolErrorOverride;
+        fractionalDigitsError = fractionalDigitsErrorOverride;
+        groupingSeparationError = groupingSeparationErrorOverride;
+        parseError = parseErrorOverride;
+        localeUndefinedError = localeUndefinedError;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal var groupingPatternSymbols:Array;
+
+    /**
+     *  @private
+     *  Parse the grouping pattern and store the grouping information.
+     *
+     *
 Parse the grouping pattern and store the grouping information. The
+     *  stored grouping information is used by the validateGrouping() method.
+     *

+     *
+     *  @param  value  String specifying grouping pattern.
+     *  @returns Boolean true or false.
+     *
+     */
+    mx_internal function parseGroupingPattern(value:String):Boolean
+    {
+        var last_is_digit:int = 0;
+        var p:String;
+
+        if (!value)
+            return false;
+
+        var length:int = value.length;
+
+        if ((length >= PATTERN_LENGTH_LIMIT) ||
+           (value.charAt(length - 1) == ";"))
+        {
+            return false;
+        }
+        groupingPatternSymbols = new Array();
+        var i:int = 0;
+        while(length)
+        {
+            p = value.charAt(i);
+            var pnum:Number = Number(p);
+
+            if ((!last_is_digit) && ((pnum >= 1) && (pnum <= 9)))
+            {
+                ++i;
+                length--;
+                last_is_digit = 1;
+                groupingPatternSymbols.push(p);
+            }
+            else if ((last_is_digit) && (p == ";"))
+            {
+                ++i;
+                length--;
+                last_is_digit = 0;
+            }
+            else if ((!last_is_digit) && ( p == "*" ))
+            {
+                ++i;
+                length--;
+                groupingPatternSymbols.push(p);
+                if (length == 0)
+                    return true;
+                else
+                {
+                    groupingPatternSymbols.length = 0;
+                    return false;
+                }
+            }
+            else
+            {
+                groupingPatternSymbols.length = 0;
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     *  @private
+     *  Validate the number string portion after the decimal point.
+     *
+     *
 Checks that there are no errors in the number string after the
+     *  decimal. Example errors could be having a grouping separator or using an
+     *  invalid character like non-numeral after the decimal. If
+     *  there are any such errors, this method reports "invalidCharError" and
+     *  returns false. Otherwise, returns true.

+     *
+     *  @param      input        Input string to be checked.
+     *  @param      baseField    The field name of the Object being validated.
+     *  @param      results      Array holding the ValidationResult objects.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    mx_internal function validateDecimalString(input:String,
+                                               baseField:String,
+                                               results:Array):Boolean
+    {
+        if (!input)
+            return true;
+
+        const dindex:int = input.indexOf(decimalSeparator);
+        var c:String;
+
+        if (dindex == -1)
+            return true;
+
+        for (var i:int = input.length - 1; i > dindex; i--)
+        {
+            c = input.charAt(i);
+            if (DECIMAL_DIGITS.indexOf(c) != -1)
+                break;
+        }
+
+        var eindex:int = i;
+        i = dindex + decimalSeparator.length;
+
+        for (; i < eindex; i++)
+        {
+            c = input.charAt(i);
+            if (DECIMAL_DIGITS.indexOf(c) != -1)
+            {
+                continue;
+            }
+            else
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "invalidChar", invalidCharError));
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     *  @private
+     *  Check if a number has correct number of fraction digits.
+     *
+     *
 This method validates if a decimal number has correct number of
+     *  fraction digits as specified by the fractionalDigits
+     *  property. It also checks if a number is supposed to be integer, based
+     *  on the domain property. For fraction digits error, it
+     *  reports the "fractionalDigitsError" message as specified in the
+     *  validator resources bundle. For integer error it reports the
+     *  "integerError" message. If there is an error,
+     *  this method returns false. Otherwise returns
+     *  true.

+     *
+     *  @param      input        Input Number string to be checked.
+     *  @param      baseField    The field name of the Object being validated.
+     *  @param      results      Array holding the ValidationResult objects.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    mx_internal function validateFractionPart(input:String,
+                                              decimalSeparatorIndex:int,
+                                              baseField:String,
+                                              results:Array):Boolean
+    {
+        if (!input)
+            return true;
+
+        // Make sure 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 fractionalDigits.
+        // The input string ALWAYS contains . as decimalseparator as, the caller
+        // converts number obtained from NumberFormatter.parseNumber() to string
+        // and then sends.
+
+        const len:int = input.length;
+
+        if (decimalSeparatorIndex != -1)
+        {
+            var numDigitsAfterDecimal:Number = 0;
+            // we only have a '.'
+            if (input == decimalSeparator)
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "invalidChar", invalidCharError));
+                return false;
+            }
+
+            var i:int = decimalSeparatorIndex + decimalSeparator.length;
+
+            // There may not be any digits after the decimal
+            // if domain is int.
+            if ((i < len) && (DECIMAL_DIGITS.indexOf(input.charAt(i)) != -1))
+            {
+                if (domain == NumberValidatorDomainType.INT)
+                {
+                    results.push(new ValidationResult(
+                        true, baseField,"integer", notAnIntegerError));
+                    return false;
+                }
+            }
+
+            for (;i < len; i++)
+            {
+                ++numDigitsAfterDecimal;
+                // break at ) or - or currency string when validatng fractions.
+                if (DECIMAL_DIGITS.indexOf(input.charAt(i)) == -1)
+                    break;
+
+                // Make sure fractionalDigits is not exceeded.
+                if (fractionalDigits != -1 &&
+                    numDigitsAfterDecimal > fractionalDigits)
+                {
+                    results.push(new ValidationResult(
+                        true, baseField, "fractionalDigits",
+                        fractionalDigitsError));
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+    /**
+     *  @private
+     *  Validate the grouping of digits in the number string.
+     *
+     *
This method is called by both currency and number validator.
+     *  The algorithm is to
+     *  1. Start from the decimal end of the input string.
+     *  2. Find the index 'grSepIndex' of all grouping separators in the input
+     *     string.
+     *  3. Compute the supposed grouping symbol index 'sepIndex' per grouping
+     *     pattern.
+     *  4. Make sure that these two are same.

+     *
+     *  @param input String representing number being validated
+     *  @param end   Index of last character in the input string.
+     *  @returns Boolean true or false depending on grouping check.
+     */
+    mx_internal function validateGrouping(input:String, end:int):Boolean
+    {
+        if (!input)
+            return true;
+
+        // Be lenient on grouping separator. If grouping separator is not used,
+        // treat it as correct. mx:Validators have same behaviour.
+        if (input.indexOf(groupingSeparator) == -1)
+            return true;
+        if (groupingPatternSymbols == null)
+            parseGroupingPattern(groupingPattern);
+        const len:int = groupingPatternSymbols.length;
+
+        var j:int = 0;
+        var grPatNum:int = 0;
+        var sepIndex:int = end;
+        var i:int = 0;
+
+        while (sepIndex > 0)
+        {
+            var grPat:String;
+            // lastIndexOf() method searches upto including second parameter.
+            // Hence decrement sepIndex for next iteration if a separator
+            // symbol is found.
+            var grSepIndex:int = input.lastIndexOf(groupingSeparator, sepIndex);
+
+            if (j < len)
+            {
+                grPat = groupingPatternSymbols[j];
+            }
+            else if (grPat != "*")
+            {
+                grPat = "0";
+                sepIndex = -1; // no more checking of grouping symbol
+            }
+
+            if (grPat != "*")
+                grPatNum = Number(grPat);
+
+            // grouping separator could be before the actual index. i.e. in case
+            // of 3;3;* 123,3,45,678.56 grouping separator happens before the
+            // exact position.
+            var sepIndexCurrent:int = sepIndex - grPatNum -
+                                      (groupingSeparator.length - 1);
+            // special case: 1234^^^456^^^789, grouping pattern 3;*
+            if ((sepIndexCurrent < 0) && (grSepIndex < 0) &&
+                                               (sepIndex < grPatNum))
+                return true;
+            //enough digits, but no separator.
+            if ((grSepIndex < 0) && (sepIndex >= grPatNum))
+                return false;
+            sepIndex = sepIndexCurrent;
+            // case of 12,,345.56. grSepIndex is 2 and sepIndex = -1
+            if (sepIndex != grSepIndex)
+                return false;
+
+            // increase j to get the next grouping pattern symbol in the array
+            // decrement sepIndex to skip grouping separator already found.
+            j++;
+            sepIndex--;
+        }
+        return true;
+    }
+
+    /**
+     *  @private
+     *  Check if a number string contains invalid characters.
+     *
+     *
 This method validates if a number string has any characters other
+     *  than the caller specified valid characters. Valid characters for numbers
+     *  and currency comprise of digits, decimal separator, grouping separator,
+     *  negative format characters, currency ISO code, currency symbol and white
+     *  space. If any other character is found, then this method returns
+     *  false. Otherwise returns true.

+     *
+     *  @param      input     String representation of number to be validated.
+     *  @param      len       int specifying the length of input
+     *  @param      validChars String containing all valid characters.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+
+    // detect if invalid characters are present in input. Caller supplies the
+    // valid characters.
+    mx_internal function validateInputCharacters(input:String,
+                                                 len:int,
+                                                 validChars:String):Boolean
+    {
+        if (!input)
+            return true;
+
+        for (var i:int = 0; i < len; i++)
+        {
+            const c:String = input.charAt(i);
+            if (validChars.indexOf(c) == -1)
+            {
+                if (GlobalizationUtils.isWhiteSpace(c.charCodeAt(0)))
+                    continue;
+                return true;
+            }
+        }
+
+        return false;
+    }
+    /**
+     *  @private
+     *  Check if input number string has any format or negative symbol errors.
+     *
+     *
 This method validates if an input number string has right format
+     *  and does not have multiple negative symbols.
+     *  If there is an error, this method returns false. Otherwise
+     *  returns true.

+     *
+     *  @param      input        Input Number string to be checked.
+     *  @param      baseField    The field name of the Object being validated.
+     *  @param      results      Array holding the ValidationResult objects.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+
+    // check some common errors.
+    mx_internal function validateNumberFormat(input:String,
+                                         results:Array,
+                                         baseField:String):Boolean
+    {
+        if (!input)
+            return true;
+
+        const len:int = input.length;
+        var c:String;
+
+        if (input.charAt(0) == "(")
+        {
+            // Make sure the last character is a closed parenthesis.
+            if (input.charAt(len - 1) != ")")
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "invalidFormatChars",
+                    invalidFormatCharsError));
+                return false;
+            }
+        }
+        else if (input.charAt(len - 1) == ")")
+        {
+            // Make sure the last character is a closed parenthesis.
+            if (input.charAt(0) != "(")
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "invalidFormatCharsError",
+                    invalidFormatCharsError));
+                return false;
+            }
+        }
+
+        if ((decimalSeparator == groupingSeparator) ||
+            (negativeSymbol == groupingSeparator) ||
+            (decimalSeparator == negativeSymbol))
+        {
+            results.push(new ValidationResult(
+               true, baseField, "invalidFormatChars", invalidFormatCharsError));
+            return false;
+        }
+        // handle "-." special case
+        else if (input == (negativeSymbol + decimalSeparator))
+        {
+            results.push(new ValidationResult(
+                true, baseField, "invalidChar", invalidCharError));
+            return false;
+        }
+        // handle "(.)" special case
+        else if (input == ("(" + decimalSeparator + ")"))
+        {
+            results.push(new ValidationResult(
+                true, baseField, "invalidChar", invalidCharError));
+            return false;
+        }
+        else if (input.indexOf(negativeSymbol) !=
+                 input.lastIndexOf(negativeSymbol))
+        {
+
+            results.push(new ValidationResult(
+                    true, baseField, "negativeSymbol", negativeSymbolError));
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     *  @private
+     *  Check if input number can be negative depending on allowNegative
+     *  property.
+     *
+     *
 Checks if input number can be negative based on the
+     *  allowNegative property. If allowNegative is
+     *  false and number is negative, this method reports "negativeError" and
+     *  returns false. Otherwise, returns true.

+     *
+     *  @param      inputNum     Input Number string to be checked.
+     *  @param      baseField    The field name of the Object being validated.
+     *  @param      results      Array holding the ValidationResult objects.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    mx_internal function validateNumberNegativity(inputNum:Number,
+                                                  baseField:String,
+                                                  results:Array):Boolean
+    {
+        if (inputNum < 0)
+        {
+            // Check if negative input is allowed.
+            if (!allowNegative)
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "negative", negativeError));
+                return false;
+            }
+        }
+        return true;
+    }
+    /**
+     *  @private
+     *  Check if a number is in a range specified by the user.
+     *
+     *
 This method validates if a number is in the range specified by the
+     *  user. The minValue and maxValue properties define the range. If the
+     *  number is not in the range, then this method reports either
+     *  "lowerThanMinError" or "exceedsMaxError". If there is a range error,
+     *  this returns false. Otherwise returns
+     *  true.

+     *
+     *  @param      num     Input Number string to be checked.
+     *  @param      baseField    The field name of the Object being validated.
+     *  @param      results      Array holding the ValidationResult objects.
+     *
+     *  @return     Boolean true if no error otherwise false.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    mx_internal function validateNumberRange(num:Number,
+                                           baseField:String,
+                                           results:Array):Boolean
+    {
+        const maxValue:Number = Number(maxValue);
+        const minValue:Number = Number(minValue);
+        if (!isNaN(minValue) || !isNaN(maxValue))
+        {
+            if (!isNaN(minValue) && (num < minValue))
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "lowerThanMin", lessThanMinError));
+                return false;
+            }
+
+            if (!isNaN(maxValue) && (num > maxValue))
+            {
+                results.push(new ValidationResult(
+                    true, baseField, "exceedsMax", greaterThanMaxError));
+                return false;
+            }
+        }
+        return true;
+    }
+}
+}


Load Windmill.swf in the correct SecurityDomain, and pass script-access domains up to Windmill so it can give access to the API.

--- flash/org/windmill/WMBootstrap.as
+++ flash/org/windmill/WMBootstrap.as
@@ -19,22 +19,24 @@
   import flash.net.URLRequest;
   import flash.events.Event;
   import flash.system.ApplicationDomain;
+  import flash.system.SecurityDomain;
   import flash.system.LoaderContext;

   public class WMBootstrap {
-    public static var windmillLibPath:String = '/flash/org/windmill/Windmill.swf';
-    public static function init(context:*):void {
+    public static var windmillLibPath:String = '/flash/org/windmill/Windmill.swf';
+    public static var wm:*;
+    public static function init(context:*, domains:* = null):void {
       var loader:Loader = new Loader();
       var url:String = WMBootstrap.windmillLibPath;
       var req:URLRequest = new URLRequest(url);
       var con:LoaderContext = new LoaderContext(false,
-          ApplicationDomain.currentDomain);
+          ApplicationDomain.currentDomain,
+          SecurityDomain.currentDomain);
       loader.contentLoaderInfo.addEventListener(
           Event.COMPLETE, function ():void {
-        var Windmill:*;
-        Windmill = ApplicationDomain.currentDomain.getDefinition(
+        wm = ApplicationDomain.currentDomain.getDefinition(
             "org.windmill.Windmill") as Class;
-        Windmill.init({ context: context });
+        wm.init({ context: context, domains: domains });
       });
       loader.load(req, con);
     }


Moved locatorLookupPriority to be a more obvious top-level var.

--- flash/org/windmill/WMExplorer.as
+++ flash/org/windmill/WMExplorer.as
@@ -25,6 +25,17 @@
   import flash.external.ExternalInterface;

   public class WMExplorer {
+    // This is the list of attrs we like to use for the
+    // locators, in order of preference
+    // FIXME: Need to add some regex fu for pawing through
+    // text containers for Flash's janky anchor-tag impl
+    private static var locatorLookupPriority:Array = [
+      'automationId',
+      'id',
+      'name',
+      'label'
+    ];
+
     // Sprite which gets superimposed on the moused-over element
     // and provides the border effect
     private static var borderSprite:Sprite = new Sprite();
@@ -66,13 +77,8 @@
     public static function select(e:MouseEvent):void {
       var item:* = e.target;
       var expr:String = '';
-      // Look for these items, in this priority
-      var locatorPriority:Array = [
-        'automationId',
-        'id',
-        'name',
-        'label'
-      ];
+      // Attrs to look for, ordered by priority
+      var locatorPriority:Array = WMExplorer.locatorLookupPriority;
       do {
         for each (var lookup:String in locatorPriority) {
           // If we find one of the lookuup keys, prepend


Transferred from the Adobe Open Source Subversion Repository

Revision: 18072
Author:   chiedozi@adobe.com
Date:     2010-10-07T21:09:04.099363Z

Log Message:
-----------
PARB Changes to ViewNavigator feature set.  Changes summarized below:

View
active getter renamed to isActive
Removed context property from View and moved it to ViewNavigator

ViewNavigator
context property is now typed Object
navigationStack property now mx_internal in ViewNavigatorBase
factory parameter for push operations renamed to  viewClass
NavigationStack push and pop api names changed to match ViewNavigator methods
active getter renamed isActive
viewNavigator no longer dispatches a COMPLETE event
defaultTransitions are no longer skin parts.  They are now  mx_internal vars.

TabbedViewNavigator
No longer dispatches complete, instead dispatches IndexChangeEvent.CHANGE

ViewProxy
ViewProxy renamed to ViewDescriptor
persistedData renamed to persistenceData

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/ContainerDestructionPolicy.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as</path>
<path kind="dir" action="M">/private/flex/sdk/branches/hero_private</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as" copyfrom-rev="18044" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewDescriptor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as
@@ -45,8 +45,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    // TODO (chiedozi): PARB constructor params
-    public function ViewReturnObject(object:Object, context:String)
+    public function ViewReturnObject(object:Object = null, context:Object = null)
     {
     	super();

@@ -75,8 +74,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    // TODO (chiedozi): PARB - should this be an object?
-    public var context:String = null;
+    public var context:Object = null;

     //----------------------------------
     //  object


Transferred from the Adobe Open Source Subversion Repository

Revision: 19325
Author:   clucier@adobe.com
Date:     2010-12-13T20:17:04.998196Z

Log Message:
-----------
We now disable background processing (disable layout) during mobile view transitions.  Added mode to PerfReporter such that FPS is computed via ENTER_FRAME events instead of RENDER (was a pain to have to invoke stage.invalidate() at all the right places, for interval based animations). Disabled frameRate zooming in ViewNavigator.

QE notes: None
Doc notes: None
Bugs: SDK-28657, SDK-28755
Reviewer: Chiedo
Tests run: Checkin, TransitionTests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/CrossFadeViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/PerfLib/src/perflib/impl/PerfReporter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ZoomViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TransitionTests/src/TransitionTests.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/PerfLib/src/perflib/IPerfReporter.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/CrossFadeViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/CrossFadeViewTransition.as
@@ -145,12 +145,11 @@
         transitionGroup.validateNow();

         // Construction fade animation sequence.
-        var animation:Animate = new Animate();
+        var animation:Animate = new Animate(transitionGroup);
         var vector:Vector.<MotionPath> = new Vector.<MotionPath>();
         vector.push(new SimpleMotionPath("alpha", 1, 0));
         animation.motionPaths = vector;
         animation.easer = easer;
-        animation.targets = [transitionGroup];
         animation.duration = duration;

         return animation;


def: 5862 unify CRs and CRLFs before breaking into lines

git-svn-id: 3f608e5a9a704dd448217c0a64c508e7f145cfa1@90440 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- plugins/closedCaptionsPlugin/src/com/kaltura/kdpfl/plugin/component/ClosedCaptions.as
+++ plugins/closedCaptionsPlugin/src/com/kaltura/kdpfl/plugin/component/ClosedCaptions.as
@@ -172,7 +172,13 @@
 			function parseSRT(e:Event):void {
 				try {
 					if (_captionsURLLoader.data) {
-						var lines:Array = _captionsURLLoader.data.split("\n");
+						var loadedText:String = _captionsURLLoader.data;
+						// unify CRs (\r) and CRLFs (\r\n) - make them all CRLFs
+						loadedText = loadedText.replace(/^(\r)\n/g, "\r\n");
+						// replace all CRLFs with CRs
+						loadedText = loadedText.replace(/\r\n/g, "\r");
+						// split on CRs
+						var lines:Array = loadedText.split("\r");
 						var currLine:CCLine = null;
 						_currentCCFile = new Array();
 						var ccLineInd:int = 0;


worked on fine-grained security concept

worked on fine-grained security concept

git-svn-id: 27326a786375daad9d33dc990c6f272e4c8f567c@1393 fda5f131-174c-0410-8613-e0905860106b

--- org.openwms/trunk/org.openwms.common/org.openwms.common.flex.lib/src/main/flex/org/openwms/web/flex/client/common/model/CommonModelLocator.as
+++ org.openwms/trunk/org.openwms.common/org.openwms.common.flex.lib/src/main/flex/org/openwms/web/flex/client/common/model/CommonModelLocator.as
@@ -38,64 +38,64 @@
      */
     public class CommonModelLocator {

-        private var registered : Boolean = false;
+        private var registered:Boolean = false;
         // --------------------------------------------------------------------
         // General stuff
         // --------------------------------------------------------------------
         /**
          * Date format including the time.
          */
-        public static const DT_FORMAT_STRING : String = "DD.MM.YYYY HH:NN:SS";
+        public static const DT_FORMAT_STRING:String = "DD.MM.YYYY HH:NN:SS";
         /**
          * Date format without timestamp.
          */
-        public static const SIMPLE_DT_FORMAT : String = "DD.MM.YYYY";
+        public static const SIMPLE_DT_FORMAT:String = "DD.MM.YYYY";
         /**
          * A DateFormatter that uses the DT_FORMAT_STRING.
          */
-        public const dateTimeFormatter : DateFormatter = new DateFormatter();
+        public const dateTimeFormatter:DateFormatter = new DateFormatter();
         /**
          * A DateFormatter that uses the SIMPLE_DT_FORMAT.
          */
-        public const dateFormatter : DateFormatter = new DateFormatter();
+        public const dateFormatter:DateFormatter = new DateFormatter();
         /**
          * Collection of all TransportUnitTypes.
          */
-        public var allTransportUnitTypes : ArrayCollection = new ArrayCollection();
+        public var allTransportUnitTypes:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all TransportUnits.
          */
-        public var allTransportUnits : ArrayCollection = new ArrayCollection();
+        public var allTransportUnits:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all Locations.
          */
-        public var allLocations : ArrayCollection = new ArrayCollection();
+        public var allLocations:ArrayCollection = new ArrayCollection();
         /**
          * Collection of all LocationTypes.
          */
-        public var allLocationTypes : ArrayCollection = new ArrayCollection();
+        public var allLocationTypes:ArrayCollection = new ArrayCollection();
         // --------------------------------------------------------------------
         // LocationGroupView
         // --------------------------------------------------------------------
         /**
          * Collection of all LocationGroups.
          */
-        public var allLocationGroups : ArrayCollection = new ArrayCollection();
+        public var allLocationGroups:ArrayCollection = new ArrayCollection();
         /**
          * Generated Tree of all groups.
          */
-        public var locationGroupTree : TreeNode;
-        public static const WIDTH_LOCATION_GROUP_NAME : Number = 60;
+        public var locationGroupTree:TreeNode;
+        public static const WIDTH_LOCATION_GROUP_NAME:Number = 60;

         // --------------------------------------------------------------------
         // LocationView
         // --------------------------------------------------------------------
-        public static const WIDTH_LOCATION : Number = 80;
+        public static const WIDTH_LOCATION:Number = 80;

         // --------------------------------------------------------------------
         // TransportUnitView
         // --------------------------------------------------------------------
-        public static const WIDTH_BARCODE : Number = 80;
+        public static const WIDTH_BARCODE:Number = 80;

         /**
          * Constructor.
@@ -120,7 +120,7 @@
             registered = true;
         }

-        private function fireEvent(e : Event) : void {
+        private function fireEvent(e:Event):void {
             trace("Fire coll changed event");
             dispatchEvent(new LocationGroupEvent(LocationGroupEvent.COLLECTION_REFRESHED));
         }


correctly handle ADTS frame overlapping between PES packets, in case we have only one ADTS frame per PES related to #135

--- src/org/mangui/hls/demux/TSDemuxer.as
+++ src/org/mangui/hls/demux/TSDemuxer.as
@@ -315,6 +315,13 @@
                         Log.debug("TS/AAC:ADTS frame overflow:" + adts_overflow);
                     }
                 }
+            } else {
+                // no frame found, add data to overflow buffer
+                _adtsFrameOverflow = new ByteArray();
+                _adtsFrameOverflow.writeBytes(pes.data, pes.data.position);
+                CONFIG::LOGGING {
+                    Log.debug("TS/AAC:ADTS frame overflow:" + _adtsFrameOverflow.length);
+                }
             }
         };


Simplify layer/table node info fetching.

--- src/com/esri/builder/components/serviceBrowser/supportClasses/ServiceDirectoryNodeFetcher.as
+++ src/com/esri/builder/components/serviceBrowser/supportClasses/ServiceDirectoryNodeFetcher.as
@@ -21,6 +21,7 @@
 import com.esri.builder.components.serviceBrowser.nodes.FolderNode;
 import com.esri.builder.components.serviceBrowser.nodes.GPTaskNode;
 import com.esri.builder.components.serviceBrowser.nodes.LayerNode;
+import com.esri.builder.components.serviceBrowser.nodes.QueryableNode;
 import com.esri.builder.components.serviceBrowser.nodes.RouteLayerNode;
 import com.esri.builder.components.serviceBrowser.nodes.ServerNode;
 import com.esri.builder.components.serviceBrowser.nodes.ServiceDirectoryNode;
@@ -42,13 +43,10 @@

     private var nodes:Array;
     private var nodeFilter:INodeFilter;
-    private var totalLayerNodesToLoad:int;
-    private var layerNodesToLoad:Array;
-    private var totalTableNodesToLoad:int;
-    private var tableNodesToLoad:Array;
-
-    private var allLayersProcessed:Boolean = true;
-    private var allTablesProcessed:Boolean = true;
+    private var totalNodesToLoad:int;
+    private var nodesToLoad:Array;
+
+    private var allNodesProcessed:Boolean = true;

     public function fetch(url:String, nodeFilter:INodeFilter, parent:ServiceDirectoryNode):void
     {
@@ -121,7 +119,7 @@
             }
         }

-        layerNodesToLoad = [];
+        nodesToLoad = [];
         for each (var layer:Object in metadata.layers)
         {
             const layerNode:LayerNode =
@@ -129,11 +127,10 @@
             if (layerNode)
             {
                 layerNode.token = token;
-                layerNodesToLoad.push(layerNode);
-            }
-        }
-
-        tableNodesToLoad = [];
+                nodesToLoad.push(layerNode);
+            }
+        }
+
         for each (var table:Object in metadata.tables)
         {
             const tableNode:TableNode =
@@ -141,120 +138,66 @@
             if (tableNode)
             {
                 tableNode.token = token;
-                tableNodesToLoad.push(tableNode);
-            }
-        }
-
-        if (layerNodesToLoad.length > 0)
-        {
-            allLayersProcessed = false;
-            fetchLayerNodeInfo();
-        }
-        if (tableNodesToLoad.length > 0)
-        {
-            allTablesProcessed = false;
-            fetchTableNodeInfo();
-        }
-
-        if (layerNodesToLoad.length == 0 && tableNodesToLoad.length == 0)
+                nodesToLoad.push(tableNode);
+            }
+        }
+
+        if (nodesToLoad.length > 0)
+        {
+            allNodesProcessed = false;
+            fetchQueryableNodeInfo();
+        }
+
+        if (nodesToLoad.length == 0)
         {
             dispatchNodeFetchComplete();
         }
     }

-    private function fetchLayerNodeInfo():void
-    {
-        totalLayerNodesToLoad = layerNodesToLoad.length;
+    private function fetchQueryableNodeInfo():void
+    {
+        totalNodesToLoad = nodesToLoad.length;
         var urlVars:URLVariables;
         var layerInfoRequest:JSONTask;
-        for each (var layerNode:LayerNode in layerNodesToLoad)
+        for each (var queryableNode:QueryableNode in nodesToLoad)
         {
             urlVars = new URLVariables();
             urlVars.f = "json";
-            layerInfoRequest = new JSONTask(layerNode.internalURL);
+            layerInfoRequest = new JSONTask(queryableNode.internalURL);
             layerInfoRequest.requestTimeout = getValidRequestTimeout();
             layerInfoRequest.token = token;
             layerInfoRequest.execute(urlVars,
-                                     new AsyncResponder(layerInfoRequest_resultHandler,
-                                                        layerNodeInfoRequest_faultHandler,
-                                                        layerNode));
-        }
-    }
-
-    private function fetchTableNodeInfo():void
-    {
-        totalTableNodesToLoad = tableNodesToLoad.length;
-        var urlVars:URLVariables;
-        var tableInfoRequest:JSONTask;
-        for each (var tableNode:TableNode in tableNodesToLoad)
-        {
-            urlVars = new URLVariables();
-            urlVars.f = "json";
-            tableInfoRequest = new JSONTask(tableNode.internalURL);
-            tableInfoRequest.requestTimeout = getValidRequestTimeout();
-            tableInfoRequest.token = token;
-            tableInfoRequest.execute(urlVars,
-                                     new AsyncResponder(tableInfoRequest_resultHandler,
-                                                        tableNodeInfoRequest_faultHandler,
-                                                        tableNode));
-        }
-    }
-
-    private function layerNodeInfoRequest_faultHandler(fault:Fault, token:Object = null):void
-    {
-        layerProcessed();
-    }
-
-    private function tableNodeInfoRequest_faultHandler(fault:Fault, token:Object = null):void
-    {
-        tableProcessed();
-    }
-
-    private function layerProcessed():void
-    {
-        totalLayerNodesToLoad--;
-        if (totalLayerNodesToLoad == 0)
-        {
-            addProcessedLayerNodesAndDispatchFetchComplete();
-        }
-    }
-
-    private function tableProcessed():void
-    {
-        totalTableNodesToLoad--;
-        if (totalTableNodesToLoad == 0)
-        {
-            addProcessedTableNodesAndDispatchFetchComplete();
-        }
-    }
-
-    private function addProcessedLayerNodesAndDispatchFetchComplete():void
-    {
-        for each (var layerNode:LayerNode in layerNodesToLoad)
-        {
-            if (nodeFilter.isApplicable(layerNode))
-            {
-                nodes.push(layerNode);
-            }
-        }
-        allLayersProcessed = true;
-        if (allLayersProcessed && allTablesProcessed)
-        {
-            dispatchNodeFetchComplete();
-        }
-    }
-
-    private function addProcessedTableNodesAndDispatchFetchComplete():void
-    {
-        for each (var tableNode:TableNode in tableNodesToLoad)
-        {
-            if (nodeFilter.isApplicable(tableNode))
-            {
-                nodes.push(tableNode);
-            }
-        }
-        allTablesProcessed = true;
-        if (allLayersProcessed && allTablesProcessed)
+                                     new AsyncResponder(queryableNodeInfoRequest_resultHandler,
+                                                        queryableNodeInfoRequest_faultHandler,
+                                                        queryableNode));
+        }
+    }
+
+    private function queryableNodeInfoRequest_faultHandler(fault:Fault, token:Object = null):void
+    {
+        nodeProcessed();
+    }
+
+    private function nodeProcessed():void
+    {
+        totalNodesToLoad--;
+        if (totalNodesToLoad == 0)
+        {
+            addProcessedNodesAndDispatchFetchComplete();
+        }
+    }
+
+    private function addProcessedNodesAndDispatchFetchComplete():void
+    {
+        for each (var queryableNode:QueryableNode in nodesToLoad)
+        {
+            if (nodeFilter.isApplicable(queryableNode))
+            {
+                nodes.push(queryableNode);
+            }
+        }
+        allNodesProcessed = true;
+        if (allNodesProcessed)
         {
             dispatchNodeFetchComplete();
         }
@@ -267,16 +210,10 @@
                                                nodes));
     }

-    private function layerInfoRequest_resultHandler(metadata:Object, layerNode:LayerNode):void
-    {
-        layerNode.metadata = metadata;
-        layerProcessed();
-    }
-
-    private function tableInfoRequest_resultHandler(metadata:Object, tableNode:TableNode):void
-    {
-        tableNode.metadata = metadata;
-        tableProcessed();
+    private function queryableNodeInfoRequest_resultHandler(metadata:Object, queryableNode:QueryableNode):void
+    {
+        queryableNode.metadata = metadata;
+        nodeProcessed();
     }

     private function nodeInfoRequest_faultHandler(fault:Fault, token:Object = null):void


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/olap/aggregators/MinAggregator.as
+++ frameworks/projects/advancedgrids/src/mx/olap/aggregators/MinAggregator.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 16798
Author:   chiedozi@adobe.com
Date:     2010-07-02T18:29:32.766944Z

Log Message:
-----------
Fixed a bug where navigationContent and navigationGroupLayout were not updated in ViewNavigator when a view changed those properties.

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
@@ -1221,6 +1221,10 @@
                 actionContentInvalidated = true;
             else if (property == "actionGroupLayout")
                 actionGroupLayoutInvalidated  = true;
+			else if (property == "navigationContent")
+				navigationContentInvalidated = true;
+			else if (property == "navigationGroupLayout")
+				navigationGroupLayoutInvalidated  = true;

             invalidateProperties();
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 22686
Author:   smgilson@adobe.com
Date:     2011-09-22T16:55:28.367453Z

Log Message:
-----------
Add ASDoc examples for View and ViewNavigator.as

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExampleHomeView.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExampleSearch.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewExampleHomeView.mxml</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
@@ -146,6 +146,10 @@
  *  @see spark.components.ActionBar
  *  @see spark.components.TabbedViewNavigator
  *  @see spark.transitions.ViewTransitionBase
+ *
+ *  @includeExample examples/ViewNavigatorExample.mxml -noswf
+ *  @includeExample examples/ViewNavigatorExampleHomeView.mxml -noswf
+ *  @includeExample examples/ViewNavigatorExampleSearch.mxml -noswf
  *
  *  @langversion 3.0
  *  @playerversion AIR 2.5
@@ -436,8 +440,8 @@
                 // persistence is enabled.
                 if (canDestroy || clearNavigationStack)
                     destroyViewInstance(navigationStack.topView, !clearNavigationStack);
-				else
-					deactiveView(activeView);
+                else
+                    deactiveView(activeView);
             }
         }

@@ -2003,7 +2007,7 @@
             return;

         // Deactivate the view if it is active
-		deactiveView(currentView);
+        deactiveView(currentView);
         removeElement(currentView);

         // Grab the data from the old view and persist it
@@ -2027,15 +2031,15 @@
     /**
      *  @private
      */
-	private function deactiveView(view:View):void
-	{
-		if (view.isActive)
-			view.setActive(false);
-
-		view.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
-			view_propertyChangeHandler);
-	}
-
+    private function deactiveView(view:View):void
+    {
+        if (view.isActive)
+            view.setActive(false);
+
+        view.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+            view_propertyChangeHandler);
+    }
+
     /**
      *  @private
      */
@@ -2212,7 +2216,7 @@
         if (!backKeyWasPressed && activeView && !activeView.backKeyHandledByView())
         {
             popView();
-        	backKeyWasPressed = true;
+            backKeyWasPressed = true;
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20384
Author:   chiedozi@adobe.com
Date:     2011-02-18T20:01:10.762180Z

Log Message:
-----------
Updated ViewNavigator focus management to use the FocusManager instead of directly manipulating Stage.focus

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan
Tests run:
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
@@ -1711,13 +1711,13 @@
         // If there is no focus or the item that had focus isn't
         // on the display list anymore, update the focus to be
         // the active view or the view navigator
-        var stage:Stage = systemManager.stage;
-        if (!stage.focus || !stage.focus.stage || stage.focus == this)
+        var focusedObject:Object = focusManager.getFocus();
+        if (!focusedObject || !focusedObject.stage || focusedObject == this)
         {
             if (activeView)
-                stage.focus = activeView;
+                focusManager.setFocus(activeView);
             else
-                stage.focus = this;
+                focusManager.setFocus(this);
         }

         // Clear the returned object


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/automation/src/mx/automation/delegates/controls/TextAreaAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/controls/TextAreaAutomationImpl.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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.automation.delegates.controls
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/mobilecomponents/src/spark/styles/metadata/StyleableTextFieldTextStyles.as
+++ frameworks/projects/mobilecomponents/src/spark/styles/metadata/StyleableTextFieldTextStyles.as
@@ -1,25 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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.
-//
-////////////////////////////////////////////////////////////////////////////////

-/**
- *  Color of text in the component, including the component label.
- *
- *  The default value for the Halo theme is 0x0B333C.
- *  The default value for the Spark theme is 0x000000.
- *  The default value for the Mobile theme is 0xFFFFFF.
- *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
 [Style(name="color", type="uint", format="Color", inherit="yes")]

 /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


updated typing on replaceColumnsInHashMap()