Transferred from the Adobe Open Source Subversion Repository

Revision: 20389
Author:   cframpto@adobe.com
Date:     2011-02-18T21:41:41.538316Z

Log Message:
-----------
Prepare and link in the DataGrid examples written by Hans.

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: compiled - need Stephen's asdoc build to verify examples
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridSelectionExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridSimpleExample.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/GridItemRendererExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridRowHeightExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/DefaultGridItemRendererExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridRollOverExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/GridColumnExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/GridItemRendererCustomPrepareExample.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/GridColumnVisibilityExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridInvalidateCellExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/gridClasses/examples/GridItemRendererCustomBindingExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/components/examples/DataGridTypicalItemExample.mxml</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
@@ -103,8 +103,10 @@
  *
  *  @see spark.components.DataGrid
  *  @see spark.components.gridClasses.GridItemRenderer
- *  @see UITextFieldGridItemRenderer
+ *  @see spark.skins.spark.UITextFieldGridItemRenderer
  *
+ *  @includeExample examples/DefaultGridItemRendererExample.mxml
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 2.5


Transferred from the Adobe Open Source Subversion Repository

Revision: 19212
Author:   smgilson@adobe.com
Date:     2010-12-09T15:26:24.477499Z

Log Message:
-----------
ASDoc pass on grid item renderers, and a localization fix for a gridClasses/GridColumn.as member.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridHeaderRenderer.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as
@@ -63,26 +63,37 @@
 [Exclude(name="locale", kind="property")]

 /**
- *   A simple and efficient IGridItemRenderer that displays a single text label.  This
- *   class is the default value for the s:DataGrid itemRenderer property.   It's based
- *   on FTE, the FlashTextEngine, It is based on FTE, the “FlashTextEngine”, which supports
- *   high-quality international typography and font embedding in the same way as other
- *   Spark controls.
+ *  The DefaultGridItemRenderer class defines simple and efficient
+ *  item renderer that displays a single text label.
+ *  This class is the default value for the DataGrid itemRenderer property.
+ *  This class displays the cell data in a text label using the UIFTETextField control.
+ *  It is based on FTE, the FlashTextEngine,  which supports
+ *  high-quality international typography and font embedding in the same way as other
+ *  Spark controls.
+ *
+ *
DefaultGridItemRenderer inherits its layoutDirection property
+ *  from its parent.
+ *  It should not be set directly.

+ *
+ *
You can control the label text wrapping by using the lineBreak style.
+ *  For example, setting  lineBreak="explicit" and variableRowHeight="false"
+ *  creates fixed height cells whose labels do not wrap.

+ *
+ *
The DefaultGridItemRenderer class is not intended to be subclassed or copied.
+ *  Create custom item renderers based on the  GridItemRenderer class.

+ *
+ *
For the highest performance on Microsoft Windows based applications,
+ *  use the UITextFieldGridItemRenderer.
+ *  This renderer is written in ActionScript and optimized for Windows.

  *
- *
DefaultGridItemRenderer will inherit its layoutDirection
- *   from its parent.  It should not be set directly on
- *   DefaultGridItemRenderer.

- *
- *
Label text wrapping can be controlled with the lineBreak style.  For example
- *   a DataGrid configured like this:
- *   lineBreak="explicit" variableRowHeight="false" yields fixed height
- *   DataGrid cells whose labels do not wrap.

+ *  @see spark.components.DataGrid
+ *  @see spark.components.gridClasses.GridItemRenderer
+ *  @see UITextFieldGridItemRenderer
  *
- *
DefaultGridItemRenderer is not intended to be subclassed or copied, it is
- *   effectively final.  Custom item renderers can be created in MXML with the
- *   GridItemRenderer component.

- *
- *   @see spark.components.gridClasses.GridItemRenderer
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 public class DefaultGridItemRenderer extends UIFTETextField implements IGridItemRenderer, IStyleClient
 {


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@1268365 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/NumericStepper.as
+++ frameworks/projects/mx/src/mx/controls/NumericStepper.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2003-2007 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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Fixed bug where DataFilters didn't work with line chart grouping feature.

--- WeaveUISpark/src/weave/visualization/plotters/ParallelCoordinatesPlotter.as
+++ WeaveUISpark/src/weave/visualization/plotters/ParallelCoordinatesPlotter.as
@@ -32,6 +32,7 @@
 	import weave.api.data.IQualifiedKey;
 	import weave.api.data.ISimpleGeometry;
 	import weave.api.getCallbackCollection;
+	import weave.api.linkSessionState;
 	import weave.api.newDisposableChild;
 	import weave.api.newLinkableChild;
 	import weave.api.primitives.IBounds2D;
@@ -79,6 +80,10 @@
 			columns.childListCallbacks.addImmediateCallback(this, handleColumnsListChange);
 			xColumns.childListCallbacks.addImmediateCallback(this,handleColumnsListChange);

+			linkSessionState(_filteredXData.filter, filteredKeySet.keyFilter);
+			linkSessionState(_filteredYData.filter, filteredKeySet.keyFilter);
+			registerLinkableChild(this, xData, updateFilterEquationColumns);
+			registerLinkableChild(this, yData, updateFilterEquationColumns);

 			lineStyle.color.internalDynamicColumn.addImmediateCallback(this, handleColor, true);
 			getCallbackCollection(colorDataWatcher).addImmediateCallback(this, updateFilterEquationColumns, true);
@@ -123,10 +128,12 @@

 		public const enableGroupBy:LinkableBoolean = registerSpatialProperty(new LinkableBoolean(false), updateFilterEquationColumns);
 		public const groupBy:DynamicColumn = newSpatialProperty(DynamicColumn, updateFilterEquationColumns);
-		public const xData:DynamicColumn = newSpatialProperty(DynamicColumn, updateFilterEquationColumns);
-		public const yData:DynamicColumn = newSpatialProperty(DynamicColumn, updateFilterEquationColumns);
+		public function get xData():DynamicColumn { return _filteredXData.internalDynamicColumn; }
+		public function get yData():DynamicColumn { return _filteredYData.internalDynamicColumn; }
 		public const xValues:LinkableString = newSpatialProperty(LinkableString, updateFilterEquationColumns);

+		private const _filteredXData:FilteredColumn = newSpatialProperty(FilteredColumn);
+		private const _filteredYData:FilteredColumn = newSpatialProperty(FilteredColumn);
 		private const _keySet_groupBy:KeySet = newDisposableChild(this, KeySet);

 		private var _yColumns:Array = [];
@@ -233,8 +240,8 @@
 				var col:EquationColumn = columns.requestObject(columns.generateUniqueName("line"), EquationColumn, false);
 				col.delayCallbacks();
 				col.variables.requestObjectCopy("keyCol", groupBy);
-				col.variables.requestObjectCopy("filterCol", xData);
-				col.variables.requestObjectCopy("dataCol", yData);
+				col.variables.requestObjectCopy("filterCol", _filteredXData);
+				col.variables.requestObjectCopy("dataCol", _filteredYData);

 				col.setMetadata(ColumnMetadata.TITLE, value);
 				col.setMetadata(ColumnMetadata.MIN, '{ getMin(dataCol) }');


Removed debug statement.

Removed debug statement.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@56 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/client/EZGamePanel.as
+++ src/as/com/threerings/ezgame/client/EZGamePanel.as
@@ -84,7 +84,6 @@
      */
     protected function childRemoved (event :Event) :void
     {
-        trace("Child removed: " + event.target);
         if (_ezObj != null) {
             removeListeners(event.target as DisplayObject);
         }


Add better support for early phase seeking.

--- HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
+++ HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
@@ -53,6 +53,8 @@
 		public var _lastSequence:int = 0;
 		public var _lastSequenceManifest:HLSManifestParser = null;

+		public var _pendingStartTime:Number = NaN;
+
 		public function updateLastSequence(newManifest:HLSManifestParser, newSeq:int):void
 		{
 			trace("UPDATING LAST SEQUENCE " + newSeq + " manifest=" + newManifest.fullUrl);
@@ -906,7 +908,10 @@
 			// Force a reload if needed.
 			var manifestResponse:HTTPStreamRequest = issueManifestReloadIfNeeded(quality);
 			if(manifestResponse != null)
+			{
+				_pendingStartTime = time;
 				return manifestResponse;
+			}

 			// Fire any pending best effort.
 			if(_pendingBestEffortRequest)
@@ -914,6 +919,7 @@
 				trace("getFileForTime - Firing pending best effort request: " + _pendingBestEffortRequest);
 				var tmpR:HTTPStreamRequest = _pendingBestEffortRequest;
 				_pendingBestEffortRequest = null;
+				_pendingStartTime = time;
 				return tmpR;
 			}

@@ -925,6 +931,8 @@
 			{
 				if(!isBestEffortActive())
 				{
+					_pendingStartTime = time;
+
 					// We may also need to establish a timebase.
 					trace("getFileForTime - Seeking without timebase; initiating request.");
 					if(getLastSequenceManifest())
@@ -964,6 +972,9 @@
 				}
 			}

+			// If we get here pending start time isn't needed any longer.
+			_pendingStartTime = NaN;
+
 			// Debug to JS.
 			manifest.postToJS();

@@ -1107,6 +1118,13 @@
 			trace("--- getNextFile(" + quality + ")");

 			targetQuality = quality;
+
+			// Switch to getFileForTime if a pending time is present.
+			if(!isNaN(_pendingStartTime))
+			{
+				trace("getNextFile - pending start time, going to getFileForTime");
+				return getFileForTime(_pendingStartTime, quality);
+			}

 			// Fire any pending best effort requests.
 			if(_pendingBestEffortRequest)


attempt to fold JS into PlatformWiper

attempt to fold JS into PlatformWiper

--- frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
+++ frameworks/projects/Effects/as/src/org/apache/flex/effects/PlatformWiper.as
@@ -20,8 +20,15 @@
 package org.apache.flex.effects
 {

-import flash.display.DisplayObject;
-import flash.geom.Rectangle;
+COMPILE::AS3
+{
+    import flash.display.DisplayObject;
+    import flash.geom.Rectangle;
+}
+COMPILE::JS
+{
+    import org.apache.flex.geom.Rectangle;
+}

 import org.apache.flex.core.IDocument;
 import org.apache.flex.core.IUIBase;
@@ -69,6 +76,12 @@
 	private var _target:IUIBase;

     /**
+     *  @private
+     *  The old overflow value.
+     */
+    private var _overflow:String;
+
+    /**
      *  The object that will be clipped.
      *
      *  @langversion 3.0
@@ -78,9 +91,26 @@
      */
     public function set target(value:IUIBase):void
     {
-        if (value == null)
-            DisplayObject(_target).scrollRect = null;
-        _target = value;
+        COMPILE::AS3
+        {
+            if (value == null)
+                DisplayObject(_target).scrollRect = null;
+            _target = value;
+        }
+        COMPILE::JS
+        {
+            if (value == null)
+            {
+                if (_overflow == null)
+                    delete _target.positioner.style.overflow;
+                else
+                    _target.positioner.style.overflow = _overflow;
+            }
+            _target = target;
+            if (value != null) {
+                _overflow = _target.positioner.style.overflow;
+            }
+        }
     }

     /**
@@ -93,7 +123,15 @@
      */
     public function set visibleRect(value:Rectangle):void
     {
-        DisplayObject(_target).scrollRect = value;
+        COMPILE::AS3
+        {
+            DisplayObject(_target).scrollRect = value;
+        }
+        COMPILE::JS
+        {
+            _target.positioner.style.height = value.height.toString() + 'px';
+            _target.positioner.style.overflow = 'hidden';
+        }
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19060
Author:   harishs@adobe.com
Date:     2010-12-06T17:34:15.020965Z

Log Message:
-----------
QE notes: Did checkintests, performed full cyclone run. There were 19 failures in mustella report. QE Judy (Mingzhou Gao and Joann Chung Anderson) confirmed that they are known problems.
Doc notes: As part of Sort and Sortfield updates, the asdoc comments were updated to reflect globalization changes.
Bugs: Fixed sdk-28493, 28691,28494, 28345, 28320, 28387, 28314, 28145
Reviewer: Gordon Smith
Tests run: cyclone, checkintests, bugs testfiles
Is noteworthy for integration: Sort and Sortfield updated with globalization support using the new spark globalization sort classes.
Number and CurrencyValidators support national digits and unicode minus symbols.
groupingPattern property dropped for Number and Currency Validators.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/SortField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ICollectionView.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ISort.as</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/framework/src/mx/collections/ISortField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/collections/Sort.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/advancedgrids/src/mx/olap/OLAPCube.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/collections/SortField.as</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="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/collections</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/treeClasses/HierarchicalCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ListCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/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/advancedgrids/src/mx/olap/DefaultCubeImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/SortTestScript.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/Sort.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ModifiedCollectionView.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/SortTests.mxml</path>

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

--- frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
+++ frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
@@ -34,6 +34,8 @@
 import mx.collections.ICollectionView;
 import mx.collections.IViewCursor;
 import mx.collections.ItemResponder;
+import mx.collections.ISort;
+import mx.collections.ISortField;
 import mx.collections.Sort;
 import mx.collections.SortField;
 import mx.collections.errors.ItemPendingError;
@@ -4728,7 +4730,7 @@
             return;

         var view:ICollectionView = ICollectionView(dataProvider);
-        var sort:Sort = view.sort;
+        var sort:ISort = view.sort;
         if (!sort)
         {
             sortIndex = lastSortIndex = -1;
@@ -4751,7 +4753,7 @@
         }

         // fields.length == 1, so the collection is sorted on a single field.
-        var sortField:SortField = fields[0];
+        var sortField:ISortField = fields[0];
         var n:int = _columns.length;
         for (var i:int = 0; i < n; i++)
         {
@@ -5955,7 +5957,7 @@
          if (!collection.sort || !collection.sort.fields)
          {
              singleColumnSort = true;
-             var sort:Sort = new Sort();
+             var sort:ISort = new Sort();
              sort.fields = [];

              collection.sort = sort;
@@ -5983,7 +5985,7 @@
         }

         column.sortDescending = desc;
-        var field:SortField = new SortField(columnName); // name
+        var field:ISortField = new SortField(columnName); // name
         field.descending = desc;

 //        field.name = column.dataField;
@@ -7958,7 +7960,7 @@
         var columnName:String = event.dataField;
         var columnNumber:int  = event.columnIndex;
         var sortFields:Array;
-        var sort:Sort;
+        var sort:ISort;

         if (!sortableColumns || !columns[columnNumber].sortable)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 18539
Author:   cframpto@adobe.com
Date:     2010-11-11T18:10:32.464611Z

Log Message:
-----------
The default for singleCell, singleRow selectionMode is preserveSelection = true and fix layout code so that changes to the  indicators and column/rowSeperators at runtime are displayed correctly.

QE notes: the code path for the cell selection indicators is different from all the other indicators/seperators so test both paths
Doc notes:
Bugs: SDK-28405, SDK-27969
Reviewer:
Tests run: cyclone
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as
@@ -160,7 +160,7 @@
     //  preserveSelection
     //----------------------------------

-    private var _preserveSelection:Boolean = false;
+    private var _preserveSelection:Boolean = true;

     /**
      *  If true, and selectionMode is
@@ -170,7 +170,7 @@
      *  if the corresponding item is contained in the collection after
      *  the refresh event.
      *
-     *  @default false
+     *  @default true
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 22774
Author:   tkraikit@adobe.com
Date:     2011-09-28T18:38:58.135371Z

Log Message:
-----------
SDK-31412: CalloutButton failure due to underlying bug in ButtonBase (BB) and DropDownController (DDC) interaction where BUTTON_DOWN was being dispatched too late and DDC was not ready to capture the MOUSE_UP event. Moving BUTTON_DOWN dispatch earlier for this specific scenario (mobile, scroller, delayed mouse events due to waiting for possible touch interaction)

QE notes: -
Doc notes: -
Bugs: SDK-31412
Reviewer: glenn, jszeto
Tests run: checkintests, cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -858,17 +858,7 @@

         if (checkForButtonDownConditions)
         {
-            var isCurrentlyDown:Boolean = isDown();
-
-            // Only if down state has changed, do we need to do something
-            if (_downEventFired != isCurrentlyDown)
-            {
-                if (isCurrentlyDown)
-                    dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
-
-                _downEventFired = isCurrentlyDown;
-                checkAutoRepeatTimerConditions(isCurrentlyDown);
-            }
+            dispatchButtonEvents();

             checkForButtonDownConditions = false;
         }
@@ -1127,6 +1117,10 @@
         }
         else
         {
+            // if we're not waiting then commitProperties won't have a chance to run
+            // before we flip flags back; at least dispatch any relevant button events
+            // even if the UI isn't going to reflect the click
+            dispatchButtonEvents();
             mouseUpDeselectTimer_timerCompleteHandler();
         }
     }
@@ -1140,6 +1134,24 @@
         {
             mouseUpDeselectTimer.stop();
             mouseUpDeselectTimer = null;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function dispatchButtonEvents():void
+    {
+        var isCurrentlyDown:Boolean = isDown();
+
+        // Only if down state has changed, do we need to do something
+        if (_downEventFired != isCurrentlyDown)
+        {
+            if (isCurrentlyDown)
+                dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
+
+            _downEventFired = isCurrentlyDown;
+            checkAutoRepeatTimerConditions(isCurrentlyDown);
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 7939
Author:   jszeto@adobe.com
Date:     2009-06-18T00:10:15.473790Z

Log Message:
-----------
Slider PARB Changes

•  remove dataTipOriginalPosition
•  remove dataTipInstance
•  positionDataTip() -> updateDataTip(dataTipInstance:IDataRenderer, initialPosition:Point)

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/spark/components/examples/HSliderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/spark/components/examples/NumericStepperExample.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -125,22 +125,14 @@

     private var animator:Animation = null;

+    private var dataTipInitialPosition:Point;
+
+    private var dataTipInstance:IDataRenderer;
     //--------------------------------------------------------------------------
     //
     // Properties
     //
     //--------------------------------------------------------------------------
-
-	/**
-	 *  The dataTip instance used by subclasses to control its behavior. The instance
-	 *  is non-null only when the dataTip has been popped up.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	protected var dataTipInstance:IDataRenderer;

 	//---------------------------------
     // dataTipformatFunction
@@ -187,17 +179,6 @@
 		return _dataTipFormatFunction;
 	}

-	/**
-	 *  Starting position of the dataTip. Used by subclasses to
-	 *  position the dataTip.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	protected var dataTipOriginalPosition:Point;
-
 	//---------------------------------
     // dataTipPrecision
     //---------------------------------
@@ -353,15 +334,17 @@

     /**
      *  Used to position the data tip when it is visible. Subclasses must implement
-     *  this function and can use the dataTipOriginalPosition and dataTipInstance
-     *  properties.
+     *  this function.
      *
+     *  @param dataTipInstance The dataTip instance to update and position
+     *  @param initialPosition The initial position of the dataTip in the skin
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    protected function positionDataTip():void
+    protected function updateDataTip(dataTipInstance:IDataRenderer, initialPosition:Point):void
     {
 		// Override in the subclasses
     }
@@ -399,7 +382,7 @@
 	        dataTipInstance.data = formatDataTipText(value);

 	        // Force the dataTip to render so that we have the correct size since
-	        // positionDataTip might need the size
+	        // updateDataTip might need the size
 	        var tipAsUIComponent:UIComponent = dataTipInstance as UIComponent;
 	        if (tipAsUIComponent)
 	        {
@@ -408,9 +391,9 @@
 	        								   tipAsUIComponent.getExplicitOrMeasuredHeight());
 	        }

-	        dataTipOriginalPosition = new Point(DisplayObject(dataTipInstance).x,
+	        dataTipInitialPosition = new Point(DisplayObject(dataTipInstance).x,
 	        									DisplayObject(dataTipInstance).y);
-	        positionDataTip();
+	        updateDataTip(dataTipInstance, dataTipInitialPosition);
         }
     }

@@ -440,7 +423,7 @@
 	        dataTipInstance.data = formatDataTipText(pendingValue);

 	        // Force the dataTip to render so that we have the correct size since
-	        // positionDataTip might need the size
+	        // updateDataTip might need the size
 	        var tipAsUIComponent:UIComponent = dataTipInstance as UIComponent;
 	        if (tipAsUIComponent)
 	        {
@@ -448,7 +431,7 @@
 	        	tipAsUIComponent.setActualSize(tipAsUIComponent.getExplicitOrMeasuredWidth(),tipAsUIComponent.getExplicitOrMeasuredHeight());
 	        }

-			positionDataTip();
+			updateDataTip(dataTipInstance, dataTipInitialPosition);
         }

         event.updateAfterEvent();


Implemented public DocumentView::ValidatedDocument method to enable just-in-time validation of the entire document without waiting a frame. This enables rendering on other surfaces and simplifies unit testing.

--- src/reprise/ui/DocumentView.as
+++ src/reprise/ui/DocumentView.as
@@ -252,6 +252,11 @@
 			}
 		}

+		public function validateDocument() : void
+		{
+			validateElements();
+		}
+
 		override public function toString() : String
 		{
 			return name;
@@ -406,6 +411,7 @@

 		protected function validateElements() : void
 		{
+			removeEventListener(Event.ENTER_FRAME, self_enterFrame);
 			//TODO: verify this validation scheme
 			if (m_invalidChildren.length == 0)
 			{
@@ -455,7 +461,6 @@

 		protected function self_enterFrame(event : Event) : void
 		{
-			removeEventListener(Event.ENTER_FRAME, self_enterFrame);
 			validateElements();
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17505
Author:   klin@adobe.com
Date:     2010-08-28T00:02:59.530168Z

Log Message:
-----------
Fixes and some code clean up for DataGrid. These fix issues with how the DataGrid looks when different indicators and separators are null. It also improves the look when the dataProvider is cleared.

GridLayout.as - Fix bug in layoutLinearElements() where we were allowing null values to stay in newVisibleElements. We should shorten the vector instead. Also, I fixed layoutSelectionIndicators() and layoutIndicator() to remove previously cached indicators when the factory is null. Lastly, fixed up layoutRow/ColumnSeparator to return the correct bounds when no item renderer exists. This is used in the case that we clear the dataProvider.
GridDimensions.as - Fix getPadRowBounds() so that it only never uses a negative index when calling getCellX and getColumnWidth.
DataGrid.as - use Grid's clearGridLayoutCache instead of manually clearing the caches.

QE notes: No
Doc notes: No
Bugs: SDK-27602, SDK-27606, SDK-27612
Reviewer: Hans
Tests run: checkintests, DataGrid
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridDimensions.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -1025,10 +1025,7 @@
             if (allStyles || styleManager.isSizeInvalidatingStyle(styleName))
             {
                 grid.invalidateSize();
-                if (grid.layout)
-                    grid.layout.clearVirtualLayoutCache();
-                if (grid.gridDimensions)
-                    grid.gridDimensions.clearTypicalCellWidthsAndHeights();
+                grid.clearGridLayoutCache(true);
             }

             if (allStyles || (styleName == "alternatingRowColors"))


Transferred from the Adobe Open Source Subversion Repository

Revision: 15836
Author:   jszeto@adobe.com
Date:     2010-04-30T00:49:32.357339Z

Log Message:
-----------
Form Feature

- Changed showErrorTip and showErrorSkin from properties to inheriting styles
- Cleanup and organize code
- Add proper skin states

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FocusSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/layouts/FormLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/FormItem.as
+++ frameworks/projects/spark/src/spark/components/FormItem.as
@@ -17,8 +17,6 @@
     import mx.core.IVisualElement;
     import mx.core.UIComponent;
     import mx.events.FlexEvent;
-    import mx.resources.IResourceManager;
-    import mx.resources.ResourceManager;

     import spark.components.supportClasses.TextBase;
     import spark.events.ElementExistenceEvent;
@@ -26,13 +24,9 @@
     /**
      *  TODO
      *  - Remove canvasLayout skin part once FormItemLayout is ready
-     *
-     *
-     *
-     *  ISSUES:
-     *  - Consider turning helpText into a helpContentGroup to allow arbitrary content
-     *
-     *
+     *  - Remove measuredColumnWidths and layoutColumnWidths once
+     *    FormItemLayout and FormLayout are ready
+     *  - Remove implements IFormItem
      */

@@ -60,7 +54,7 @@
         //--------------------------------------------------------------------------

         /**
-         *  Displays this FormItem's label.
+         *   A reference to the visual element that displays this FormItem's label.
          */
         [Bindable] // compatability with Halo FormItem itemLabel property
         [SkinPart(required="false")]
@@ -72,7 +66,9 @@
         [SkinPart(required="false")]
         public var sequenceLabelDisplay:TextBase;

-
+        /**
+         *  A reference to the Group that contains the FormItem's helpContentGroup.
+         */
         [SkinPart(required="false")]
         public var helpContentGroup:Group;

@@ -96,30 +92,15 @@
          *  Each vector item contains the error string from a content element.
          *  If none of the content elements are invalid, then the vector will
          *  be empty.
-         */
-
+         */
         [Bindable(event="elementErrorStringsChanged")]
         public var elementErrorStrings:Vector.<String> = new Vector.<String>;
-
-        //----------------------------------
-        //  resourceManager
-        //----------------------------------
-
-        /**
-         *  @private
-         *  Used for accessing localized Error messages.
-         */
-        private static function get resourceManager():IResourceManager
-        {
-            return ResourceManager.getInstance();
-        }

         //----------------------------------
         //  measuredColumnWidths
         //----------------------------------

         private var _measuredColumnWidths:Vector.<Number>;
-        //private var measuredColumnWidthsChanged:Boolean = false;

         /**
          *  Used by layout to get the measured column widths
@@ -170,53 +151,33 @@
         }

-        private var _helpContentFactory:IDeferredInstance;
-        private var helpContentFactoryChanged:Boolean = false;
-
+        //----------------------------------
+        //  helpContent
+        //----------------------------------
+        private var _helpContent:IDeferredInstance;
+        private var helpContentChanged:Boolean = false;
+
+        [Bindable("labelChanged")]
+        [Inspectable(category="General", defaultValue="")]
+
+        /**
+         *  A factory object that creates the mxmlContent for the
+         *  helpContentGroup skin part.
+         *
+         *  @default undefined
+         */
         public function set helpContent(value:IDeferredInstance):void
         {
-            _helpContentFactory = value;
-            helpContentFactoryChanged = true;
+            _helpContent = value;
+            helpContentChanged = true;
             invalidateProperties();
         }

         public function get helpContent():IDeferredInstance
         {
-            return _helpContentFactory;
-        }
-
-        //----------------------------------
-        //  helpText
-        //----------------------------------
-
-        private var _helpText:String = "";
-        private var helpTextChanged:Boolean = false;
-
-        [Bindable("helpTextChanged")]
-        [Inspectable(category="General", defaultValue="")]
-
-        /**
-         *  Text that provides a description of the form item or instructions for filling it out.
-         *
-         *  @default ""
-         */
-        public function get helpText():String
-        {
-            return _helpText;
-        }
-
-        /**
-         *  @private
-         */
-        public function set helpText(value:String):void
-        {
-            if (_helpText == value)
-                return;
-
-            _helpText = value;
-            helpTextChanged = true;
-            invalidateProperties();
-        }
+            return _helpContent;
+        }
+

         //----------------------------------
         //  label
@@ -328,9 +289,13 @@
             _required = value;
             invalidateSkinState();
         }
-
-
-
+
+
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden Properties
+        //
+        //--------------------------------------------------------------------------

         //----------------------------------
         //  baselinePosition
@@ -388,14 +353,24 @@
          */
         override protected function getCurrentSkinState():String
         {
-            if (elementErrorStrings.length > 0)
-                return "error";
-            if(required && (enabled == false))
-                return "requiredAndDisabled";
             if (required)
-                return "required";
-
-            return "normal";
+            {
+                if (!enabled)
+                    return "requiredAndDisabled";
+                else if (elementErrorStrings.length > 0)
+                    return "requiredAndError";
+                else
+                    return "required";
+            }
+            else
+            {
+                if (!enabled)
+                    return "disabled";
+                else if (elementErrorStrings.length > 0)
+                    return "error";
+                else
+                    return "normal";
+            }
         }

         /**
@@ -416,26 +391,7 @@
             else if (instance == helpContentGroup)
                 createHelpContent();
         }
-
-        /**
-         *  @private
-         */
-        override public function styleChanged(styleProp:String):void
-        {
-            super.styleChanged(styleProp);
-
-            var allStyles:Boolean = (styleProp == null) || (styleProp == "styleName");
-            if (allStyles || (layoutStyles.indexOf(styleProp) != -1))
-            {
-                invalidateSize();
-                invalidateDisplayList();
-            }
-        }
-
-        private static const layoutStyles:Array =
-            ["indicatorGap", "labelWidth", "paddingBottom", "paddingTop", "paddingLeft", "paddingRight"];
-
-
+
         // TODO Remove once we switch from Canvas to FormItemLayout
         private function applyConstraintColumns(columns:Vector.<Number>):void
         {
@@ -459,44 +415,71 @@
             }
         }

-        public function elementAddHandler(event:ElementExistenceEvent):void
-        {
+        //--------------------------------------------------------------------------
+        //
+        //  Event Handlers
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  @private
+         */
+        private function elementAddHandler(event:ElementExistenceEvent):void
+        {
+            if (event.isDefaultPrevented())
+                return;
+
             var uicElt:UIComponent = event.element as UIComponent;

             if (uicElt)
             {
                 uicElt.addEventListener(FlexEvent.VALID, element_validHandler);
                 uicElt.addEventListener(FlexEvent.INVALID, element_invalidHandler);
-                uicElt.showErrorSkin = true;
-                uicElt.showErrorTip = false;
-            }
-        }
-
-        public function elementRemoveHandler(event:ElementExistenceEvent):void
-        {
+               /* uicElt.showErrorSkin = false;
+                uicElt.showErrorTip = false;*/
+            }
+        }
+
+        /**
+         *  @private
+         */
+        private function elementRemoveHandler(event:ElementExistenceEvent):void
+        {
+            if (event.isDefaultPrevented())
+                return;
+
             var uicElt:UIComponent = event.element as UIComponent;

             if (uicElt)
             {
                 uicElt.removeEventListener(FlexEvent.VALID, element_validHandler);
                 uicElt.removeEventListener(FlexEvent.INVALID, element_invalidHandler);
-                uicElt.showErrorSkin = true;
-                uicElt.showErrorTip = true;
-            }
-        }
-
-        protected function element_validHandler(event:FlexEvent):void
+                /*uicElt.showErrorSkin = true;
+                uicElt.showErrorTip = true;*/
+            }
+        }
+
+        /**
+         *  @private
+         */
+        private function element_validHandler(event:FlexEvent):void
         {
             // update error string
             updateErrorString();
         }

