OFC-395 Always show minCount instances of attrib/entity in UI; do not allow remove

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/client/RemoteCallQueueProcessor.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/client/RemoteCallQueueProcessor.as
@@ -1,93 +1,93 @@
-package org.openforis.collect.client {
-
-	import mx.rpc.AbstractOperation;
-	import mx.rpc.AsyncResponder;
-	import mx.rpc.AsyncToken;
-	import mx.rpc.IResponder;
-	import mx.rpc.events.FaultEvent;
-	import mx.rpc.events.ResultEvent;
-
-	import org.openforis.collect.model.Queue;
-
-	/**
-	 * @author S. Ricci
-	 */
-	public class RemoteCallQueueProcessor {
-		private var _queue:Queue; //queue of ProcessableItem objects
-		private var _responder:IResponder;
-		private var _lastCall:RemoteCallWrapper;
-		private var _resultHandler:Function;
-		private var _faultHandler:Function;
-		private var _maxAttempts:int;
-
-		public function RemoteCallQueueProcessor(maxAttempts:int, resultHandler:Function, faultHandler:Function = null) {
-			this._queue = new Queue();
-			this._maxAttempts = maxAttempts;
-			this._resultHandler = resultHandler;
-			this._faultHandler = faultHandler;
-			_responder = new AsyncResponder(callResultHandler, callFaultHandler);
-		}
-
-		public function isEmpty():Boolean {
-			return this._queue.isEmpty();
-		}
-
-		public function appendOperation(token:Object, resultHandler:Function, faultHandler:Function, operation:AbstractOperation, ... args:Array):void {
-			var queueItem:RemoteCallWrapper = new RemoteCallWrapper(operation, args);
-			queueItem.token = token;
-			queueItem.resultHandler = resultHandler;
-			queueItem.faultHandler = faultHandler;
-			_queue.push(queueItem);
-			sendHeadRemoteCall();
-		}
-
-		public function removeHeadOperation():RemoteCallWrapper {
-			if(_queue.isEmpty()) {
-				return null;
-			}
-			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.pop());
-			return call;
-		}
-
-		public function sendHeadRemoteCall():void {
-			if(_queue.isEmpty()) {
-				return;
-			}
-			var remoteCall:RemoteCallWrapper = getHeadElement();
-			if(! remoteCall.active) {
-				var token:AsyncToken = remoteCall.send();
-				token.addResponder(_responder);
-			}
-		}
-
-		protected function callResultHandler(event:ResultEvent, token:Object = null):void {
-			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.pop()); //removes the first element
-			call.reset();
-			_lastCall = call;
-			_resultHandler(event, call.token);
-			if(call.resultHandler != null) {
-				call.resultHandler(event, token);
-			}
-			sendHeadRemoteCall();
-		}
-
-		protected function callFaultHandler(event:FaultEvent, token:Object = null):void {
-			//remove the failed call from  the queue
-			var call:RemoteCallWrapper = _queue.pop() as RemoteCallWrapper;
-
-			if(call.faultHandler != null) {
-				call.faultHandler(event, call.token);
-			}
-		}
-
-		private function getHeadElement():RemoteCallWrapper {
-			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.element);
-			return call;
-		}
-
-		public function get lastCall():RemoteCallWrapper {
-			return _lastCall;
-		}
-
-	}
+package org.openforis.collect.client {
+
+	import mx.rpc.AbstractOperation;
+	import mx.rpc.AsyncResponder;
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	import org.openforis.collect.model.Queue;
+
+	/**
+	 * @author S. Ricci
+	 */
+	public class RemoteCallQueueProcessor {
+		private var _queue:Queue; //queue of ProcessableItem objects
+		private var _responder:IResponder;
+		private var _lastCall:RemoteCallWrapper;
+		private var _resultHandler:Function;
+		private var _faultHandler:Function;
+		private var _maxAttempts:int;
+
+		public function RemoteCallQueueProcessor(maxAttempts:int, resultHandler:Function, faultHandler:Function = null) {
+			this._queue = new Queue();
+			this._maxAttempts = maxAttempts;
+			this._resultHandler = resultHandler;
+			this._faultHandler = faultHandler;
+			_responder = new AsyncResponder(callResultHandler, callFaultHandler);
+		}
+
+		public function isEmpty():Boolean {
+			return this._queue.isEmpty();
+		}
+
+		public function appendOperation(token:Object, resultHandler:Function, faultHandler:Function, operation:AbstractOperation, ... args:Array):void {
+			var queueItem:RemoteCallWrapper = new RemoteCallWrapper(operation, args);
+			queueItem.token = token;
+			queueItem.resultHandler = resultHandler;
+			queueItem.faultHandler = faultHandler;
+			_queue.push(queueItem);
+			sendHeadRemoteCall();
+		}
+
+		public function removeHeadOperation():RemoteCallWrapper {
+			if(_queue.isEmpty()) {
+				return null;
+			}
+			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.pop());
+			return call;
+		}
+
+		public function sendHeadRemoteCall():void {
+			if(_queue.isEmpty()) {
+				return;
+			}
+			var remoteCall:RemoteCallWrapper = getHeadElement();
+			if(! remoteCall.active) {
+				var token:AsyncToken = remoteCall.send();
+				token.addResponder(_responder);
+			}
+		}
+
+		protected function callResultHandler(event:ResultEvent, token:Object = null):void {
+			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.pop()); //removes the first element
+			call.reset();
+			_lastCall = call;
+			_resultHandler(event, call.token);
+			if(call.resultHandler != null) {
+				call.resultHandler(event, call.token);
+			}
+			sendHeadRemoteCall();
+		}
+
+		protected function callFaultHandler(event:FaultEvent, token:Object = null):void {
+			//remove the failed call from  the queue
+			var call:RemoteCallWrapper = _queue.pop() as RemoteCallWrapper;
+
+			if(call.faultHandler != null) {
+				call.faultHandler(event, call.token);
+			}
+		}
+
+		private function getHeadElement():RemoteCallWrapper {
+			var call:RemoteCallWrapper = RemoteCallWrapper(_queue.element);
+			return call;
+		}
+
+		public function get lastCall():RemoteCallWrapper {
+			return _lastCall;
+		}
+
+	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19316
Author:   smgilson@adobe.com
Date:     2010-12-13T19:12:21.336750Z