-        protected function element_invalidHandler(event:FlexEvent):void
+        /**
+         *  @private
+         */
+        private function element_invalidHandler(event:FlexEvent):void
         {
             // update error string
             updateErrorString();
         }

+        /**
+         *  @private
+         */
         private function updateErrorString():void
         {
             var uicElt:UIComponent;
@@ -521,7 +504,10 @@
             dispatchEvent(new Event("elementErrorStringsChanged"));
         }

-        private function applyErrorText():void
+        /**
+         *  @private
+         */
+        protected function applyErrorText():void
         {
             if (!errorTextDisplay)
                 return;
@@ -538,34 +524,22 @@

         }

+        /**
+         *  @private
+         */
         private function createHelpContent():void
         {
-            if (_helpContentFactory && helpContentGroup && helpContentFactoryChanged)
-            {
-                helpContentFactoryChanged = false;
-
-                var content:Object = _helpContentFactory.getInstance();
+            if (_helpContent && helpContentGroup && helpContentChanged)
+            {
+                helpContentChanged = false;
+
+                var content:Object = _helpContent.getInstance();

                 if (!(content is Array))
-                {
                     content = [content];
-                }

                 helpContentGroup.mxmlContent = content as Array;
-
-            }
-            /*if (!mxmlContentCreated)
-            {
-                mxmlContentCreated = true;
-
-                if (_mxmlContentFactory)
-                {
-                    var deferredContent:Object = _mxmlContentFactory.getInstance();
-                    mxmlContent = deferredContent as Array;
-                    _deferredContentCreated = true;
-                    dispatchEvent(new FlexEvent(FlexEvent.CONTENT_CREATION_COMPLETE));
-                }
-            }*/
+            }
         }

     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21778
Author:   egeorgie@adobe.com
Date:     2011-08-02T21:30:22.597357Z

Log Message:
-----------
Create ScrollBars in Scroller On-Demand for interactionMode="touch"

- Logic to Scroller to show/hide scrollbars on-demand
- The default Scroller skin is modified to use the new factory skin parts

QE notes: feature ready for testing
Doc notes: ready for documentation
Bugs:
Reviewer: Glenn
Tests run: full cyclone
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/tests/basicTests/spark/scripts/TextAreaTestScript.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/skins/spark/ScrollerSkin.mxml</path>

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

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

 import mx.core.EventPriority;
 import mx.core.FlexGlobals;
+import mx.core.IFactory;
 import mx.core.IInvalidating;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
@@ -549,22 +550,6 @@

     /**
      *  @private
-     *  Property used to communicate with ScrollerLayout to let it
-     *  know when a horizontal scroll is in progress or not (and when
-     *  the horizontal scroll bar should be hidden or not)
-     */
-    mx_internal var horizontalScrollInProgress:Boolean = false;
-
-    /**
-     *  @private
-     *  Property used to communicate with ScrollerLayout to let it
-     *  know when a vertical scroll is in progress or not (and when
-     *  the vertical scroll bar should be hidden or not)
-     */
-    mx_internal var verticalScrollInProgress:Boolean = false;
-
-    /**
-     *  @private
      *  Threshold for screen distance they must move to count as a scroll
      *  Based on 20 pixels on a 252ppi device.
      */