Log Message:
-----------
ASDoc updates

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/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorAction.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewDescriptor.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
@@ -54,47 +54,59 @@
 //--------------------------------------

 /**
- *  This cancelable event dispatched before the application attempts
+ *  Dispatched before the application attempts
  *  to restore its previously saved state when the application is being
- *  launched.  Calling preventDefault on this event will
- *  prevent the application state from being restored.
+ *  launched.
+ *  Calling preventDefault on this event
+ *  prevents the application state from being restored.
  *
  *  @eventType mx.events.FlexEvent.NAVIGATOR_STATE_LOADING
  *
  *  @langversion 3.0
- *  @playerversion Flash 10.1
+ *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
 [Event(name="navigatorStateLoading", type="mx.events.FlexEvent")]

 /**
- *  This cancelable event dispatched before the application attempts
- *  to persist its state when the application being suspended or exitted.
- *  Calling preventDefault on this event will prevent the
+ *  Dispatched before the application attempts
+ *  to persist its state when the application being suspended or exited.
+ *  Calling preventDefault on this event prevents the
  *  application state from being saved.
  *
  *  @eventType mx.events.FlexEvent.NAVIGATOR_STATE_SAVING
  *
  *  @langversion 3.0
- *  @playerversion Flash 10.1
+ *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
 [Event(name="navigatorStateSaving", type="mx.events.FlexEvent")]

 /**
- *  The base application class used for all view based application types.
- *  This includes ViewNavigatorApplication and TabbedViewNavigatorApplication.  This class
- *  provides the basic infrastructure for providing these types of applications
+ *  The ViewNavigatorApplicationBase class is the base class used for all
+ *  view-based application types.
+ *  This class provides the basic infrastructure for providing
  *  access to the device application menu, hardware keys, orientation status
  *  and application session persistence.
+ *
+ *  @mxml
The <s:ViewNavigatorApplicationBase> tag inherits
+ *  all of the tag attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <s:ViewNavigatorApplicationBase
+ *    Properties
+ *    persistNavigatorState="false"
+ *    viewMenuOpen="false"
+ *  />
+ *

  *
  *  @see spark.components.ViewNavigatorApplication
  *  @see spark.components.TabbedViewNavigatorApplication
  *
  *  @langversion 3.0
- *  @playerversion Flash 10.1
+ *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
@@ -110,7 +122,7 @@
      *  Constructor
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10.1
+     *  @playerversion Flash 10
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
@@ -206,27 +218,31 @@
     private var _persistenceManager:IPersistenceManager;

     /**
-     *  The persistenceManager for the application.  The persistence
-     *  manager is automatically created on demand when accessed for the
-     *  first time.  Override the createPersistenceManager()
+     *  The PersistenceManager object for the application.
+     *  The persistence manager is automatically created on demand
+     *  when accessed for the first time.
+     *  Override the createPersistenceManager()
      *  method to change the type of persistence manager that is created.
      *
-     *
The persistence manager will automatically save and restore
+     *
The persistence manager automatically saves and restores
      *  the main navigator's persistence stack if the
-     *  persistNavigatorState flag is set to true. Data stored
-     *  in the persistence manager will automatically be flushed to disk
+     *  persistNavigatorState flag is set to true.
+     *  Data stored in the persistence manager is automatically flushed to disk
      *  when the application is suspended or exited.

      *
      *
The default implementation of the persistence manager uses
-     *  a shared object as it's backing data store.  All information that is
-     *  saved to this object must adhere to flash AMF rules for object encoding.
-     *  This means that custom classes will need to be registered through the use
+     *  a shared object as it's backing data store.
+     *  All information that is saved to this object must adhere to flash
+     *  AMF rules for object encoding.
+     *  This means that custom classes must be registered through the use
      *  of flash.net.registerClassAlias

      *
-     *  @default Instance of a spark.core.managers.PersistenceManager
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.1
+     *
The default value is an instance of spark.core.managers.PersistenceManager.

+     *
+     *  @see spark.core.managers.PersistenceManager
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
@@ -247,32 +263,37 @@
     private var _persistNavigatorState:Boolean = false;

     /**
-     *  Toggles the application session caching feature for the application.  When
-     *  enabled, the application will automatically save the main navigator's view
-     *  data and navigation history to the persistence manager.  When the application
-     *  is relaunched, this data will automatically be read from the persistence store
-     *  and applied to the application's navigator.
-     *
-     *
When enabled, the application version and time the persistence data was
-     *  generated will also be added to the persistence object.  These can be
-     *  accessed by using the persistence manager's getProperty() method
-     *  using either the applicationVersion or timestamp key.

-     *
-     *
When the persistence object is being created, the application will dispatch
+     *  Toggles the application session caching feature for the application.
+     *  When enabled, the application automatically saves the main navigator's view
+     *  data and navigation history to the persistence manager.
+     *  When the application is relaunched, this data is automatically read from
+     *  the persistence store and applied to the application's navigator.
+     *
+     *
When enabled, the application version and the time the persistence data was
+     *  generated are also be added to the persistence object.
+     *  You can access this information by using the persistence manager's
+     *  getProperty() method and specifying either
+     *  the applicationVersion or timestamp key.

+     *
+     *
When the persistence object is being created, the application dispatches
      *  a cancelable FlexEvent.APPLICATION_PERSISTING event when the process
      *  begins and a FlexEvent.APPLICATION_PERSIST event when it completes.
-     *  If the APPLICATION_PERSISTING event is canceled, the persistence object is not created.
-     *  Similarily, when this information is being restored to the application, a cancelable
-     *  FlexEvent.APPLICATION_RESTORING is dispatched followed by a
-     *  FlexEvent.APPLICATION_RESTORE event.  Canceling the APPLICATION_RESTORING
-     *  event will prevent the navigation data from being restored.

-     *
-     *
The persistNavigatorState flag must be set to true before
+     *  If the APPLICATION_PERSISTING event is canceled,
+     *  the persistence object is not created.
+     *  Similarly, when this information is being restored to the application, a cancelable
+     *  FlexEvent.APPLICATION_RESTORING event is dispatched followed by a
+     *  FlexEvent.APPLICATION_RESTORE event.
+     *  Canceling the APPLICATION_RESTORING event prevents the navigation
+     *  data from being restored.

+     *
+     *
The persistNavigatorState flag must be set to true before
      *  the application initializes itself for the navigator's state to be automatically
      *  restored.

-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.1
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
@@ -294,7 +315,8 @@
     //----------------------------------

     /**
-     *  Opens the view menu if set to true and closes it if set to false.
+     *  Opens the view menu if set to true,
+     *  and closes it if set to false.
      *
      *  @default false
      */
@@ -328,10 +350,10 @@

     /**
      *  This method is called when the application is invoked by the
-     *  OS.  This method is called in response to a InvokeEvent.INVOKE
-     *  event.
-     *
-     *  @param event The InvokeEvent object
+     *  operating system in response to
+     *  an InvokeEvent.INVOKEevent event.
+     *
+     *  @param event The InvokeEvent object.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -343,10 +365,12 @@
     }

     /**
-     *  This method is called when the application is exiting or being
-     *  sent to the background by the OS.  If persistNavigatorState
-     *  is set to true, the application will begin the state saving process
-     *  here.
+     *  Called when the application is exiting or being
+     *  sent to the background by the operating system.
+     *  If persistNavigatorState is true,
+     *  then the application begins the state saving process.
+     *
+     *  @param event
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -378,8 +402,10 @@
     }

     /**
-     *  This method is called when the Application's hardware back key is pressed
+     *  Called when the application's hardware back key is pressed
      *  by the user.
+     *
+     *  @param event The event object generated by the key press.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -391,8 +417,13 @@
     }

     /**
-     *  Called when the menu key is pressed. By default, this opens or closes
-     *  the ViewMenu.
+     *  Called when the menu key is pressed.
+     *  By default, this method opens or closes the ViewMenu object.
+     *
+     *  @param event The KeyboardEvent object associated with the
+     *  menu key being pressed.
+     *
+     *  @see spark.components.ViewMenu
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -406,10 +437,12 @@
     }

     /**
-     *  Method is responsible for create the persistence manager for the application.
-     *  This method will automatically be called when the persistence manager is
-     *  accessed for the first time or if the persistNavigatorState flag
-     *  is set to true on the application.
+     *  Creates the persistence manager for the application.
+     *  This method is called automatically when the persistence manager is
+     *  accessed for the first time, or if the persistNavigatorState property
+     *  is set to true on the application.
+     *
+     *  @return An IPersistenceManager manager object.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -423,12 +456,13 @@

     /**
      *  Responsible for persisting the application state to the persistence manager.
-     *  This method is automatically called when persistNavigatorState
-     *  is set to true.  By default, this method will save the application version
-     *  and the time the persistence object was created to the "timestamp" and
-     *  "applicationVersion" keys.
-     *
-     *
This method will only be called if the FlexEvent.APPLICATION_PERSISTING
+     *  This method is called automatically when persistNavigatorState
+     *  is set to true.
+     *  By default, this method saves the application version
+     *  and the time the persistence object was created to the timestamp and
+     *  applicationVersion keys of the PersistenceManager object.
+     *
+     *
This method is only called if the FlexEvent.APPLICATION_PERSISTING
      *  event is not canceled.

      *
      *  @langversion 3.0
@@ -448,9 +482,9 @@

     /**
      *  Responsible for restoring the application's state when the
-     *  persistNavigatorState flag is set to true.
-     *
-     *
This method will only be called if the FlexEvent.APPLICATION_RESTORING
+     *  persistNavigatorState property is set to true.
+     *
+     *
This method is only called if the FlexEvent.APPLICATION_RESTORING
      *  event is not canceled.

      *
      *  @langversion 3.0


OFC-524 BP Cluster: Dissapearing of Unlisted/Unkown codes and Species name immediately after writting

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/TaxonAttributePresenter.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/TaxonAttributePresenter.as
@@ -17,11 +17,13 @@
 	import org.openforis.collect.client.SpeciesClient;
 	import org.openforis.collect.event.InputFieldEvent;
 	import org.openforis.collect.event.TaxonInputFieldEvent;
+	import org.openforis.collect.i18n.Message;
 	import org.openforis.collect.model.proxy.TaxonOccurrenceProxy;
 	import org.openforis.collect.remoting.service.UpdateRequest;
 	import org.openforis.collect.ui.component.input.InputField;
 	import org.openforis.collect.ui.component.input.TaxonAttributeRenderer;
 	import org.openforis.collect.ui.component.input.TaxonAutoCompletePopUp;
+	import org.openforis.collect.util.CollectionUtil;
 	import org.openforis.collect.util.PopUpUtil;

 	/**
@@ -35,6 +37,9 @@
 		private static const SEARCH_BY_SCIENTIFIC_NAME:String = "byScientificName";
 		private static const SEARCH_BY_VERNACULAR_NAME:String = "byVernacularName";

+		private static const UNKNOWN_ITEM:Object = {code: "UNK", scientificName: Message.get("edit.taxon.unknown")};
+		private static const UNLISTED_ITEM:Object = {code: "UNL", scientificName: Message.get("edit.taxon.unlisted")};
+
 		protected static var autoCompletePopUp:TaxonAutoCompletePopUp;
 		protected static var autoCompletePopUpOpen:Boolean = false;
 		protected static var autoCompleteSearchResponder:AsyncResponder;
@@ -42,7 +47,7 @@

 		private var minCharsToStartAutoComplete:int = 2;

-		private var _lastSelectedTaxon:TaxonOccurrenceProxy;
+		private var _lastSelectedTaxon:Object;

 		public function TaxonAttributePresenter(view:TaxonAttributeRenderer) {
 			super(view);
@@ -98,8 +103,20 @@
 		}

 		protected function inputFieldKeyDownHandler(event:KeyboardEvent):void {
-			if ( event.keyCode == Keyboard.DOWN && autoCompletePopUpOpen ) {
-				autoCompletePopUp.dataGrid.setFocus();
+			switch ( event.keyCode ) {
+				case Keyboard.DOWN:
+					if ( autoCompletePopUpOpen ) {
+						autoCompletePopUp.dataGrid.setFocus();
+						if ( CollectionUtil.isNotEmpty(autoCompletePopUp.dataGrid.dataProvider) ) {
+							autoCompletePopUp.dataGrid.selectedIndex = 0;
+						}
+					}
+					break;
+				case Keyboard.ESCAPE:
+					if ( autoCompletePopUpOpen ) {
+						closeAutoCompletePopUp();
+					}
+					break;
 			}
 		}

@@ -178,11 +195,11 @@
 		}

 		protected static function taxonSelectHandler(event:TaxonInputFieldEvent = null):void {
-			var taxon:TaxonOccurrenceProxy;
+			var taxon:Object;
 			if(event != null) {
 				taxon = event.taxon;
 			} else {
-				taxon = autoCompletePopUp.dataGrid.selectedItem as TaxonOccurrenceProxy;
+				taxon = autoCompletePopUp.dataGrid.selectedItem;
 			}
 			if(taxon != null) {
 				var renderer:TaxonAttributeRenderer = autoCompleteLastInputField.parentDocument as TaxonAttributeRenderer;
@@ -192,7 +209,7 @@
 			closeAutoCompletePopUp();
 		}

-		public function performSelectTaxon(taxonOccurrence:TaxonOccurrenceProxy):void {
+		public function performSelectTaxon(taxonOccurrence:Object):void {
 			_lastSelectedTaxon = taxonOccurrence;
 			var req:UpdateRequest = new UpdateRequest();
 			view.codeTextInput.text = taxonOccurrence.code;
@@ -215,6 +232,10 @@

 		protected static function autoCompleteSearchResultHandler(event:ResultEvent, token:Object):void {
 			var data:IList = event.result as IList;
+			if ( CollectionUtil.isEmpty(data) ) {
+				data.addItem(UNKNOWN_ITEM);
+				data.addItem(UNLISTED_ITEM);
+			}
 			autoCompletePopUp.dataGrid.dataProvider = data;
 		}


ArrayUtil.removeFirstIf(), removeLastIf(), removeAllIf() predicate-based removal functions

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5533 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/util/ArrayUtil.as
+++ src/as/com/threerings/util/ArrayUtil.as
@@ -209,6 +209,45 @@
     }

     /**
+     * Removes the first element in the array for which the specified predicate returns true.
+     *
+     * @param pred a Function of the form: function (element :*) :Boolean
+     *
+     * @return true if an element was removed, false otherwise.
+     */
+    public static function removeFirstIf (arr :Array, pred :Function) :Boolean
+    {
+        return removeIfImpl(arr, pred, true);
+    }
+
+    /**
+     * Removes the last element in the array for which the specified predicate returns true.
+     *
+     * @param pred a Function of the form: function (element :*) :Boolean
+     *
+     * @return true if an element was removed, false otherwise.
+     */
+    public static function removeLastIf (arr :Array, pred :Function) :Boolean
+    {
+        arr.reverse();
+        var removed :Boolean = removeFirstIf(arr, pred);
+        arr.reverse();
+        return removed;
+    }
+
+    /**
+     * Removes all elements in the array for which the specified predicate returns true.
+     *
+     * @param pred a Function of the form: function (element :*) :Boolean
+     *
+     * @return true if an element was removed, false otherwise.
+     */
+    public static function removeAllIf (arr :Array, pred :Function) :Boolean
+    {
+        return removeIfImpl(arr, pred, false);
+    }
+
+    /**
      * Do the two arrays contain elements that are all equals()?
      */
     public static function equals (ar1 :Array, ar2 :Array) :Boolean