@@ -853,6 +838,69 @@
     public var horizontalScrollBar:HScrollBar;

     //----------------------------------
+    //  horizontalScrollBarFactory
+    //----------------------------------
+
+    [SkinPart(required="false", type="spark.components.HScrollBar")]
+
+    /**
+     *  A skin part that defines the horizontal scroll bar component.
+     *
+     *  The horizontalScrollBar skin part takes precedence over this
+     *  skin part.
+     *
+     *  When Scroller creates an instance of this part, it will set the
+     *  horizontalScrollBar skin part to that instance.
+     *
+     *  This property should be considered read-only. It is only
+     *  set by the Scroller's skin.
+     */
+    public var horizontalScrollBarFactory:IFactory;
+
+    /**
+     *  Creates the horizontalScrollBar part from the horizontalScrollBarFactory part.
+     */
+    private function ensureDeferredHScrollBarCreated():void
+    {
+        if (!horizontalScrollBar && horizontalScrollBarFactory)
+        {
+            horizontalScrollBar = HScrollBar(createDynamicPartInstance("horizontalScrollBarFactory"));
+            Group(this.skin).addElement(horizontalScrollBar);
+            partAdded("horizontalScrollBar", horizontalScrollBar);
+        }
+    }
+
+    //----------------------------------
+    //  horizontalScrollInProgress
+    //----------------------------------
+
+    /**
+     *  Storage for the horizontalScrollInProgress property
+     */
+    private var _horizontalScrollInProgress:Boolean = false;
+
+    /**
+     *  @private
+     *  Property used to communicate with ScrollerLayout to let it
+     *  know when a horizontal scroll is in progress or not (and when
+     *  the horizontal scroll bar should be hidden or not)
+     */
+    mx_internal function get horizontalScrollInProgress():Boolean
+    {
+        return _horizontalScrollInProgress;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function set horizontalScrollInProgress(value:Boolean):void
+    {
+        _horizontalScrollInProgress = value;
+        if (value && getStyle("interactionMode") == InteractionMode.TOUCH)
+            ensureDeferredHScrollBarCreated();
+    }
+
+    //----------------------------------
     //  verticalScrollBar
     //----------------------------------

@@ -874,6 +922,65 @@
      */
     public var verticalScrollBar:VScrollBar;

+    //----------------------------------
+    //  verticalScrollBarFactory
+    //----------------------------------
+
+    [SkinPart(required="false", type="spark.components.VScrollBar")]
+
+    /**
+     *  A skin part that defines the vertical scroll bar.
+     *
+     *  The verticalScrollBar skin part takes precedence over this
+     *  skin part.
+     *
+     *  When Scroller creates an instance of this part, it will set the
+     *  verticalScrollBar skin part to that instance.
+     */
+    public var verticalScrollBarFactory:IFactory;
+
+    /**
+     *  Creates the verticalScrollBar part from the verticalScrollBarFactory part.
+     */
+    private function ensureDeferredVScrollBarCreated():void
+    {
+        if (!verticalScrollBar && verticalScrollBarFactory)
+        {
+            verticalScrollBar = VScrollBar(createDynamicPartInstance("verticalScrollBarFactory"));
+            Group(this.skin).addElement(verticalScrollBar);
+            partAdded("verticalScrollBar", verticalScrollBar);
+        }
+    }
+
+    //----------------------------------
+    //  verticalScrollInProgress
+    //----------------------------------
+
+    /**
+     *  Storage for the verticalScrollInProgress property
+     */
+    private var _verticalScrollInProgress:Boolean = false;
+
+    /**
+     *  @private
+     *  Property used to communicate with ScrollerLayout to let it
+     *  know when a vertical scroll is in progress or not (and when
+     *  the vertical scroll bar should be hidden or not)
+     */
+    mx_internal function get verticalScrollInProgress():Boolean
+    {
+        return _verticalScrollInProgress;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function set verticalScrollInProgress(value:Boolean):void
+    {
+        _verticalScrollInProgress = value;
+        if (value && getStyle("interactionMode") == InteractionMode.TOUCH)
+            ensureDeferredVScrollBarCreated();
+    }

     //----------------------------------
     //  viewport - default property
@@ -2354,6 +2461,11 @@
             }
             else
             {
+                // In case we're not in touch mode, we need to instantiate our deferred skin parts immediately
+                // TODO (egeorgie): support deferred scrollbar parts in non-touch mode
+                ensureDeferredHScrollBarCreated();
+                ensureDeferredHScrollBarCreated();
+
                 uninstallTouchListeners();
             }
         }
@@ -2379,6 +2491,15 @@
     override protected function attachSkin():void
     {
         super.attachSkin();
+
+        if (getStyle("interactionMode") != InteractionMode.TOUCH)
+        {
+            // TODO (egeorgie): support deferred scrollbar parts in non-touch mode
+            // In case we're not in touch mode, we need to instantiate our deferred skin parts immediately
+            ensureDeferredHScrollBarCreated();
+            ensureDeferredVScrollBarCreated();
+        }
+
         Group(skin).layout = new ScrollerLayout();
         installViewport();
         skin.addEventListener(MouseEvent.MOUSE_WHEEL, skin_mouseWheelHandler);
@@ -2411,7 +2532,6 @@
             if (liveScrollingSet)
                 verticalScrollBar.setStyle("liveDragging", Boolean(liveScrolling));
         }
-
         else if (instance == horizontalScrollBar)
         {
             horizontalScrollBar.viewport = viewport;
@@ -2429,7 +2549,6 @@

         if (instance == verticalScrollBar)
             verticalScrollBar.viewport = null;
-
         else if (instance == horizontalScrollBar)
             horizontalScrollBar.viewport = null;
     }


mediator onAdd and onRemove signals parameters changed

--- src/ru/whitered/kote/Facade.as
+++ src/ru/whitered/kote/Facade.as
@@ -66,7 +66,7 @@
 			mediator.onSubscribe.addListener(subscribeMediator);
 			mediator.onUnsubscribe.addListener(unsubscribeMediator);