@@ -250,9 +289,17 @@
     private static function removeImpl (
         arr :Array, element :Object, firstOnly :Boolean) :Boolean
     {
+        return removeIfImpl(arr, createEqualsPred(element), firstOnly);
+    }
+
+    /**
+     * Implementation of removeIf methods.
+     */
+    private static function removeIfImpl (arr :Array, pred :Function, firstOnly :Boolean) :Boolean
+    {
         var removed :Boolean = false;
         for (var ii :int = 0; ii < arr.length; ii++) {
-            if (Util.equals(arr[ii], element)) {
+            if (pred(arr[ii])) {
                 arr.splice(ii--, 1);
                 if (firstOnly) {
                     return true;
@@ -262,5 +309,12 @@
         }
         return removed;
     }
+
+    private static function createEqualsPred (element :Object) :Function
+    {
+        return function (other :Object) :Boolean {
+            return Util.equals(other, element);
+        }
+    }
 }
 }


:fire: remove unneeded comment

:fire: remove unneeded comment

--- gb/joypad.as
+++ gb/joypad.as
@@ -91,8 +91,6 @@
       // Bit 2 - P12 Input Up    or Select   (0=Pressed) (Read Only)
       // Bit 1 - P11 Input Left  or Button B (0=Pressed) (Read Only)
       // Bit 0 - P10 Input Right or Button A (0=Pressed) (Read Only)
-
-      // NOTE: This is backwards logic to me. 0 = True ?
       (
         bits.Bit(true, 7) |
         bits.Bit(true, 6) |


Remove invalid check of 'pos'.

Remove invalid check of 'pos'.

This check causes the new (hixie-76) WebSockets protocol check to
hang.

--- flash-src/WebSocket.as
+++ flash-src/WebSocket.as
@@ -155,6 +155,7 @@
     main.log("request header:\n" + req);
     socket.writeUTFBytes(req);
     main.log("sent key3: " + key3);
+    main.log("expected digest: " + expectedDigest);
     writeBytes(key3);
     socket.flush();
   }
@@ -218,20 +219,18 @@
           pos = -1;
         }
       } else if (headerState == 4) {
-        if (pos == 15) {
-          var replyDigest:String = readBytes(buffer, 16);
-          main.log("reply digest: " + replyDigest);
-          if (replyDigest != expectedDigest) {
-            onError("digest doesn't match: " + replyDigest + " != " + expectedDigest);
-            return;
-          }
-          headerState = 5;
-          makeBufferCompact();
-          pos = -1;
-          readyState = OPEN;
-          notifyStateChange();
-          dispatchEvent(new Event("open"));
+        var replyDigest:String = readBytes(buffer, 16);
+        main.log("reply digest: " + replyDigest);
+        if (replyDigest != expectedDigest) {
+          onError("digest doesn't match: " + replyDigest + " != " + expectedDigest);
+          return;
         }
+        headerState = 5;
+        makeBufferCompact();
+        pos = -1;
+        readyState = OPEN;
+        notifyStateChange();
+        dispatchEvent(new Event("open"));
       } else {
         if (buffer[pos] == 0xff) {
           if (buffer.readByte() != 0x00) {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultItemRendererAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultItemRendererAutomationImpl.as
@@ -0,0 +1,134 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.automation.delegates.skins.spark
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.automation.delegates.core.UIComponentAutomationImpl;
+	import mx.core.mx_internal;
+
+	import spark.skins.spark.DefaultItemRenderer;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  ItemRenderer class for spark.
+	 *
+	 *  @see spark.skins.spark.DefaultItemRenderer
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 4
+	 */
+	public class SparkDefaultItemRendererAutomationImpl extends UIComponentAutomationImpl
+	{
+		include "../../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.skins.spark.DefaultItemRenderer, SparkDefaultItemRendererAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj DefaultItemRenderer object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 4
+		 */
+		public function SparkDefaultItemRendererAutomationImpl(obj:spark.skins.spark.DefaultItemRenderer)
+		{
+			super(obj);
+			recordClick = false;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Variables
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get listItem():spark.skins.spark.DefaultItemRenderer
+		{
+			return uiComponent as spark.skins.spark.DefaultItemRenderer;
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  automationName
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			return listItem.label|| super.automationName;
+		}
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			return [automationName];
+		}
+
+
+
+
+	}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridColumnGroup.as
+++ frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridColumnGroup.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package mx.controls.advancedDataGridClasses
 {


[Mangui.DemuxHelper] Make probe Level parameter optional

Selection logic ensures proper Demuxer is used anyway

--- src/org/mangui/hls/demux/DemuxHelper.as
+++ src/org/mangui/hls/demux/DemuxHelper.as
@@ -26,17 +26,17 @@
              * if mp3_match && codec_mp3 => MP3 demuxer
              * if no codec info in Manifest, use fallback order : AAC/MP3/TS
              */
-            if (ts_match && level.codec_h264) {
+            if (ts_match && level && level.codec_h264) {
                 CONFIG::LOGGING {
                     Log.debug("TS match + H264 signaled in Manifest, use TS demuxer");
                 }
                 return new TSDemuxer(audioselect, progress, complete, videometadata, audioOnly);
-            } else if (aac_match && level.codec_aac) {
+            } else if (aac_match && level && level.codec_aac) {
                 CONFIG::LOGGING {
                     Log.debug("AAC match + AAC signaled in Manifest, use AAC demuxer");
                 }
                 return new AACDemuxer(audioselect, progress, complete, id3tagfound);
-            } else if (mp3_match && level.codec_mp3) {
+            } else if (mp3_match && level && level.codec_mp3) {
                 CONFIG::LOGGING {
                     Log.debug("MP3 match + MP3 signaled in Manifest, use MP3 demuxer");
                 }


viewport is in auto-resize mode when width and height passed to the constructor are equal to 0

--- src/aerys/minko/stage/Viewport.as
+++ src/aerys/minko/stage/Viewport.as
@@ -45,7 +45,7 @@
 		private var _width				: Number					= 0.;
 		private var _height				: Number					= 0.;
 		private var _autoResize			: Boolean					= false;
-		private var _aa					: int						= 0;
+		private var _antiAliasing					: int						= 0;

 		private var _wdExtracterQuery	: WorldDataExtracterVisitor	= null;
 		private var _renderingQuery		: RenderingVisitor			= null;
@@ -131,14 +131,14 @@
 		 */
 		public function get antiAliasing() : int
 		{
-			return _aa;
+			return _antiAliasing;
 		}

 		public function set antiAliasing(value : int) : void
 		{
-			if (value != _aa)
-			{
-				_aa = value;
+			if (value != _antiAliasing)
+			{
+				_antiAliasing = value;
 				++_version;

 				resetStage3D();
@@ -205,15 +205,14 @@
 		 */
 		public function Viewport(width			: uint		= 0,
 								 height			: uint		= 0,
-								 autoResize		: Boolean	= false,
 								 antiAliasing	: int		= 0,
 								 rendererType	: Class 	= null)
 		{
 			this.width = width;
 			this.height = height;

-			_autoResize = autoResize;
-			_aa = antiAliasing;
+			_autoResize = _width == 0 || _height == 0;
+			_antiAliasing = antiAliasing;
 			_rendererClass = rendererType || DirectRenderer;

 			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
@@ -227,6 +226,8 @@

 			if (_autoResize)
 			{
+				stage.align = StageAlign.TOP_LEFT;
+				stage.scaleMode = StageScaleMode.NO_SCALE;
 				stage.addEventListener(Event.RESIZE, stageResizeHandler);

 				width = stage.stageWidth;
@@ -251,6 +252,7 @@
 				height = stage.stageHeight;

 			resetStage3D();
+			showLogo();
 		}

 		private function contextCreatedHandler(event : Event) : void
@@ -265,7 +267,7 @@
 			if (_stage3d)
 			{
 				updateRectangle();
-				_stage3d.context3D.configureBackBuffer(_width, _height, _aa, true);
+				_stage3d.context3D.configureBackBuffer(_width, _height, _antiAliasing, true);

 				_renderer = new DirectRenderer(this, _stage3d.context3D);


Transferred from the Adobe Open Source Subversion Repository

Revision: 2526
Author:   chaase@adobe.com
Date:     2008-07-18T21:42:56.518055Z

Log Message:
-----------
New Move effect, works with both UIComponent subclasses (halo and gumbo) and GraphicElement objects. Minor fixes needed in framework files (Effect, CompositeEffect) to make everything work properly.

Reviewer: Jason S
checkintests: PASS
Mustella Effects: PASS

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/NewEffects.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/MoveInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/AnimateProperties.as</path>

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

--- frameworks/projects/framework/src/mx/effects/Effect.as
+++ frameworks/projects/framework/src/mx/effects/Effect.as
@@ -184,6 +184,23 @@
     //
     //--------------------------------------------------------------------------

+    // Transitions will force the values animated by this effect to get set to
+    // their final values, as specified in the end state, when the effect finishes.
+    // This flag is set to true when the effect is being played by a transition,
+    // but applying the values is still gated by the value of the
+    // applyTransitionEndProperties flag, which is set on a per-Effect basis.
+    mx_internal var applyEndValuesWhenDone:Boolean = false;
+
+    // TODO: consider making this attribute protected (vs. mx_internal)
+    // This flag controls whether a given Effect, when being played as
+    // part of a view state transition, wishes to replace any
+    // transient state set during its animation by the values declared
+    // in the ending view state (as captured by the propertyChanges
+    // array). For now, this flag is set to true by the new effects
+    // in Flex4 as well as the old CompositeEffect classes. Other effects
+    // leave the flag false for backward compatibility.
+    mx_internal var applyTransitionEndProperties:Boolean = false;
+
     /**
      *  @private
      */
@@ -922,6 +939,8 @@
             // Revalidate after applying the start values, to get everything
             // back the way it should be before starting the animation
             LayoutManager.getInstance().validateNow();
+
+            applyEndValuesWhenDone = true;
         }

         var newInstances:Array = createInstances(targets);
@@ -1243,6 +1262,71 @@
         }
     }

+    /**
+     *  @private
+     *  Applies the start values found in the array of PropertyChanges
+     *  to the relevant targets.
+     */
+    mx_internal function applyEndValues(propChanges:Array,
+                                    targets:Array):void
+    {
+        // For now, only new Flex4 effects will apply end values when transitions
+        // are over, to preserve the previous behavior of Flex3 effects
+        if (!applyTransitionEndProperties)
+            return;
+
+        var effectProps:Array = relevantProperties;
+
+        var n:int = propChanges.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var m:int;
+            var j:int;
+
+            var target:Object = propChanges[i].target;
+            var apply:Boolean = false;
+
+            m = targets.length;
+            for (j = 0; j < m; j++)
+            {
+                if (targets[j] == target)
+                {
+                    apply = filterInstance(propChanges, target);
+                    break;
+                }
+            }
+
+            if (apply)
+            {
+                // Walk the properties in the target
+                m = effectProps.length;
+                for (j = 0; j < m; j++)
+                {
+                    if (effectProps[j] in propChanges[i].end &&
+                        effectProps[j] in target)
+                    {
+                        applyValueToTarget(target, effectProps[j],
+                                propChanges[i].end[effectProps[j]],
+                                propChanges[i].end);
+                    }
+                }
+
+                // Walk the styles in the target
+                m = relevantStyles.length;
+                for (j = 0; j < m; j++)
+                {
+                    trace("relevantStyles[j] = " + relevantStyles[j]);
+                    if (relevantStyles[j] in propChanges[i].end &&
+                        target is IStyleClient)
+                    {
+                        trace("AnimProp: style, value = " + relevantStyles[j] + ", " +
+                            propChanges[i].end[relevantStyles[j]]);
+                        target.setStyle(relevantStyles[j], propChanges[i].end[relevantStyles[j]]);
+                    }
+                }
+            }
+        }
+    }

     /**
      *  Used internally by the Effect infrastructure.
@@ -1338,6 +1422,10 @@
         deleteInstance(instance);

         dispatchEvent(event);
+
+        // Transitions should set the end values when done
+        if (applyEndValuesWhenDone)
+            applyEndValues(mx_internal::propertyChangesArray, targets);
     }

 }


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

--- frameworks/projects/framework/src/mx/utils/PerfUtil.as
+++ frameworks/projects/framework/src/mx/utils/PerfUtil.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+//
+//      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.
+//
+////////////////////////////////////////////////////////////////////////////////
 package mx.utils
 {
 import flash.display.DisplayObject;


Transferred from the Adobe Open Source Subversion Repository

Revision: 17482
Author:   smgilson@adobe.com
Date:     2010-08-25T20:48:22.342049Z

Log Message:
-----------
Fix broken ASDoc comment to add closing </li> tags

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

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -1036,9 +1036,9 @@
      *
      *
This property has no effect if any of the following are true;
      *

-     *
requestedRowCount is set
-     *
the actual size of the grid has been explicitly set
-     *
the grid is inside a Scroller component
+     *
requestedRowCount is set

+     *
the actual size of the grid has been explicitly set

+     *
the grid is inside a Scroller component

      *

      *

      *
@@ -1123,9 +1123,9 @@
      *
      *
This property has no effect if any of the following are true;
      *

-     *
requestedColumnCount is set
-     *
the actual size of the grid has been explicitly set
-     *
the grid is inside a Scroller component
+     *
requestedColumnCount is set

+     *
the actual size of the grid has been explicitly set

+     *
the grid is inside a Scroller component

      *

      *

      *
@@ -1918,7 +1918,7 @@

         invalidateSize();
         invalidateDisplayList();
-		dispatchChangeEvent("typicalItemChanged");
+        dispatchChangeEvent("typicalItemChanged");
     }

     //----------------------------------
@@ -3320,7 +3320,7 @@
             updateCaretForDataProviderChange(event);

         if (gridDimensions && hoverRowIndex != -1)
-	        updateHoverForDataProviderChange(event);
+            updateHoverForDataProviderChange(event);

         invalidateSize();
         invalidateDisplayList();
@@ -3448,7 +3448,7 @@
             updateCaretForColumnsChange(event);

         if (gridDimensions && hoverColumnIndex != -1)
-            updateHoverForColumnsChange(event);
+            updateHoverForColumnsChange(event);

         invalidateSize();
         invalidateDisplayList();


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 16665
Author:   rfrishbe@adobe.com
Date:     2010-06-24T22:40:15.397962Z

Log Message:
-----------
Initial checkin for touch-enabled Lists.  This has not been code reviewed or spec-approved.  There will be lots of changes that will occur with this, but this will allow people to easily create touch-enabled Lists

QE notes: None
Doc notes: None
Bugs: -
Reviewer: None - this will get reviewed later
Tests run: checkintests, full mustella run (some tests failed and were off by a few pixels)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollingEasing.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/TouchScrollEvent.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/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ScrollPolicy.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -1495,6 +1495,10 @@
      */
     protected function item_mouseDownHandler(event:MouseEvent):void
     {
+        // someone else handled it already
+//        if (event.isDefaultPrevented())
+//            return;
+
         // Handle the fixup of selection
         var newIndex:int
         if (event.currentTarget is IItemRenderer)


Transferred from the Adobe Open Source Subversion Repository

Revision: 17433
Author:   cframpto@adobe.com
Date:     2010-08-20T21:14:17.295733Z

Log Message:
-----------
When setting the dataProvider, have to clear the selection and commit it right away so that if the selection is set right after setting the dp (before commitProperties runs)  that selection isn't lost.

QE notes:
Doc notes:
Bugs: SDK-26324
Reviewer: Ryan, Hans
Tests run: checkintests, cyclone
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -33,6 +33,7 @@
 import mx.core.IVisualElement;
 import mx.core.InteractionMode;
 import mx.core.mx_internal;
+import mx.core.UIComponentGlobals;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
 import mx.events.DragEvent;
@@ -551,12 +552,15 @@
      */
     override public function set dataProvider(value:IList):void
     {
-        // Uconditionally clear the selection, see SDK-21645
+        // Uconditionally clear the selection, see SDK-21645.  Can't wait
+        // to commit the selection because it could be set again before
+        // commitProperties runs and that selection gets lost.
         if (!isEmpty(_proposedSelectedIndices) || !isEmpty(selectedIndices))
         {
             _proposedSelectedIndices.length = 0;
             multipleSelectionChanged = true;
             invalidateProperties();
+            UIComponentGlobals.layoutManager.validateClient(this, true);
         }
         super.dataProvider = value;
     }


Fixed sliderbar arrow positioning bug

Fixed sliderbar arrow positioning bug

--- src/UI/Sliderbar.as
+++ src/UI/Sliderbar.as
@@ -86,6 +86,7 @@
 		protected function positionElements():void {
 			leftArrow.x = x;
 			rightArrow.x = x + width - rightArrow.width;
+			leftArrow.y = rightArrow.y = y;

 			rail.x = x + leftArrow.width;
 			rail.y = y + slider.height / 2;


Fixed bug when a context was empty

Fixed bug when a context was empty

--- src/as3spec/Spec.as
+++ src/as3spec/Spec.as
@@ -103,15 +103,17 @@

 		private function next() : void {

-		  if(contexts.length<=0 && currentContext.specs.length<=0) {
-		    cleanup();
-		    return;
-	    }
+		  if(contexts.length<=0 && currentContext.specs.length<=0) return cleanup();

 		  if(currentContext==null || currentContext.specs.length==0) {
 		    currentContext=contexts.shift();
 		    Printer.printer.description(currentContext.description);
 	    }
+
+	    if(currentContext.specs.length==0) {
+	      Printer.printer.puts(' - empty context [EMPTY]');
+	      return next();
+		  }

 		  should = currentContext.specs.shift() as Should;


VertexNormalColorEffect now implements IRenderingEffect

--- src/aerys/minko/render/effect/debug/VertexNormalColorEffect.as
+++ src/aerys/minko/render/effect/debug/VertexNormalColorEffect.as
@@ -1,9 +1,10 @@
 package aerys.minko.render.effect.debug
 {
+	import aerys.minko.render.effect.IRenderingEffect;
 	import aerys.minko.render.effect.SinglePassEffect;
 	import aerys.minko.render.shader.SValue;

-	public class VertexNormalColorEffect extends SinglePassEffect
+	public class VertexNormalColorEffect extends SinglePassEffect implements IRenderingEffect
 	{
 		override protected function getOutputPosition() : SValue
 		{


- Spiced up the Test11 to make it more interesting


fixed image tooltip flicker when in lower-right corner

--- WeaveCore/src/weave/utils/BitmapUtils.as
+++ WeaveCore/src/weave/utils/BitmapUtils.as
@@ -276,9 +276,9 @@
 					var sw:Number = stage.stageWidth;
 					var sh:Number = stage.stageHeight;
 					if (p.x + bitmapData.width > sw)
-						p.x = stage.mouseX - bitmapData.width;
+						p.x = stage.mouseX - bitmapData.width - 2;
 					if (p.y + bitmapData.height > sh)
-						p.y = stage.mouseY - bitmapData.height;
+						p.y = stage.mouseY - bitmapData.height - 2;
 					p = event.toolTip.parent.globalToLocal(p);
 					event.toolTip.x = p.x;
 					event.toolTip.y = p.y;


comment outs

comment outs

--- SendAndLoadExample.as
+++ SendAndLoadExample.as
@@ -1,45 +1,41 @@
-package
-{
-
-	import flash.events.*;
-	import flash.net.*;
-	import flash.display.Loader;
+package
+{
+
+	import flash.events.*;
+	import flash.net.*;
+	import flash.display.Loader;
 	import flash.external.ExternalInterface;
-
-	public class SendAndLoadExample
-	{
-		private var _url:String;
-		private var lastSendedUrl:String = "";
-
-		public function SendAndLoadExample()
-		{
-
-		}
-
-		public function sendData(url:String,msg:String):void
-		{
-			_url = url;
-			if(lastSendedUrl != _url){
-				var src = encodeURI(_url);
-				var request:URLRequest = new URLRequest(src);
-				var loader:Loader = new Loader();
-				loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete);
-				loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
-				loader.load(request);
-				lastSendedUrl = _url;
-				//Config.app.msgbox.text += msg;
-				//ExternalInterface.call('console.log','url Loaded');
-			}
-		}
-		private function handleComplete(event:Event):void
-		{
-			//var loader:URLLoader = URLLoader(event.target);
-			//trace("post happened");
-		//	ExternalInterface.call('console.log','url Loaded');
-		}
-		private function onIOError(event:IOErrorEvent):void
-		{
-		//	ExternalInterface.call('console.log','url error');
-		}
-	}
-}+
+	public class SendAndLoadExample
+	{
+		private var _url:String;
+		private var lastSendedUrl:String = "";
+
+		public function SendAndLoadExample()
+		{
+
+		}
+
+		public function sendData(url:String,msg:String):void
+		{
+			_url = url;
+			if(lastSendedUrl != _url){
+				var src = encodeURI(_url);
+				var request:URLRequest = new URLRequest(src);
+				var loader:Loader = new Loader();
+				loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete);
+				loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
+				loader.load(request);
+				lastSendedUrl = _url;
+			}
+		}
+		private function handleComplete(event:Event):void
+		{
+			var loadedContent = event.target;
+		}
+		private function onIOError(event:IOErrorEvent):void
+		{
+		//	ExternalInterface.call('console.log','url error');
+		}
+	}
+}


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

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


使用小数以让代码更清楚

使用小数以让代码更清楚

--- as3/com/netease/protobuf/Int64.as
+++ as3/com/netease/protobuf/Int64.as
@@ -28,7 +28,7 @@
 		 * Convert to Number.
 		 */
 		public final function toNumber():Number {
-			return high * 4294967296 + low
+			return high * 4294967296.0 + low
 		}
 		public final function toString(radix:uint = 10):String {
 			if (radix < 2 || radix > 36) {


Set default value for useHardwareVideoDecoder to false

--- src/org/mangui/hls/HLSSettings.as
+++ src/org/mangui/hls/HLSSettings.as
@@ -443,9 +443,9 @@
          *  it will set NetStream.useHardwareDecoder
          *  refer to http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#useHardwareDecoder
          *
-         * Default is true
-         */
-        public static var useHardwareVideoDecoder : Boolean = true;
+         * Default is false
+         */
+        public static var useHardwareVideoDecoder : Boolean = false;

         /**
          * logInfo


moved valueForKey and setValueForKey method into reprise namespace

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@686 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -2751,12 +2751,12 @@
 		{
 		}

-		internal function valueForKey(key : String) : *
+		reprise function valueForKey(key : String) : *
 		{
 			return this[key];
 		}

-		internal function setValueForKey(key : String, value : *) : void
+		reprise function setValueForKey(key : String, value : *) : void
 		{
 			//try to assign to a setter method by prepending 'set'
 			try


Transferred from the Adobe Open Source Subversion Repository

Revision: 18259
Author:   deeptika@adobe.com
Date:     2010-10-21T09:02:19.811454Z

Log Message:
-----------
Automation support for item-editing, column resize and header clicks in spark DG
(New xml should be taken from changelist 290001 in perforce)

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/tabularData/SparkDataGridTabularData.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkUITextFieldGridItemRendererAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/manifest_automation_spark.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkComboBoxAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/AutomationSparkClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultGridHeaderRendererAutomationImpl.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/gridClasses</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/SparkRichEditableTextAutomationHelper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkDropDownListBaseAutomationImpl.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/gridClasses/SparkGridItemRendererAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGridAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/SparkRichEditableTextAutomationHelper.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/SparkRichEditableTextAutomationHelper.as
@@ -402,6 +402,8 @@
 				// so we need to calcualte it. Here we need to consider the direction.
 				var stringBeforeChange:String = richEditableText.text;
 				var insertPos:int = richEditableText.selectionActivePosition;
+				var activePos:int = insertPos;
+				var anchorPos:int = richEditableText.selectionAnchorPosition;
 				var direction:int = -1;
 				if(richEditableText && richEditableText.textFlow && richEditableText.textFlow.computedFormat &&
 					richEditableText.textFlow.computedFormat.direction)
@@ -409,7 +411,7 @@
 					if (richEditableText.textFlow.computedFormat.direction=="ltr")
 						direction = 1;
 				}
-
+				richEditableText.selectRange(anchorPos, activePos);
 				for (var i:uint = 0; i < n; i++)
 				{
 					ke = new KeyboardEvent(KeyboardEvent.KEY_DOWN);


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 17918
Author:   deeptika@adobe.com
Date:     2010-09-29T09:10:43.362516Z

Log Message:
-----------
Automation support for spark DG - 1
Only selection event is supported by automation. Header related events, column resize / sort, item edit and drag-drop are not yet supported by the component.

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

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/tabularData/SparkDataGridTabularData.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/manifest_automation_spark.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/AutomationSparkClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGridAutomationImpl.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/events/SparkDataGridItemSelectEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_spark/src/spark/automation/delegates/skins/spark/SparkDefaultGridItemRendererAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGridAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGridAutomationImpl.as
@@ -0,0 +1,966 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.automation.delegates.components
+{
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+	import flash.events.KeyboardEvent;
+	import flash.events.MouseEvent;
+	import flash.geom.Point;
+	import flash.ui.Keyboard;
+	import flash.utils.getTimer;
+
+	import mx.automation.Automation;
+	import mx.automation.AutomationIDPart;
+	import mx.automation.IAutomationManager2;
+	import mx.automation.IAutomationObject;
+	import mx.automation.IAutomationObjectHelper;
+	import mx.automation.IAutomationTabularData;
+	import mx.automation.delegates.DragManagerAutomationImpl;
+	import mx.automation.events.AutomationRecordEvent;
+	import mx.automation.events.ListItemSelectEvent;
+	import mx.automation.tabularData.DataGridTabularData;
+	import mx.controls.listClasses.IListItemRenderer;
+	import mx.core.mx_internal;
+	import mx.utils.StringUtil;
+
+	import spark.automation.delegates.components.supportClasses.SparkSkinnableContainerBaseAutomationImpl;
+	import spark.automation.events.SparkDataGridItemSelectEvent;
+	import spark.automation.tabularData.SparkDataGridTabularData;
+	import spark.components.DataGrid;
+	import spark.components.IGridItemRenderer;
+	import spark.events.GridEvent;
+
+	use namespace mx_internal;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  DataGrid class.
+	 *
+	 *  @see spark.components.DataGrid
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 4
+	 */
+	public class SparkDataGridAutomationImpl extends SparkSkinnableContainerBaseAutomationImpl
+	{
+
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.DataGrid, SparkDataGridAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 *  @param obj DataGrid object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 4
+		 */
+
+		public function SparkDataGridAutomationImpl(obj:spark.components.DataGrid)
+		{
+			super(obj);
+			updateItemRenderers();
+			obj.addEventListener(Event.ADDED, childAddedHandler, false, 0, true);
+			obj.addEventListener(MouseEvent.CLICK, mouseClickHandler, false, 0 , true);
+			obj.addEventListener(GridEvent.GRID_DOUBLE_CLICK, recordAutomatableEvent, false, 0 , true);
+			obj.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		//  Variables
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		protected var shiftKeyDown:Boolean = false;
+
+		/**
+		 *  @private
+		 */
+		protected var ctrlKeyDown:Boolean = false;
+
+		/**
+		 * @private
+		 */
+		mx_internal var itemAutomationNameFunction:Function = getItemAutomationValue;
+
+
+		//--------------------------------------------------------------------------
+		//
+		// 		Properties
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get grid():spark.components.DataGrid
+		{
+			return uiComponent as spark.components.DataGrid;
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		// 		Overridden Properties
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  A matrix of the automationValues of each item in the grid. The return value
+		 *  is an array of rows, each of which is an array of item renderers (row-major).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		override public function get automationTabularData():Object
+		{
+			return  new SparkDataGridTabularData(grid);
+		}
+
+
+		/**
+		 *  @private
+		 */
+		override public function get numAutomationChildren():int
+		{
+			var listItems:Array = getCompleteRenderersArray();
+			if (listItems.length == 0)
+				return 0;
+
+			var result:int = listItems.length * grid.columns.length;
+			return result;
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		// 		Methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		protected function compare(labels:Array, values:Array):Boolean
+		{
+			if (labels.length != values.length)
+				return false;
+			var n:int = labels.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				if (labels[i] != values[i])
+					return false;
+			}
+
+			return true;
+		}
+
+		/**
+		 * @private
+		 */
+		protected function updateItemRenderers():void
+		{
+			var items:Array = getCompleteRenderersArray();
+			if (items.length == 0)
+				return ;
+
+			var rows:uint = items.length;
+			var cols:uint = grid.columns.length;
+
+			for (var i:int = 0; i < rows; ++i)
+			{
+				for (var j:int = 0; j < cols; ++j)
+				{
+					var item:IGridItemRenderer = items[i][j];
+					if (item)
+					{
+						item.owner = grid;
+					}
+				}
+			}
+		}
+
+		/**
+		 * @private
+		 */
+		protected function recordDGItemSelectEvent(item:IGridItemRenderer,
+												   trigger:Event,
+												   cacheable:Boolean=true):void
+		{
+			var selectionType:String = SparkDataGridItemSelectEvent.SELECT;
+			var keyEvent:KeyboardEvent = trigger as KeyboardEvent;
+			var mouseEvent:MouseEvent = trigger as MouseEvent;
+
+			var indexSelection:Boolean = false;
+
+			if (!Automation.automationManager || !Automation.automationManager.automationEnvironment
+				|| !Automation.automationManager.recording)
+				return ;
+
+			var event:SparkDataGridItemSelectEvent = new SparkDataGridItemSelectEvent(selectionType);
+			event.itemRenderer = item;
+
+			event.triggerEvent = trigger;
+			if (keyEvent)
+			{
+				event.ctrlKey = keyEvent.ctrlKey;
+				event.shiftKey = keyEvent.shiftKey;
+				event.altKey = keyEvent.altKey;
+			}
+			else if (mouseEvent)
+			{
+				event.ctrlKey = mouseEvent.ctrlKey;
+				event.shiftKey = mouseEvent.shiftKey;
+				event.altKey = mouseEvent.altKey;
+			}
+
+			recordAutomatableEvent(event, cacheable);
+		}
+
+		/**
+		 * @private
+		 * Plays back MouseEvent.CLICK on the item renderer.
+		 */
+		protected function replayMouseClickOnItem(item:IGridItemRenderer,
+												  ctrlKey:Boolean = false,
+												  shiftKey:Boolean = false,
+												  altKey:Boolean = false):Boolean
+		{
+			var me:MouseEvent = new MouseEvent(MouseEvent.CLICK);
+			me.ctrlKey = ctrlKey;
+			me.altKey = altKey;
+			me.shiftKey = shiftKey;
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.replayClick(item, me);
+		}
+
+		/**
+		 * @private
+		 * Plays back MouseEvent.DOUBLE_CLICK on the item renderer.
+		 */
+		protected function replayMouseDoubleClickOnItem(item:IGridItemRenderer):Boolean
+		{
+			var me:MouseEvent = new MouseEvent(MouseEvent.DOUBLE_CLICK);
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.replayMouseEvent(item, me);
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function getItemRendererForEvent(lise:ListItemSelectEvent):IGridItemRenderer
+		{
+			var rowIndex:int = lise.itemIndex;
+			//rowIndex = rowIndex < grid.lockedRowCount ? rowIndex : rowIndex - grid.verticalScrollPosition;
+
+			return grid.grid.getItemRendererAt(rowIndex, 0) as IGridItemRenderer;
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function fillItemRendererIndex(item:IListItemRenderer, event:ListItemSelectEvent):void
+		{
+			var listItems:Array = getCompleteRenderersArray();
+
+			var startRow:int = 0;
+			//This portion is commented out as now the rowHeaders are separated
+			/*
+			if(grid.headerVisible)
+			++startRow;
+			*/
+
+			var n:int = listItems.length;
+			for (var i:int = startRow; i < n; i++)
+			{
+				var n1:int = listItems[i].length;
+				for (var j:int = 0; j < n1; j++)
+				{
+					if (listItems[i][j] == item)
+					{
+						event.itemIndex = i + grid.grid.verticalScrollPosition - 1;
+					}
+				}
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		public function getVisibleRenderersArray():Array
+		{
+			const visibleRowIndices:Vector.<int> = grid.grid.getVisibleRowIndices();
+			const visibleColumnIndices:Vector.<int> = grid.grid.getVisibleColumnIndices();
+			const renderers:Array = new Array(visibleRowIndices.length);
+
+			for each (var rowIndex:int in visibleRowIndices)
+			{
+				renderers[rowIndex] = new Array(visibleColumnIndices.length);
+				for each (var columnIndex:int in visibleColumnIndices)
+				renderers[rowIndex][columnIndex] = grid.grid.getItemRendererAt(rowIndex, columnIndex);
+			}
+
+			return renderers;
+		}
+
+		/**
+		 *  @private
+		 */
+		public function getCompleteRenderersArray():Array
+		{
+			const rowCount:int = grid.dataProvider.length;
+			const columnCount:int = grid.columns.length;
+			const renderers:Array = new Array(rowCount);
+
+			for (var rowIndex:int = 0; rowIndex < rowCount; rowIndex++)
+			{
+				renderers[rowIndex] = new Array(columnCount);
+				for (var columnIndex:int = 0; columnIndex < columnCount; columnIndex++)
+					renderers[rowIndex][columnIndex] = grid.grid.getItemRendererAt(rowIndex, columnIndex);
+			}
+
+			return renderers;
+
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function trimArray(val:Array):void
+		{
+			var n:int = val.length;
+			for (var i:int = 0; i <n; i++)
+			{
+				val[i] = StringUtil.trim(val[i]);
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function findItemRenderer(selectEvent:SparkDataGridItemSelectEvent):Boolean
+		{
+			if (selectEvent.itemAutomationValue && selectEvent.itemAutomationValue.length)
+			{
+				var itemLabel:String = selectEvent.itemAutomationValue;
+				var tabularData:IAutomationTabularData = automationTabularData as IAutomationTabularData;
+				var values:Array = tabularData.getValues(0, tabularData.numRows);
+				var length:int = values.length;
+
+				var part:AutomationIDPart = new AutomationIDPart();
+				part.automationName = itemLabel;
+
+				var labels:Array = itemLabel.split("|");
+
+				trimArray(labels);
+
+				var index:int = 0;
+				for each (var a:Array in values)
+				{
+					values[index] = [];
+					trimArray(a);
+					for each (var b:String in a)
+					{
+						var splitArray:Array = b.split("|");
+						for each ( var c:String in splitArray)
+						values[index].push(c);
+					}
+					trimArray(values[index]);
+					++index;
+				}
+
+				var n:int = labels.length;
+				var i:int;
+				for (i = 0; i < n; i++)
+				{
+					var lString:String = labels[i];
+					if (lString.charAt(0) == "*" && lString.charAt(lString.length-1) == "*")
+						labels[i] = lString.substr(1, lString.length-2);
+				}
+				for (i = 0; i < length; i++)
+				{
+					if(compare(labels, values[i]))
+					{
+						grid.ensureCellIsVisible(i);
+						var ao:IAutomationObject = Automation.automationManager.resolveIDPartToSingleObject(uiAutomationObject, part);
+
+						if (ao)
+						{
+							selectEvent.itemRenderer = ao as IGridItemRenderer;
+							return true;
+						}
+					}
+				}
+			}
+
+			return false;
+		}
+
+		/**
+		 *  @private
+		 */
+		public function getItemAutomationValue(item:IAutomationObject):String
+		{
+			return getItemAutomationNameOrValueHelper(item, false);
+		}
+
+		/**
+		 *  @private
+		 */
+		public function getItemAutomationName(item:IAutomationObject):String
+		{
+			return getItemAutomationNameOrValueHelper(item, true);
+		}
+
+		/**
+		 * @private
+		 */
+		public function getItemAutomationIndex(delegate:IAutomationObject):String
+		{
+			var item:IGridItemRenderer = delegate as IGridItemRenderer;
+			/*if (item == grid.itemEditorInstance && grid.editedItemPosition)
+			item = grid.editedItemRenderer;*/
+			var row:int = item.rowIndex;
+			if(row >= 0 && item.column)
+			{
+				return (item.column.dataField + ":" + row);
+			}
+			return getItemAutomationName(delegate);
+		}
+
+
+		/**
+		 *  @private
+		 */
+		private function getItemAutomationNameOrValueHelper(delegate:IAutomationObject,
+															useName:Boolean):String
+		{
+			var result:Array = [];
+			var item:IGridItemRenderer = delegate as IGridItemRenderer;
+
+			/*if (item == grid.itemEditorInstance)
+			item = grid.editedItemRenderer;*/
+
+			var row:int = item.rowIndex;
+			var isHeader:Boolean = false;
+
+			if (row == int.MIN_VALUE)
+			{
+				// return null;  -- this is commented after the header related
+				// changes in DG.
+
+				// now for the headers also , it cmes as min_value
+				// so we cannot make out header or invalid renderer
+				//isHeader = grid.headerVisible;
+			}
+
+
+			/*row = row < grid.lockedRowCount ?
+			row :
+			row - grid.verticalScrollPosition; */
+
+			/*if (row >= 0)
+			{
+			if (grid.headerVisible)
+			++row;
+			}
+			else if (isHeader)
+			row = 0;*/
+
+
+			var listItems:Array = getCompleteRenderersArray();
+			//var listItems:Array = grid.rendererArray; .. changed as above to take care of the
+			// locked row and locked column changed handling of DG
+
+			// this varaible is added, since we are proceeding
+			// even if the itemRendererToIndex is returning  int.MIN_VALUE
+			// we are assuming that the user clicked the header in this case
+			// But we need to find whether this is valid
+			// this is found by checking whether we get the clicked item
+			// in one of the column header renderer
+			var validItemRendererFound:Boolean = false;
+			var tabData:IAutomationTabularData = automationTabularData as IAutomationTabularData;
+			var firstVisibleRowIndex:int = tabData.firstVisibleRow;
+			//row = row - firstVisibleRowIndex;
+			for (var col:int = 0; col < listItems[row].length; col++)
+			{
+				var i:IGridItemRenderer = listItems[row][col];
+				/*if(i == grid.editedItemRenderer)
+				i = grid.itemEditorInstance;*/
+				var itemDelegate:IAutomationObject = i as IAutomationObject;
+				var s:String = (useName
+					? itemDelegate.automationName
+					: itemDelegate.automationValue.join(" | "));
+				if ( i == item )
+				{
+					// we got a valid item renderer
+					s= "*" + s + "*";
+					validItemRendererFound= true;
+				}
+				result.push(s);
+			}
+
+			if(isHeader && (validItemRendererFound==false))
+			{
+				// we got the itemRendererToIndex(item) as int.MIN_VALUE
+				// so we considered it as a header row
+				// but no element on the header row match with the
+				// current item renderer. Hence returning null
+				return null;
+			}
+			return (isHeader
+				? "[" + result.join("] | [") + "]"
+				: result.join(" | "));
+		}
+
+		/**
+		 * private
+		 */
+		protected function addScrollers(chilArray:Array):Array
+		{
+
+			var count:int = grid.numChildren;
+			for (var i:int=0; i<count; i++)
+			{
+				var obj:Object = grid.getChildAt(i);
+				// here if are getting scrollers, we need to add the scrollbars. we dont need to
+				// consider the view port contents as the data content is handled using the renderes.
+				if(obj is spark.components.Scroller)
+				{
+					var scroller:spark.components.Scroller = obj as spark.components.Scroller;
+					if(scroller.horizontalScrollBar && scroller.horizontalScrollBar.visible)
+						chilArray.push(scroller.horizontalScrollBar);
+					if(scroller.verticalScrollBar && scroller.verticalScrollBar.visible)
+						chilArray.push(scroller.verticalScrollBar);
+				}
+			}
+
+
+			var scrollBars:Array = getScrollBars(grid,null);
+			var n:int = scrollBars? scrollBars.length : 0;
+
+			for ( i=0; i<n ; i++)
+			{
+				chilArray.push(scrollBars[i]);
+			}
+			return chilArray;
+		}
+
+		//--------------------------------------------------------------------------------
+		//
+		//		Overridden Methods
+		//
+		//--------------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function replayAutomatableEvent(interaction:Event):Boolean
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			var mouseEvent:MouseEvent;
+			switch (interaction.type)
+			{
+				case MouseEvent.CLICK:
+				{
+					return help.replayClick(grid.columnHeaderBar, MouseEvent(interaction));
+				}
+				case GridEvent.GRID_DOUBLE_CLICK:
+				{
+					var clickEvent:GridEvent = GridEvent(interaction);
+					return replayMouseDoubleClickOnItem(grid.grid.getItemRendererAt(clickEvent.rowIndex, clickEvent.columnIndex) as IGridItemRenderer);
+				}
+				case KeyboardEvent.KEY_DOWN:
+				{
+					grid.setFocus();
+					return help.replayKeyDownKeyUp(uiComponent, KeyboardEvent(interaction).keyCode);
+				}
+				case SparkDataGridItemSelectEvent.SELECT_INDEX:
+				case SparkDataGridItemSelectEvent.SELECT:
+				{
+					var completeTime:Number = getTimer() + grid.getStyle("selectionDuration");
+
+					help.addSynchronization(function():Boolean
+					{
+						return getTimer() >= completeTime;
+					});
+
+					var lise:SparkDataGridItemSelectEvent = SparkDataGridItemSelectEvent(interaction);
+
+					if (interaction.type == SparkDataGridItemSelectEvent.SELECT_INDEX)
+					{
+						/*grid.grid.scrollToIndex(lise.itemIndex);
+						lise.itemRenderer = getItemRendererForEvent(lise);*/
+					}
+					else
+					{
+						if (!lise.itemRenderer)
+							findItemRenderer(lise);
+					}
+
+
+					// keyboard and mouse are currently treated the same
+					if (lise.triggerEvent is MouseEvent)
+					{
+						return replayMouseClickOnItem(lise.itemRenderer,
+							lise.ctrlKey,
+							lise.shiftKey,
+							lise.altKey);
+					}
+					else if (lise.triggerEvent is KeyboardEvent)
+					{
+						return help.replayKeyDownKeyUp(lise.itemRenderer,
+							Keyboard.SPACE,
+							lise.ctrlKey,
+							lise.shiftKey,
+							lise.altKey);
+					}
+					else
+					{
+						throw new Error();
+					}
+				}
+					/*case "headerShift":
+					{
+					var icEvent:IndexChangedEvent = IndexChangedEvent(interaction);
+					grid.shiftColumns(icEvent.oldIndex, icEvent.newIndex);
+					return true;
+					}
+
+					case DataGridEvent.HEADER_RELEASE:
+					{
+					var listItems:Array = getCompleteRenderersArray();
+					//var listItems:Array = grid.rendererArray; .. changed as above to take care of the
+					// locked row and locked column changed handling of DG
+
+					var c:IListItemRenderer = listItems[0][DataGridEvent(interaction).columnIndex];
+					return help.replayClick(c);
+					}
+
+					case DataGridEvent.COLUMN_STRETCH:
+					{
+					var s:IFlexDisplayObject = DataGridHeader((grid .dataGridHeader)). getSeparators()[DataGridEvent(interaction).columnIndex];
+
+					s.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
+					// localX needs to be passed in the constructor
+					// to get stageX value computed.
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_UP,
+					true, // bubble
+					false, // cancellable
+					DataGridEvent(interaction).localX,
+					20, // dummy value
+					uiComponent as InteractiveObject );
+					return help.replayMouseEvent(uiComponent, mouseEvent);
+
+
+					}
+
+					case DataGridEvent.ITEM_EDIT_BEGIN:
+					{
+					var de:DataGridEvent = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING);
+					var input:DataGridEvent = interaction as DataGridEvent;
+					de.itemRenderer = input.itemRenderer;
+					de.rowIndex = input.rowIndex;
+					de.columnIndex = input.columnIndex;
+					uiComponent.dispatchEvent(de);
+					}*/
+
+				case ListItemSelectEvent.DESELECT:
+				case ListItemSelectEvent.MULTI_SELECT:
+				case ListItemSelectEvent.SELECT:
+				default:
+				{
+					return super.replayAutomatableEvent(interaction);
+				}
+			}
+		}
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			var listItems:Array = getCompleteRenderersArray();
+			//var listItems:Array = grid.rendererArray; .. changed as above to take care of the
+			// locked row and locked column changed handling of DG
+
+			var numCols:int = grid.columns.length;
+			var row:uint = uint(numCols == 0 ? 0 : index / numCols);
+			var col:uint = uint(numCols == 0 ? index : index % numCols);
+			var item:IGridItemRenderer = listItems[row][col];
+
+			/*if (grid.itemEditorInstance &&
+			grid.editedItemPosition &&
+			item == grid.editedItemRenderer)
+			{
+			return grid.itemEditorInstance as IAutomationObject;
+			}*/
+
+			return  item as IAutomationObject;
+		}
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildren():Array
+		{
+			var childrenList:Array = new Array();
+			var listItems:Array = getCompleteRenderersArray();
+
+			// we get this as the 2 dim array of row and columns
+			// we need to make this as single element array
+			//while (!listItems[row][col]
+			var rowcount:int  = listItems?listItems.length:0;
+			if (rowcount != 0)
+			{
+				var colCount:int = grid.columns.length;
+				/*if ((listItems[0]) is Array)
+				coulumcount = (listItems[0] as Array).length;*/
+
+				for (var i:int = 0; i < rowcount ; i++)
+				{
+					for (var j:int = 0; j < colCount ; j++)
+					{
+						var item:IGridItemRenderer = listItems[i][j];
+						/*if (item)
+						{*/
+						/*if (grid.itemEditorInstance &&
+						grid.editedItemPosition &&
+						item == grid.editedItemRenderer)
+
+						childrenList.push(grid.itemEditorInstance as IAutomationObject);
+						else*/
+						childrenList.push(item as IAutomationObject);
+						//}
+					}
+				}
+			}
+			childrenList = addScrollers(childrenList);
+			return  childrenList;
+		}
+
+
+		//--------------------------------------------------------------------------
+		//
+		//  Event handlers
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		protected function mouseClickHandler(event:MouseEvent):void
+		{
+			if (!Automation.automationManager || !Automation.automationManager.automationEnvironment
+				|| !Automation.automationManager.recording)
+				return;
+			var gbPt:Point = event.target.localToGlobal(new Point(event.localX, event.localY));
+			var locPt:Point = grid.grid.globalToLocal(gbPt);
+
+			var item:IGridItemRenderer = grid.grid.getItemRendererAt(grid.grid.getRowIndexAt(locPt.x, locPt.y),
+											grid.grid.getColumnIndexAt(locPt.x, locPt.y)) as IGridItemRenderer;
+			if (!item)
+			{
+				//DataGrid overrides displayObjectToItemRenderer to return
+				//null if the item is the active item editor, so that's
+				//not a reliable way of determining if the user clicked on a blank
+				//row or now, so use mouseEventToItemRendererOrEditor instead
+				//if (listBase.mouseEventToItemRendererOrEditor(event) == null)
+				recordAutomatableEvent(event, true)
+				/*return;*/
+			}
+			else
+			{
+				// take the key modifiers from the mouseDown event because
+				// they were used by List for making the selection
+				event.ctrlKey = ctrlKeyDown;
+				event.shiftKey = shiftKeyDown;
+				recordDGItemSelectEvent(item, event);
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		public function childAddedHandler(event:Event):void
+		{
+			var child:Object = event.target;
+
+			if (child is IGridItemRenderer && child.parent == grid.grid)
+			{
+				IGridItemRenderer(child).owner = grid;
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function mouseDownHandler(event:MouseEvent):void
+		{
+			ctrlKeyDown = event.ctrlKey;
+			shiftKeyDown = event.shiftKey;
+		}
+
+		/**
+		 *  @private
+		 */
+		override protected function keyDownHandler(event:KeyboardEvent):void
+		{
+			if (//grid.itemEditorInstance ||
+				event.target != event.currentTarget)
+				return;
+
+			if (event.keyCode == Keyboard.SPACE)
+			{
+				var caretRowIndex:int = grid.grid.caretRowIndex;
+				if (caretRowIndex != -1)
+				{
+					var caretColumnIndex:int = grid.grid.caretColumnIndex;
+					if(caretColumnIndex == -1)
+						caretColumnIndex = 0;
+					var item:IGridItemRenderer = grid.grid.getItemRendererAt(caretRowIndex,caretColumnIndex) as IGridItemRenderer;
+					recordDGItemSelectEvent(item, event);
+				}
+			}
+			else if (event.keyCode != Keyboard.SPACE &&
+				event.keyCode != Keyboard.CONTROL &&
+				event.keyCode != Keyboard.SHIFT &&
+				event.keyCode != Keyboard.TAB)
+			{
+				recordAutomatableEvent(event);
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		/*private function columnStretchHandler(event:DataGridEvent):void
+		{
+		recordAutomatableEvent(event);
+		}*/
+
+		/**
+		 *  @private
+		 */
+		/*private function headerReleaseHandler(event:DataGridEvent):void
+		{
+		recordAutomatableEvent(event);
+		}*/
+
+		/**
+		 *  @private
+		 */
+		/*private function headerShiftHandler(event:IndexChangedEvent):void
+		{
+		if (event.triggerEvent)
+		recordAutomatableEvent(event);
+		}*/
+
+		/**
+		 *  @private
+		 */
+		/*private function itemEditHandler(event:DataGridEvent):void
+		{
+		recordAutomatableEvent(event, true);
+		}*/
+
+		/**
+		 *  @private
+		 */
+		/*protected function dragDropHandler(event:DragEvent):void
+		{
+		if(dragScrollEvent)
+		{
+		recordAutomatableEvent(dragScrollEvent);
+		dragScrollEvent=null;
+		}
+
+		var am:IAutomationManager = Automation.automationManager;
+		var index:int = grid.calculateDropIndex(event);
+		var drag:AutomationDragEvent = new AutomationDragEvent(event.type);
+		drag.action = event.action;
+
+		if (grid.dataProvider && index != grid.dataProvider.length)
+		{
+		//increment the index if headers are being shown
+		if(grid.headerVisible)
+		++index;
+
+		if (index >= grid.lockedRowCount)
+		index -= grid.verticalScrollPosition;
+
+		var completeListitems:Array = getCompleteRenderersArray();
+
+		//var rc:Number = grid.rendererArray.length;
+		var rc:Number = completeListitems.length;
+
+		if (index >= rc)
+		index = rc - 1;
+
+		if (index < 0)
+		index = 0;
+
+		//if(grid.rendererArray && grid.rendererArray[0] && grid.rendererArray[0].length)
+		//index = index * grid.rendererArray[0].length;
+
+		if(completeListitems && completeListitems[0] && completeListitems[0].length)
+		index = index * completeListitems[0].length;
+
+		drag.draggedItem = getAutomationChildAt(index);
+		}
+
+		preventDragDropRecording = false;
+		am.recordAutomatableEvent(uiAutomationObject, drag);
+		preventDragDropRecording = true;
+		}*/
+	}
+}


fixed error in function typing comment

fixed error in function typing comment

--- WeaveJS/src/weavejs/util/Dictionary2D.as
+++ WeaveJS/src/weavejs/util/Dictionary2D.as
@@ -141,7 +141,7 @@
 		 * @param key1_key2_value A function which may return true to stop iterating.
 		 * @param thisArg The 'this' argument for the function.
 		 */
-		public function forEach(key1_key2_value:/*/(key1:K1, key2:K2, value:V) => void/*/Function, thisArg:Object):void
+		public function forEach(key1_key2_value:/*/(key1:K1, key2:K2, value:V) => void|boolean/*/Function, thisArg:Object):void
 		{
 			if (weak1 || weak2)
 				throwWeakIterationError();