-			mediator.onAdd.dispatch(this);
+			mediator.onAdd.dispatch(mediator, this);
 		}

@@ -86,7 +86,7 @@
 			mediator.onUnsubscribe.removeListener(unsubscribeMediator);
 			mediator.onSubscribe.removeListener(subscribeMediator);

-			mediator.onRemove.dispatch(this);
+			mediator.onRemove.dispatch(mediator, this);
 		}


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@1288046 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as
+++ frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as
@@ -0,0 +1,1144 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// This file is originally available in mx:validators code. Minor changes were
+// made to use this in spark validators. The changes done are
+// 1. removed the inheritance from IMXMLObject class and instead inherits from
+//    GlobalizationBase
+// 2. removed the private variable document.
+// 3. removed initialize() method.
+//
+package spark.validators.supportClasses
+{
+
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import mx.binding.BindingManager;
+import mx.core.IMXMLObject;
+import mx.events.FlexEvent;
+import mx.validators.IValidatorListener;
+import mx.events.ValidationResultEvent;
+import mx.validators.ValidationResult;
+import mx.validators.IValidator;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+
+import spark.globalization.supportClasses.GlobalizationBase;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when validation succeeds.
+ *
+ *  @eventType mx.events.ValidationResultEvent.VALID
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="valid", type="mx.events.ValidationResultEvent")]
+
+/**
+ *  Dispatched when validation fails.
+ *
+ *  @eventType mx.events.ValidationResultEvent.INVALID
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="invalid", type="mx.events.ValidationResultEvent")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[ResourceBundle("core")]
+[ResourceBundle("validators")]
+
+/**
+ *  The GlobalizationValidatorBase class is the base class for all validators
+ *  in the spark namespace. This class implements the ability for a validator
+ *  to make a field required, which means that the user must enter a value in
+ *  the field or the validation fails. This also enables or diables the
+ *  validator. Any class inheriting from this MUST override the
+ *  createWorkingInstance() method.
+ *
+ *  @mxml
+ *
+ *
The GlobalizationValidatorBase class defines the following tag attributes
+ *  which all of its subclasses inherit:

+ *
+ *

+ *  <spark:GlobalizationValidatorBase
+ *    enabled="true|false"
+ *    listener="Value of the source property"
+ *    property="No default"
+ *    required="true|false"
+ *    requiredFieldError="This field is required."
+ *    source="No default"
+ *    trigger="Value of the source property"
+ *    triggerEvent="valueCommit"
+ *  />
+ *

+ *
+ *  @see mx.events.ValidationResultEvent
+ *  @see mx.validators.ValidationResult
+ *  @see mx.validators.RegExpValidationResult
+ *
+ *  @includeExample examples/SimpleValidatorExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class GlobalizationValidatorBase extends GlobalizationBase
+             implements IValidator
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function GlobalizationValidatorBase()
+    {
+        super();
+
+        // Register as a weak listener for "change" events from ResourceManager.
+        // If GlobalizationValidatorBases registered as a strong listener,
+        // they wouldn't get garbage collected.
+        resourceManager.addEventListener(
+            Event.CHANGE, resourceManager_changeHandler, false, 0, true);
+
+        resourcesChanged();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  actualTrigger
+    //----------------------------------
+
+    /**
+     *  Contains the trigger object, if any,
+     *  or the source object. Used to determine the listener object
+     *  for the triggerEvent.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function get actualTrigger():IEventDispatcher
+    {
+        if (_trigger)
+            return _trigger;
+
+        else if (_source)
+            return _source as IEventDispatcher;
+
+        return null;
+    }
+
+    //----------------------------------
+    //  actualListeners
+    //----------------------------------
+
+    /**
+     *  Contains an Array of listener objects, if any,
+     *  or the source object. Used to determine which object
+     *  to notify about the validation result.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function get actualListeners():Array
+    {
+        var result:Array = [];
+
+        if (_listener)
+            result.push(_listener);
+
+        else if (_source)
+            result.push(_source);
+
+        return result;
+    }
+
+    //----------------------------------
+    //  enabled
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the enabled property.
+     */
+    private var _enabled:Boolean = true;
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  Setting this value to false will stop the validator
+     *  from performing validation.
+     *  When a validator is disabled, it dispatches no events,
+     *  and the validate() method returns null.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get enabled():Boolean
+    {
+        return _enabled;
+    }
+
+    /**
+     *  @private
+     */
+    public function set enabled(value:Boolean):void
+    {
+        _enabled = value;
+    }
+
+    //----------------------------------
+    //  listener
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the listener property.
+     */
+    private var _listener:Object;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Specifies the validation listener.
+     *
+     *
If you do not specify a listener,
+     *  Flex uses the value of the source property.
+     *  After Flex determines the source component,
+     *  it changes the border color of the component,
+     *  displays an error message for a failure,
+     *  or hides any existing error message for a successful validation.

+     *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+
+    /* This behavior has been removed.
+     *
If Flex does not find an appropriate listener,
+     *  validation errors propagate to the Application object, causing Flex
+     *  to display an Alert box containing the validation error message.

+     *
+     *
Specifying this causes the validation error
+     *  to propagate to the Application object,
+     *  and displays an Alert box containing the validation error message.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get listener():Object
+    {
+        return _listener;
+    }
+
+    /**
+     *  @private
+     */
+    public function set listener(value:Object):void
+    {
+        removeListenerHandler();
+        _listener = value;
+        addListenerHandler();
+    }
+
+    //----------------------------------
+    //  property
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the property property.
+     */
+    private var _property:String;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A String specifying the name of the property
+     *  of the source object that contains
+     *  the value to validate.
+     *  The property is optional, but if you specify source,
+     *  you should set a value for this property as well.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get property():String
+    {
+        return _property;
+    }
+
+    /**
+     *  @private
+     */
+    public function set property(value:String):void
+    {
+        _property = value;
+    }
+
+    //----------------------------------
+    //  required
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  If true, specifies that a missing or empty
+     *  value causes a validation error.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var required:Boolean = true;
+
+    //----------------------------------
+    //  resourceManager
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the resourceManager property.
+     */
+    private var _resourceManager:IResourceManager =
+                                              ResourceManager.getInstance();
+
+    /**
+     *  @private
+     *  This metadata suppresses a trace() in PropertyWatcher:
+     *  "warning: unable to bind to property 'resourceManager' ..."
+     */
+    [Bindable("unused")]
+
+    /**
+     *  @copy mx.core.UIComponent#resourceManager
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function get resourceManager():IResourceManager
+    {
+        return _resourceManager;
+    }
+
+    //----------------------------------
+    //  source
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the source property.
+     */
+    private var _source:Object;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Specifies the object containing the property to validate.
+     *  Set this to an instance of a component or a data model.
+     *  You use data binding syntax in MXML to specify the value.
+     *  This property supports dot-delimited Strings
+     *  for specifying nested properties.
+     *
+     *  If you specify a value to the source property,
+     *  then you should specify a value to the property
+     *  property as well.
+     *  The source property is optional.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get source():Object
+    {
+        return _source;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:Object):void
+    {
+        if (_source == value)
+            return;
+
+        if (value is String)
+        {
+            var message:String = resourceManager.getString(
+                "validators", "SAttribute", [ value ]);
+            throw new Error(message);
+        }
+
+        // Remove the listener from the old source.
+        removeTriggerHandler();
+        removeListenerHandler();
+
+        _source = value;
+
+        // Listen for the trigger event on the new source.
+        addTriggerHandler();
+        addListenerHandler();
+    }
+
+    //----------------------------------
+    //  subFields
+    //----------------------------------
+
+    /**
+     *  An Array of Strings containing the names for the properties contained
+     *  in the value Object passed to the validate()
+     *  method.
+     *  For example, CreditCardValidator sets this property to
+     *  [ "cardNumber", "cardType" ].
+     *  This value means that the value Object
+     *  passed to the validate() method
+     *  should contain a cardNumber and a cardType
+     *  property.
+     *
+     *
Subclasses of the GlobalizationValidatorBase class that
+     *  validate multiple data fields (like CreditCardValidator and
+     *  DateValidator)
+     *  should assign this property in their constructor.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected var subFields:Array = [];
+
+    //----------------------------------
+    //  trigger
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the trigger property.
+     */
+    private var _trigger:IEventDispatcher;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Specifies the component generating the event that triggers the
+     *  validator.
+     *  If omitted, by default Flex uses the value of the source
+     *  property.
+     *  When the trigger dispatches a triggerEvent,
+     *  validation executes.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get trigger():IEventDispatcher
+    {
+        return _trigger;
+    }
+
+    /**
+     *  @private
+     */
+    public function set trigger(value:IEventDispatcher):void
+    {
+        removeTriggerHandler();
+        _trigger = value;
+        addTriggerHandler();
+    }
+
+    //----------------------------------
+    //  triggerEvent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the triggerEvent property.
+     */
+    private var _triggerEvent:String = FlexEvent.VALUE_COMMIT;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Specifies the event that triggers the validation.
+     *  If omitted, Flex uses the valueCommit event.
+     *  Flex dispatches the valueCommit event
+     *  when a user completes data entry into a control.
+     *  Usually this is when the user removes focus from the component,
+     *  or when a property value is changed programmatically.
+     *  If you want a validator to ignore all events,
+     *  set triggerEvent to the empty string ("").
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get triggerEvent():String
+    {
+        return _triggerEvent;
+    }
+
+    /**
+     *  @private
+     */
+    public function set triggerEvent(value:String):void
+    {
+        if (_triggerEvent == value)
+            return;
+
+        removeTriggerHandler();
+        _triggerEvent = value;
+        addTriggerHandler();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: Errors
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  requiredFieldError
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the requiredFieldError property.
+     */
+    private var _requiredFieldError:String;
+
+    /**
+     *  @private
+     */
+    private var requiredFieldErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when a value is missing and the
+     *  required property is true.
+     *
+     *  @default "This field is required."
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get requiredFieldError():String
+    {
+        return _requiredFieldError;
+    }
+
+    /**
+     *  @private
+     */
+    public function set requiredFieldError(value:String):void
+    {
+        requiredFieldErrorOverride = value;
+
+        _requiredFieldError = value ?
+                              value :
+                              resourceManager.getString(
+                                  "validators", "requiredFieldError");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Performs validation and optionally notifies
+     *  the listeners of the result.
+     *
+     *  @param value Optional value to validate.
+     *  If null, then the validator uses the source and
+     *  property properties to determine the value.
+     *  If you specify this argument, you should also set the
+     *  listener property to specify the target component
+     *  for any validation error messages.
+     *
+     *  @param suppressEvents If false, then after validation,
+     *  the validator will notify the listener of the result.
+     *
+     *  @return A ValidationResultEvent object
+     *  containing the results of the validation.
+     *  For a successful validation, the
+     *  ValidationResultEvent.results Array property is empty.
+     *  For a validation failure, the
+     *  ValidationResultEvent.results Array property contains
+     *  one ValidationResult object for each field checked by the validator,
+     *  both for fields that failed the validation and for fields that passed.
+     *  Examine the ValidationResult.isError
+     *  property to determine if the field passed or failed the validation.
+     *
+     *  @see mx.events.ValidationResultEvent
+     *  @see mx.validators.ValidationResult
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function validate(
+                        value:Object = null,
+                        suppressEvents:Boolean = false):ValidationResultEvent
+    {
+        if (!value)
+            value = getValueFromSource();
+
+        if (isRealValue(value) || required)
+        {
+            // Validate if the target is required or our value is non-null.
+            return processValidation(value, suppressEvents);
+        }
+        else
+        {
+            // We assume if value is null and required is false that
+            // validation was successful.
+            var resultEvent:ValidationResultEvent =
+                new ValidationResultEvent(ValidationResultEvent.VALID);
+            if (!suppressEvents && _enabled)
+            {
+                dispatchEvent(resultEvent);
+            }
+            return resultEvent;
+        }
+    }
+
+    /**
+     *  Invokes all the validators in the validators Array.
+     *  Returns an Array containing one ValidationResultEvent object
+     *  for each validator that failed.
+     *  Returns an empty Array if all validators succeed.
+     *
+     *  @param validators An Array containing the GlobalizationValidatorBase
+     *  objects to execute.
+     *
+     *  @return Array of ValidationResultEvent objects, where the Array
+     *  contains one ValidationResultEvent object for each validator
+     *  that failed.
+     *  The Array is empty if all validators succeed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static function validateAll(validators:Array):Array
+    {
+        var result:Array = [];
+
+        var n:int = validators.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var v:IValidator = validators[i] as IValidator;
+            if (v && v.enabled)
+            {
+                var resultEvent:ValidationResultEvent = v.validate();
+
+                if (resultEvent.type != ValidationResultEvent.VALID)
+                    result.push(resultEvent);
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     *  This method is called when a GlobalizationValidatorBase is constructed,
+     *  and again whenever the ResourceManager dispatches
+     *  a "change" Event to indicate
+     *  that the localized resources have changed in some way.
+     *
+     *
This event will be dispatched when you set the ResourceManager's
+     *  localeChain property, when a resource module
+     *  has finished loading, and when you call the ResourceManager's
+     *  update() method.

+     *
+     *
Subclasses should override this method and, after calling
+     *  super.resourcesChanged(), do whatever is appropriate
+     *  in response to having new resource values.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function resourcesChanged():void
+    {
+        requiredFieldError = requiredFieldErrorOverride;
+    }
+
+    /**
+     *  Sets up all of the listeners for the
+     *  valid and invalid
+     *  events dispatched from the validator. Subclasses of the GlobalizationValidatorBase class
+     *  should first call the removeListenerHandler() method,
+     *  and then the addListenerHandler() method if
+     *  the value of one of their listeners or sources changes.
+     *  The CreditCardValidator and DateValidator classes use this function
+     *  internally.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function addListenerHandler():void
+    {
+        var actualListener:Object;
+        var listeners:Array = actualListeners;
+
+        var n:int = listeners.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            actualListener = listeners[i];
+            if (actualListener is IValidatorListener)
+            {
+                addEventListener(ValidationResultEvent.VALID,
+                   IValidatorListener(actualListener).validationResultHandler);
+
+                addEventListener(ValidationResultEvent.INVALID,
+                   IValidatorListener(actualListener).validationResultHandler);
+            }
+        }
+    }
+
+    /**
+     *  Disconnects all of the listeners for the
+     *  valid and invalid
+     *  events dispatched from the validator. Subclasses should first call the
+     *  removeListenerHandler() method and then the
+     *  addListenerHandler method if
+     *  the value of one of their listeners or sources changes.
+     *  The CreditCardValidator and DateValidator classes use this function
+     *  internally.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function removeListenerHandler():void
+    {
+        var actualListener:Object;
+        var listeners:Array = actualListeners;
+
+        var n:int = listeners.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            actualListener = listeners[i];
+            if (actualListener is IValidatorListener)
+            {
+                removeEventListener(ValidationResultEvent.VALID,
+                    IValidatorListener(actualListener).validationResultHandler);
+
+                removeEventListener(ValidationResultEvent.INVALID,
+                    IValidatorListener(actualListener).validationResultHandler);
+            }
+        }
+    }
+
+    /**
+     *  Returns true if value is not null.
+     *
+     *  @param value The value to test.
+     *
+     *  @return true if value is not null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function isRealValue(value:Object):Boolean
+    {
+        return (value != null);
+    }
+
+    /**
+     *  Returns the Object to validate. Subclasses, such as the
+     *  CreditCardValidator and DateValidator classes,
+     *  override this method because they need
+     *  to access the values from multiple subfields.
+     *
+     *  @return The Object to validate.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function getValueFromSource():Object
+    {
+        var message:String;
+
+        if (_source && _property)
+        {
+            return _source[_property];
+        }
+
+        else if (!_source && _property)
+        {
+            message = resourceManager.getString(
+                "validators", "SAttributeMissing");
+            throw new Error(message);
+        }
+
+        else if (_source && !_property)
+        {
+            message = resourceManager.getString(
+                "validators", "PAttributeMissing");
+            throw new Error(message);
+        }
+
+        return null;
+    }
+
+    /**
+     *  Executes the validation logic of this validator,
+     *  including validating that a missing or empty value
+     *  causes a validation error as defined by
+     *  the value of the required property.
+     *
+     *
If you create a subclass of a validator class,
+     *  you must override this method.

+     *
+     *  @param value Value to validate.
+     *
+     *  @return For an invalid result, an Array of ValidationResult objects,
+     *  with one ValidationResult object for each field examined
+     *  by the validator that failed validation.
+     *
+     *  @see mx.validators.ValidationResult
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function doValidation(value:Object):Array
+    {
+        var results:Array = [];
+
+        var result:ValidationResult = validateRequired(value);
+        if (result)
+            results.push(result);
+
+        return results;
+    }
+
+    /**
+     *  Returns a ValidationResultEvent from the Array of error results.
+     *  Internally, this function takes the results from the
+     *  doValidation() method and puts it into a
+     *  ValidationResultEvent object.
+     *  Subclasses, such as the RegExpValidator class,
+     *  should override this function if they output a subclass
+     *  of ValidationResultEvent objects, such as the RegExpValidationResult
+     *  objects, and needs to populate the object with additional information.
+     *  You never call this function directly, and you should rarely
+     *  override it.
+     *
+     *  @param errorResults Array of ValidationResult objects.
+     *
+     *  @return The ValidationResultEvent returned by the
+     *  validate() method.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function handleResults(errorResults:Array):ValidationResultEvent
+    {
+        var resultEvent:ValidationResultEvent;
+
+        if (errorResults.length > 0)
+        {
+            resultEvent =
+                new ValidationResultEvent(ValidationResultEvent.INVALID);
+            resultEvent.results = errorResults;
+
+            if (subFields.length > 0)
+            {
+                var errorFields:Object = {};
+                var subField:String;
+
+                // Now we need to send valid results
+                // for every subfield that didn't fail.
+                var n:int;
+                var i:int;
+
+                n = errorResults.length;
+                for (i = 0; i < n; i++)
+                {
+                    subField = errorResults[i].subField;
+                    if (subField)
+                    {
+                        errorFields[subField] = true;
+                    }
+                }
+
+                n = subFields.length;
+                for (i = 0; i < n; i++)
+                {
+                    if (!errorFields[subFields[i]])
+                    {
+                        errorResults.push(new ValidationResult(false,
+                                                               subFields[i]));
+                    }
+                }
+            }
+        }
+        else
+        {
+            resultEvent = new ValidationResultEvent
+                               (ValidationResultEvent.VALID);
+        }
+
+        return resultEvent;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static function findObjectFromString(doc:Object,
+                                                 value:String):Object
+    {
+        var obj:Object = doc;
+        var parts:Array = value.split(".");
+
+        var n:int = parts.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            try
+            {
+                obj = obj[parts[i]];
+
+                // There's no guarantee that the objects have
+                // already been created when this function fires;
+                // for example, in the deferred instantiation case,
+                // this function fires before the object for validation
+                // has been created.
+                if (!obj)
+                {
+                    //return true;
+                }
+            }
+            catch (error:Error)
+            {
+                if ((error is TypeError) &&
+                    (error.message.indexOf("null has no properties") != -1))
+                {
+                    var resourceManager:IResourceManager =
+                        ResourceManager.getInstance();
+                    var message:String = resourceManager.getString(
+                        "validators", "fieldNotFound", [ value ]);
+                    throw new Error(message);
+                }
+                else
+                {
+                    throw error;
+                }
+            }
+        }
+
+        return obj;
+    }
+
+    /**
+     *  @private
+     */
+    private static function trimString(str:String):String
+    {
+        var startIndex:int = 0;
+        while (str.indexOf(' ', startIndex) == startIndex)
+        {
+            ++startIndex;
+        }
+
+        var endIndex:int = str.length - 1;
+        while (str.lastIndexOf(' ', endIndex) == endIndex)
+        {
+            --endIndex;
+        }
+
+        return endIndex >= startIndex ?
+            str.slice(startIndex, endIndex + 1) :
+            "";
+    }
+
+    /**
+     *  @private
+     */
+    private function addTriggerHandler():void
+    {
+        if (actualTrigger)
+            actualTrigger.addEventListener(_triggerEvent, triggerHandler);
+    }
+
+    /**
+     *  @private
+     */
+    private function removeTriggerHandler():void
+    {
+        if (actualTrigger)
+            actualTrigger.removeEventListener(_triggerEvent, triggerHandler);
+    }
+
+    /**
+     *  @private
+     *  Main internally used function to handle validation process.
+     */
+    private function processValidation(
+                        value:Object,
+                        suppressEvents:Boolean):ValidationResultEvent
+    {
+        var resultEvent:ValidationResultEvent;
+
+        if (_enabled)
+        {
+            var errorResults:Array = doValidation(value);
+
+            resultEvent = handleResults(errorResults);
+        }
+        else
+        {
+            suppressEvents = true; // Don't send any events
+        }
+
+        if (!suppressEvents)
+        {
+            dispatchEvent(resultEvent);
+        }
+
+        return resultEvent;
+    }
+
+    /**
+     *  @private
+     *  Determines if an object is valid based on its
+     *  required property.
+     *  This is a convenience method for calling a validator from within a
+     *  custom validation function.
+     */
+    private function validateRequired(value:Object):ValidationResult
+    {
+        if (required)
+        {
+            var val:String = (value != null) ? String(value) : "";
+
+            val = trimString(val);
+
+            // If the string is empty and required is set to true
+            // then throw a requiredFieldError.
+            if (val.length == 0)
+            {
+                return new ValidationResult(
+                                true, "", "requiredField", requiredFieldError);
+            }
+        }
+
+        return null;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function triggerHandler(event:Event):void
+    {
+        validate();
+    }
+
+    /**
+     *  @private
+     */
+    private function resourceManager_changeHandler(event:Event):void
+    {
+        resourcesChanged();
+    }
+}
+
+}