Transferred from the Adobe Open Source Subversion Repository

Revision: 21683
Author:   chiedozi@adobe.com
Date:     2011-07-21T23:18:41.186033Z

Log Message:
-----------
Initial checkin of SplitViewNavigator component and its skin.  This includes small alterations to various ViewTransition classes.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/IVisualElementContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as
@@ -0,0 +1,624 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 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.components
+{
+import flash.display.DisplayObjectContainer;
+import flash.display.StageAspectRatio;
+import flash.events.Event;
+
+import mx.core.EventPriority;
+import mx.core.FlexGlobals;
+import mx.core.IDeferredInstance;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.events.ResizeEvent;
+
+import spark.components.supportClasses.ViewNavigatorBase;
+import spark.events.ElementExistenceEvent;
+import spark.events.PopUpEvent;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  SkinStates
+//--------------------------------------
+
+/**
+ *  This skin state is triggered when the aspectRatio of the main
+ *  application is changed to portrait.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3
+ *  @productversion Flex 4.5.2
+ */
+[SkinState("portrait")]
+
+/**
+ *  The state is triggered when the aspectRatio of the main
+ *  application is changed to landscape.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3
+ *  @productversion Flex 4.5.2
+ */
+[SkinState("landscape")]
+
+/**
+ *  SplitViewNavigator is a component responsible for displaying multiple
+ *  ViewNavigators at the same time in a single container.  SplitViewNavigator
+ *  takes ViewnNavigatorBase objects as children and lays them out as
+ *  defined by its layout property.  This component is useful for
+ *  creating a master/detail interface on a mobile device. There is no limit to
+ *  the amount of child navigators this component can manage.
+ *
+ *
If the autoHideFirstViewNavigator property is set to
+ *  true, the SplitViewNavigator will automatically hide the
+ *  navigator that is at index 0 when the top level application has a
+ *  portrait aspect ratio.  The navigator will be redisplayed when the
+ *  application is reoriented into a landsacpe orientation.  A developer
+ *  can manually hide and show a navigator by toggling the visble
+ *  flag on the child.  When set, the includeInLayout property
+ *  of that child will be set to match.

+ *
+ *
SplitViewNavigator adds the additional functionalilty of temporarily
+ *  displaying the first navigator inside a Callout component.  When the
+ *  showFirstViewNavigatorInCallout() method is called, the
+ *  first navigator is displayed in a callout until the
+ *  hideViewNavigatorCallout() method is called, or the user
+ *  touches outside the bounds of the callout.  It is important to note that
+ *  when a navigator is displayed in a callout, it is reparented as a child of
+ *  that container.  This means using IVisualElementContainer methods such as
+ *  getElementAt() on SplitViewNavigator may not return the
+ *  expected results.  If a developer wants to access the first or second
+ *  navigator, it is recommended that they use the firstViewNavigator
+ *  and secondViewNavigator properties.  These will always return
+ *  the correct navigator regardless of whether a navigator is in a callout or not.

+ *
+ *  @see spark.components.ViewNavigatorBase
+ *  @see spark.components.ViewNavigator
+ *  @see spark.components.TabbedViewNavigator
+ *  @see spark.components.Application#aspectRatio
+ *  @see spark.components.Callout
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3
+ *  @productversion Flex 4.5.2
+ */
+public class SplitViewNavigator extends ViewNavigatorBase
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function SplitViewNavigator()
+    {
+        super();
+
+        addEventListener(ElementExistenceEvent.ELEMENT_ADD, elementAddHandler);
+        addEventListener(ElementExistenceEvent.ELEMENT_REMOVE, elementRemoveHandler);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin Parts
+    //
+    //--------------------------------------------------------------------------
+
+    [SkinPart(required="false")]
+    /**
+     *  The Callout used to display a navigator when
+     *  showFirstViewNavigatorInCallout() is called.
+     */
+    public var viewNavigatorCallout:Callout;
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+     *  Tracks what the last aspectRatio of the application was to determine
+     *  whether the component should hide or show the first navigator when
+     *  autoHideFirstNavigator is set to true.
+	 */
+	private var lastAspectRatio:String;
+
+    /**
+     *  @private
+     *  Stores the original element index of the navigator that is reparented
+     *  into the callout.
+     */
+    private var _calloutNavigatorIndex:int = -1;
+
+    /**
+     *  @private
+     *  A reference to the navigator that is being displayed in the callout
+     */
+    private var _calloutNavigator:ViewNavigatorBase = null;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  autoHideFirstViewNavigator
+    //----------------------------------
+
+    private var _autoHideFirstViewNavigator:Boolean = false;
+
+    [Bindable("autoHideChanged")]
+	[Inspectable(category="General", defaultValue="false")]
+    /**
+     *  This flag indicates whether the visibility of the first view navigator should
+	 *  automatically be toggled when the device receives an orientation change event.
+	 *  When true, the first navigator is hidden as the device enters the portrait
+	 *  orientation, and shown when entering a landscape orientation.
+     *
+     *
If this flag is set to true while the application is in a portrait
+     *  orientation, the navigator is not hidden until the next orientation
+     *  resize event.

+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function get autoHideFirstViewNavigator():Boolean
+    {
+        return _autoHideFirstViewNavigator;
+    }
+
+    /**
+     *  @private
+     */
+    public function set autoHideFirstViewNavigator(value:Boolean):void
+    {
+		if (_autoHideFirstViewNavigator == value)
+			return;
+
+        _autoHideFirstViewNavigator = value;
+
+        if (hasEventListener("autoHideChanged"))
+            dispatchEvent(new Event("autoHideChanged"));
+    }
+
+    //----------------------------------
+    //  firstViewNavigator
+    //----------------------------------
+
+    /**
+     *  The first ViewNavigator of this component.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function get firstViewNavigator():ViewNavigatorBase
+    {
+        return getViewNavigatorAt(0);
+    }
+
+    //----------------------------------
+    //  secondViewNavigator
+    //----------------------------------
+
+    /**
+     *  The second ViewNavigator of this component.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function get secondViewNavigator():ViewNavigatorBase
+    {
+        return getViewNavigatorAt(1);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  mxmlContentFactory
+    //----------------------------------
+
+    [InstanceType("Array")]
+    [ArrayElementType("spark.components.supportClasses.ViewNavigatorBase")]
+    /**
+     *  @private
+     *  Override this setter so that we can restrict the mxmlContent type to
+     *  ViewNavigatorBase.
+     */
+    override public function set mxmlContentFactory(value:IDeferredInstance):void
+    {
+        super.mxmlContentFactory = value;
+    }
+
+    //----------------------------------
+    //  initialized
+    //----------------------------------
+    /**
+     *  @private
+     */
+    override public function set initialized(value:Boolean):void
+    {
+        // Add application resize event listener
+        FlexGlobals.topLevelApplication.addEventListener(ResizeEvent.RESIZE,
+            application_resizeHandler, false, EventPriority.DEFAULT, true);
+
+        // Toggle visibility of the firstViewNavigator if autoHideFirstViewNavigator is true
+        if (firstViewNavigator && autoHideFirstViewNavigator)
+            application_resizeHandler(null);
+
+        super.initialized = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Displays the child navigator at index 0 inside a callout.  The navigator
+     *  is reparented as a child of the callout.
+     *
+     *
Since the navigator is reparented, using getElementAt(0)
+     *  will not return the first navigator, but will return the second one.
+     *  It is recommended that developers use firstViewNavigator and
+     *  secondViewNavigator properties to access the navigators.

+     *
+     *
The callout height is fixed by the component but can be changed by
+     *  reskinning or by manually setting the height property on the
+     *  viewNavigatorCallout skinPart.

+     *
+     *
If the callout is already open or the callout skinpart does not exist,
+     *  this method will do nothing.

+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function showFirstViewNavigatorInCallout(owner:DisplayObjectContainer):void
+    {
+        showNavigatorAtIndexInCallout(0, owner);
+    }
+
+    /**
+     *  Hides the navigator callout if its open.  The navigator that was
+     *  displayed in the callout will be reparented as a child of this
+     *  SplitViewNavigator.
+     *
+     *
This method is automatically called if the user touches outside
+     *  of the callout when it is visible.  The navigator inside the callout
+     *  will be invisible after the callout is closed.

+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function hideViewNavigatorCallout():void
+    {
+		if (!viewNavigatorCallout|| !viewNavigatorCallout.isOpen)
+			return;
+
+        viewNavigatorCallout.addEventListener(PopUpEvent.CLOSE, navigatorCallout_closeHandler);
+		viewNavigatorCallout.close(true);
+		viewNavigatorCallout.removeEventListener('mouseDownOutside', navigatorCallout_mouseDownOutsideHandler);
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Private Methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  This method is used to get a reference to a specific navigator.  Since
+     *  a navigator can be visible inside a callout, getElementAt() is not
+     *  sufficient because one of the navigators is no longer a child of the
+     *  container.
+     */
+    mx_internal function getViewNavigatorAt(index:int):ViewNavigatorBase
+    {
+        // If the index is the navigator currently in the callout, return it
+        if (_calloutNavigatorIndex == index)
+            return _calloutNavigator;
+
+        // Since a callout is visible, one of the navigators has been removed
+        // from this display tree.  If the index of the navigator in the callout
+        // is before the passed index, decrement it by 1 so that it reflects
+        // the current indicies of the child navigatos.
+        if (_calloutNavigatorIndex != -1 && _calloutNavigatorIndex < index)
+            index--;
+
+        return getElementAt(index) as ViewNavigatorBase;
+    }
+
+    /**
+     *  @private
+     *  Shows the navigator at the specified index in the callout component.
+     */
+    mx_internal function showNavigatorAtIndexInCallout(index:int, owner:DisplayObjectContainer):void
+    {
+        // TODO (chiedozi): Consider replacing the navigator in the callout if
+        // it is already open.
+        if (index >= numElements || !viewNavigatorCallout|| viewNavigatorCallout.isOpen)
+            return;
+
+        _calloutNavigatorIndex = index;
+        _calloutNavigator = getElementAt(index) as ViewNavigatorBase;
+
+        viewNavigatorCallout.addEventListener('mouseDownOutside', navigatorCallout_mouseDownOutsideHandler, false, 0, true);
+        viewNavigatorCallout.addElement(_calloutNavigator);
+        viewNavigatorCallout.open(owner, true);
+
+        // Make sure the first navigator is visible
+        _calloutNavigator.visible = true;
+    }
+
+    /**
+     *  @private
+     */
+    private function navigatorCallout_closeHandler(event:PopUpEvent):void
+    {
+        viewNavigatorCallout.removeEventListener(PopUpEvent.CLOSE, navigatorCallout_closeHandler);
+
+        if (_calloutNavigator)
+            restoreNavigatorInCallout();
+
+        // When an orientation change occurs, the callout's visibility may be set to false.
+        // Set it back to true so that it is visible the next time it is opened.
+        viewNavigatorCallout.visible = true;
+    }
+
+    /**
+     *  @private
+     */
+    private function restoreNavigatorInCallout():void
+    {
+        // Restore navigator parent
+        addElementAt(_calloutNavigator, _calloutNavigatorIndex);
+
+        if (autoHideFirstViewNavigator && _calloutNavigatorIndex == 0)
+        {
+            toggleFirstNavigatorVisibility();
+        }
+        else
+        {
+            _calloutNavigator.visible = false;
+        }
+
+        _calloutNavigator = null;
+        _calloutNavigatorIndex = -1;
+    }
+
+    /**
+     *  @private
+     */
+    private function elementAddHandler(event:ElementExistenceEvent):void
+    {
+        var navigator:ViewNavigatorBase = event.element as ViewNavigatorBase;
+
+        if (navigator)
+            setupNavigator(navigator);
+    }
+
+    /**
+     *  @private
+     */
+    private function elementRemoveHandler(event:ElementExistenceEvent):void
+    {
+        if (event.element != _calloutNavigator)
+        {
+            var navigator:ViewNavigatorBase = event.element as ViewNavigatorBase;
+
+            if (navigator)
+               cleanUpNavigator(event.element as ViewNavigatorBase);
+        }
+    }
+
+	/**
+	 *  @private
+	 */
+	mx_internal function application_resizeHandler(event:ResizeEvent):void
+	{
+		if (!firstViewNavigator)
+			return;
+
+		var aspectRatio:String = FlexGlobals.topLevelApplication.aspectRatio;
+
+		// Only do the logic below if the aspectRatio has changed
+		if (lastAspectRatio == aspectRatio)
+			return;
+
+		lastAspectRatio = aspectRatio;
+
+		if (autoHideFirstViewNavigator)
+		{
+            // The navigator in the callout needs to be immediately reparented
+            // when the orientation changes since we don't provide orientation
+            // effects.  Because of this, we don't want to see any close
+            // transitions to play on the callout.  Since the transitions are
+            // defined on the skin, there is no way to intercept them, so instead
+            // the callout is hidden.  restoreNavigatorInCallout() will call
+            // toggleFirstNavigatorVisibility() if needed.
+            if (_calloutNavigator)
+            {
+                restoreNavigatorInCallout();
+                viewNavigatorCallout.visible = false;
+            }
+            else
+            {
+                toggleFirstNavigatorVisibility();
+            }
+		}
+
+        // The navigator callout is always hidden if the orientation changes
+        hideViewNavigatorCallout();
+	}
+
+    /**
+     *  @private
+     */
+    private function toggleFirstNavigatorVisibility():void
+    {
+        var aspectRatio:String = FlexGlobals.topLevelApplication.aspectRatio;
+
+        if (aspectRatio == StageAspectRatio.PORTRAIT)
+        {
+            firstViewNavigator.visible = false;
+        }
+        else
+        {
+            firstViewNavigator.visible = true;
+        }
+    }
+
+	/**
+	 *  @private
+	 */
+	private function navigatorCallout_mouseDownOutsideHandler(event:Event):void
+	{
+		hideViewNavigatorCallout();
+	}
+
+	/**
+	 *  @private
+	 */
+	private function setupNavigator(navigator:ViewNavigatorBase):void
+	{
+		navigator.setParentNavigator(this);
+
+		// Add weak listeners for hide and show events on the navigator.  When
+		// a navigator is hidden, its container is removed from layout.
+		navigator.addEventListener(FlexEvent.HIDE, navigator_visibilityChangedHandler, false, EventPriority.DEFAULT, true);
+		navigator.addEventListener(FlexEvent.SHOW, navigator_visibilityChangedHandler, false, EventPriority.DEFAULT, true);
+	}
+
+	/**
+	 *  @private
+	 */
+	private function cleanUpNavigator(navigator:ViewNavigatorBase):void
+	{
+		navigator.setParentNavigator(null);
+		navigator.removeEventListener(FlexEvent.HIDE, navigator_visibilityChangedHandler);
+		navigator.removeEventListener(FlexEvent.SHOW, navigator_visibilityChangedHandler);
+	}
+
+	/**
+	 *  @private
+	 */
+	private function navigator_visibilityChangedHandler(event:FlexEvent):void
+	{
+		var navigator:ViewNavigatorBase = event.target as ViewNavigatorBase;
+
+        if (event.type == FlexEvent.HIDE && navigator == _calloutNavigator)
+            hideViewNavigatorCallout();
+
+        navigator.includeInLayout = navigator.visible;
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overriden Methods: ViewNavigatorBase
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    override public function loadViewData(value:Object):void
+    {
+        super.loadViewData(value);
+
+        var dataArray:Array = value.dataArray;
+
+        // If the data array is null, we won't restore any data
+        if (!dataArray)
+            return;
+
+        // If the callout is visible, one of the navigators isn't a child
+        // of this component.  So the numElements parameter will be off by one.
+        var numNavigators:int = _calloutNavigatorIndex > -1 ? numElements + 1 : numElements;
+
+        // Restore each navigators persistence data
+        for (var i:int = 0; i < numNavigators; i++)
+            getViewNavigatorAt(i).loadViewData(dataArray[i]);
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    override public function saveViewData():Object
+    {
+        var object:Object = super.saveViewData();
+        var dataArray:Array = new Array();
+
+        // If the callout is visible, one of the navigators isn't a child
+        // of this component.  So the numElements parameter will be off by one.
+        var numNavigators:int = _calloutNavigatorIndex > -1 ? numElements + 1 : numElements;
+
+        // Push each navigator's persistence object to the data array
+        for (var i:int = 0; i < numNavigators; i++)
+            dataArray.push(getViewNavigatorAt(i).saveViewData());
+
+        object.dataArray = dataArray;
+        return object;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function validateNow():void
+    {
+        // If a navigator is currently inside a callout, force a validation on it as well.
+        // This was added because ViewNavigator will call validateNow on its parentNavigator
+        // when preparing to do a view transition.  Since the callout navigator is no longer
+        // a child of this SplitViewNavigator, the navigator in the callout isn't validated
+        // as expected.
+        if (_calloutNavigatorIndex != -1)
+            _calloutNavigator.validateNow();
+
+        super.validateNow();
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 4380
Author:   rfrishbe@adobe.com
Date:     2008-12-23T10:00:21.848800Z

Log Message:
-----------
Mostly rename changes in Group and FxContainer.

1.  GraphicElement.elementHost:GroupBase -> GraphicElement.parent:DisplayObjectContainer (parent already exists in the current code-base...I’m just removing elementHost now)

2.  Group content APIs now use “element” instead of “item.”  The new methods were added a while ago, but the old ones co-existed.  These particular changes remove the old methods and strongly type the new ones to deal with IVisualElements rather than Objects.  Here are the overall changes:

numItems:int -> numElements:int
getItemAt(int):Object -> getElementAt(int):IVisualElement
addItem(Object):Object -> addElement(IVisualElement):IVisualElement
addItemAt(Object, int):Object -> addElementAt(IVisualElement, int):IVisualElement
removeItem(Object):Object -> removeElement(IVisualElement):IVisualElement
removeItemAt(int):Object -> removeElementAt(int):IVisualElement
getItemIndex(Object):int -> getElementIndex(IVisualElement):int
setItemIndex(Object, int):void -> setElementIndex(IVisualElement, int):void
swapItems(Object, Object):void -> swapElements(IVisualElement, IVisualElement):void
swapItemsAt(int, int):void -> swapElementsAt(int, int):void

3.  Group and FxContainer's mxmlContent property is now strongly typed as an Array of IVisualElements instead of an Object

4.  Removing ITransformable...there's no need for it.

5.  Had to update Mustella for these changes (the Perforce changes are checked in, and here's the mustella.swc change for checkintests)

QE Notes: Joan and Steve worked with me on changing all the SDK QA tests.
Doc Notes: None
Bugs: SDK-18063
Reviewer: Jason
tests: checkintests, Mustella FxContainer, Group, and DataGroup (Joan ran all tests on an earlier version of these changes, so hopefully nothing broke in the meantime).  Some of the Group/DataGroup ones were failing for me, but I'm pretty sure they're all excluded (tests don't seem to exclude for me when I VPN in...)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/ITransformable.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/flex4/flex4test_testScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/testWheel.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxDefaultComplexItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElementContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/mustella/mustella.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultComplexItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -444,53 +444,33 @@
     //----------------------------------

     /**
+     *  @private
+     *  Storage for the parent property.
+     */
+    private var _parent:DisplayObjectContainer;
+
+    /**
      *  @inheritDoc
      */
     public function get parent():DisplayObjectContainer
     {
-        return elementHost;
-    }
-
-    /**
-     *  @inheritDoc
-     */
-    public function parentChanged(p:DisplayObjectContainer):void
-    {
-        elementHost = GroupBase(p);
-    }
-
-    //----------------------------------
-    //  elementHost
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the elementHost property.
-     */
-    protected var _host:GroupBase;
-
-    /**
-     *  The is a temporary property, which will be removed when all references to
-     *  elementHost have been removed.
-     */
-    public function get elementHost():GroupBase
-    {
-        return _host;
-    }
-
-    /**
-     *  @private
-     */
-    public function set elementHost(value:GroupBase):void
-    {
-        if (_host !== value)
-        {
-            _host = value;
-            if (_host && _host is IInvalidating)
+        return _parent;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public function parentChanged(value:DisplayObjectContainer):void
+    {
+        // Should I check to make sure it's a Group here?
+        if (_parent !== value)
+        {
+            _parent = value;
+            if (_parent && _parent is IInvalidating)
             {
-                IInvalidating(_host).invalidateProperties();
-                IInvalidating(_host).invalidateSize();
-                IInvalidating(_host).invalidateDisplayList();
+                IInvalidating(_parent).invalidateProperties();
+                IInvalidating(_parent).invalidateSize();
+                IInvalidating(_parent).invalidateDisplayList();
             }
         }
     }
@@ -1818,8 +1798,8 @@

         allocateLayoutFeatures();
         layoutFeatures.layer = value;
-        if(_host != null && _host is UIComponent)
-            (_host as UIComponent).invalidateLayering();
+        if(_parent != null && _parent is UIComponent)
+            (_parent as UIComponent).invalidateLayering();
         invalidateProperties();
     }


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@1252085 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
@@ -15,20 +15,16 @@
 	import flash.events.KeyboardEvent;
 	import flash.events.MouseEvent;
 	import flash.geom.Point;
+	import flash.geom.Rectangle;
 	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.IVisualElement;
 	import mx.core.mx_internal;
 	import mx.utils.StringUtil;

@@ -102,9 +98,11 @@
 			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);
+			obj.grid.addEventListener(GridEvent.GRID_MOUSE_UP, gridMouseUpHandler, false, 100, true);
+			obj.addEventListener(GridEvent.SEPARATOR_MOUSE_UP, columnStretchHandler, false, 0, true);
+			obj.addEventListener(GridEvent.GRID_CLICK, gridClickHandler, false, 0 , true);
+			obj.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
 		}

@@ -128,6 +126,8 @@
 		 * @private
 		 */
 		mx_internal var itemAutomationNameFunction:Function = getItemAutomationValue;
+
+		private var itemUnderMouse:IGridItemRenderer;

 		//--------------------------------------------------------------------------
@@ -178,8 +178,7 @@

 			var result:int = listItems.length * grid.columns.length;
 			return result;
-		}
-
+		}

 		//--------------------------------------------------------------------------
 		//
@@ -234,7 +233,7 @@
 		 */
 		protected function recordDGItemSelectEvent(item:IGridItemRenderer,
 												   trigger:Event,
-												   cacheable:Boolean=true):void
+												   cacheable:Boolean=false):void
 		{
 			var selectionType:String = SparkDataGridItemSelectEvent.SELECT;
 			var keyEvent:KeyboardEvent = trigger as KeyboardEvent;
@@ -264,6 +263,16 @@
 			}

 			recordAutomatableEvent(event, cacheable);
+		}
+
+		/**
+		 * @private
+		 */
+		protected function recordDGHeaderClickEvent(item:IGridItemRenderer,
+												   trigger:Event,
+												   cacheable:Boolean=false):void
+		{
+			//recordAutomatableEvent(event, cacheable);
 		}

 		/**
@@ -297,7 +306,7 @@
 		/**
 		 *  @private
 		 */
-		protected function getItemRendererForEvent(lise:ListItemSelectEvent):IGridItemRenderer
+		protected function getItemRendererForEvent(lise:SparkDataGridItemSelectEvent):IGridItemRenderer
 		{
 			var rowIndex:int = lise.itemIndex;
 			//rowIndex = rowIndex < grid.lockedRowCount ? rowIndex : rowIndex - grid.verticalScrollPosition;
@@ -308,7 +317,7 @@
 		/**
 		 *  @private
 		 */
-		protected function fillItemRendererIndex(item:IListItemRenderer, event:ListItemSelectEvent):void
+		protected function fillItemRendererIndex(item:IGridItemRenderer, event:SparkDataGridItemSelectEvent):void
 		{
 			var listItems:Array = getCompleteRenderersArray();

@@ -359,13 +368,17 @@
 		{
 			const rowCount:int = grid.dataProvider.length;
 			const columnCount:int = grid.columns.length;
-			const renderers:Array = new Array(rowCount);
-
+			const renderers:Array = new Array(rowCount+1);
+			renderers[0] = new Array(columnCount);
+			for (var col:int = 0; col < columnCount; col++)
+			{
+				renderers[0][col] = grid.columnHeaderGroup.getHeaderRendererAt(col);
+			}
 			for (var rowIndex:int = 0; rowIndex < rowCount; rowIndex++)
 			{
-				renderers[rowIndex] = new Array(columnCount);
+				renderers[rowIndex+1] = new Array(columnCount);
 				for (var columnIndex:int = 0; columnIndex < columnCount; columnIndex++)
-					renderers[rowIndex][columnIndex] = grid.grid.getItemRendererAt(rowIndex, columnIndex);
+					renderers[rowIndex+1][columnIndex] = grid.grid.getItemRendererAt(rowIndex, columnIndex);
 			}

 			return renderers;
@@ -466,9 +479,10 @@
 		 */
 		public function getItemAutomationIndex(delegate:IAutomationObject):String
 		{
-			var item:IGridItemRenderer = delegate as IGridItemRenderer;
-			/*if (item == grid.itemEditorInstance && grid.editedItemPosition)
-			item = grid.editedItemRenderer;*/
+			var item:Object = delegate;
+			if (item == grid.itemEditorInstance && grid.editor &&
+				(grid.editor.editorRowIndex >= 0) && (grid.editor.editorColumnIndex >= 0))
+				item = grid.editor.editedItemRenderer;
 			var row:int = item.rowIndex;
 			if(row >= 0 && item.column)
 			{
@@ -485,10 +499,10 @@
 															useName:Boolean):String
 		{
 			var result:Array = [];
-			var item:IGridItemRenderer = delegate as IGridItemRenderer;
-
-			/*if (item == grid.itemEditorInstance)
-			item = grid.editedItemRenderer;*/
+			var item:Object = delegate;
+
+			if (item == grid.itemEditorInstance)
+				item = grid.editor.editedItemRenderer;

 			var row:int = item.rowIndex;
 			var isHeader:Boolean = false;
@@ -508,14 +522,14 @@
 			row :
 			row - grid.verticalScrollPosition; */

-			/*if (row >= 0)
-			{
-			if (grid.headerVisible)
-			++row;
-			}
-			else if (isHeader)
-			row = 0;*/
-
+			if (row >= 0)
+			{
+				row = row + 1;
+			}
+			else
+			{
+				row = 0;
+			}

 			var listItems:Array = getCompleteRenderersArray();
 			//var listItems:Array = grid.rendererArray; .. changed as above to take care of the
@@ -530,12 +544,12 @@
 			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 i:IVisualElement = listItems[row][col];
+				if(i == grid.editor.editedItemRenderer)
+					i = grid.itemEditorInstance;
 				var itemDelegate:IAutomationObject = i as IAutomationObject;
 				var s:String = (useName
 					? itemDelegate.automationName
@@ -604,14 +618,51 @@
 		/**
 		 *  @private
 		 */
+		override public function createAutomationIDPart(child:IAutomationObject):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return (help
+				? help.helpCreateIDPart(uiAutomationObject, child, itemAutomationNameFunction,
+					getItemAutomationIndex)
+				: null);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return (help
+				? help.helpCreateIDPartWithRequiredProperties(uiAutomationObject, child, properties,itemAutomationNameFunction,
+					getItemAutomationIndex)
+				: null);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function resolveAutomationIDPart(part:Object):Array
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help ? help.helpResolveIDPart(uiAutomationObject, part) : null;
+		}
+
+		/**
+		 *  @private
+		 */
 		override public function replayAutomatableEvent(interaction:Event):Boolean
 		{
 			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
 			var mouseEvent:MouseEvent;
 			switch (interaction.type)
 			{
-				case MouseEvent.CLICK:
-				{
+				case GridEvent.GRID_CLICK:
+				{
+					var colIndex:int = GridEvent(interaction).columnIndex;
+					var rect:Rectangle = grid.columnHeaderGroup.getHeaderBounds(colIndex);
+					MouseEvent(interaction).localX = rect.left + rect.width/2;
+					MouseEvent(interaction).localY = rect.top + rect.height/2;
 					return help.replayClick(grid.columnHeaderGroup, MouseEvent(interaction));
 				}
 				case GridEvent.GRID_DOUBLE_CLICK:
@@ -684,27 +735,41 @@

 					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));
+					}*/
+
+				case GridEvent.SEPARATOR_MOUSE_UP:
+				{
+					var s:IGridItemRenderer = grid.columnHeaderGroup.getHeaderRendererAt(GridEvent(interaction).columnIndex);
+
+					//s.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 0, 0));
 					// 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:
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, s.width, 10);
+					help.replayMouseEvent(s, mouseEvent);
+
+
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_MOVE, true, false, GridEvent(interaction).localX, 10);
+					help.replayMouseEvent(grid, mouseEvent);
+
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_UP,
+						true, // bubble
+						false, // cancellable
+						GridEvent(interaction).localX,
+						10 // dummy value
+					);
+					help.replayMouseEvent(grid, mouseEvent);
+
+					mouseEvent = new MouseEvent(MouseEvent.CLICK,
+						true, // bubble
+						false, // cancellable
+						GridEvent(interaction).localX,
+						10 // dummy value
+					);
+					return help.replayMouseEvent(grid, mouseEvent);
+
+				}
+
+					/*case DataGridEvent.ITEM_EDIT_BEGIN:
 					{
 					var de:DataGridEvent = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING);
 					var input:DataGridEvent = interaction as DataGridEvent;
@@ -713,10 +778,6 @@
 					de.columnIndex = input.columnIndex;
 					uiComponent.dispatchEvent(de);
 					}*/
-
-				case ListItemSelectEvent.DESELECT:
-				case ListItemSelectEvent.MULTI_SELECT:
-				case ListItemSelectEvent.SELECT:
 				default:
 				{
 					return super.replayAutomatableEvent(interaction);
@@ -738,12 +799,12 @@
 			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;
-			}*/
+			if (grid.itemEditorInstance && grid.editor &&
+				(grid.editor.editorRowIndex >= 0) && (grid.editor.editorColumnIndex >= 0) &&
+				item == grid.editor.editedItemRenderer)
+			{
+				return grid.itemEditorInstance as IAutomationObject;
+			}

 			return  item as IAutomationObject;
 		}
@@ -771,16 +832,16 @@
 					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);
-						//}
+						if (item)
+						{
+							if (grid.itemEditorInstance && grid.editor &&
+								(grid.editor.editorRowIndex >= 0) && (grid.editor.editorColumnIndex >= 0) &&
+								item == grid.editor.editedItemRenderer)
+
+								childrenList.push(grid.itemEditorInstance as IAutomationObject);
+							else
+								childrenList.push(item as IAutomationObject);
+						}
 					}
 				}
 			}
@@ -798,7 +859,7 @@
 		/**
 		 *  @private
 		 */
-		protected function mouseClickHandler(event:MouseEvent):void
+		protected function gridClickHandler(event:GridEvent):void
 		{
 			if (!Automation.automationManager || !Automation.automationManager.automationEnvironment
 				|| !Automation.automationManager.recording)
@@ -807,27 +868,48 @@
 			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)
-			{
+				grid.grid.getColumnIndexAt(locPt.x, locPt.y)) as IGridItemRenderer;
+			if (!item)		//This means user clicked on header
+			{
+				item = grid.columnHeaderGroup.getHeaderRendererAt(event.columnIndex);
 				//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)
+				//if (grid.mouseEventToItemRendererOrEditor(event) == null)
 				recordAutomatableEvent(event, true)
 				/*return;*/
-			}
-			else
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		protected function gridMouseUpHandler(event:GridEvent):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 && item == itemUnderMouse)
 			{
 				// 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);
-			}
-		}
-
+				if(event.itemRenderer != item)
+					return;
+				else
+				{
+					event.ctrlKey = ctrlKeyDown;
+					event.shiftKey = shiftKeyDown;
+					recordDGItemSelectEvent(item, event);
+				}
+			}
+
+		}
 		/**
 		 *  @private
 		 */
@@ -848,6 +930,11 @@
 		{
 			ctrlKeyDown = event.ctrlKey;
 			shiftKeyDown = event.shiftKey;
+			var gbPt:Point = event.target.localToGlobal(new Point(event.localX, event.localY));
+			var locPt:Point = grid.grid.globalToLocal(gbPt);
+
+			itemUnderMouse = grid.grid.getItemRendererAt(grid.grid.getRowIndexAt(locPt.x, locPt.y),
+				grid.grid.getColumnIndexAt(locPt.x, locPt.y)) as IGridItemRenderer;
 		}

 		/**
@@ -883,10 +970,10 @@
 		/**
 		 *  @private
 		 */
-		/*private function columnStretchHandler(event:DataGridEvent):void
-		{
-		recordAutomatableEvent(event);
-		}*/
+		private function columnStretchHandler(event:GridEvent):void
+		{
+			recordAutomatableEvent(event);
+		}

 		/**
 		 *  @private


Bugfixes in URLRequest builtin

Bugfixes in URLRequest builtin

--- src/flash/net/URLRequest.as
+++ src/flash/net/URLRequest.as
@@ -27,13 +27,16 @@
   public native function set data(value:Object):void;
   public native function get method():String;
   public function set method(value:String):void {
+    if (value !== 'get' && value !== 'GET' && value !== 'post' && value !== 'POST') {
+      Error.throwError(ArgumentError, 2004)
+    }
     setMethod(value);
   }
   public native function get contentType():String;
   public native function set contentType(value:String):void;
   public native function get requestHeaders():Array;
   public function set requestHeaders(value:Array):void {
-    setRequestHeaders(requestHeaders);
+    setRequestHeaders(value);
   }
   public native function get digest():String;
   public native function set digest(value:String):void;


Transferred from the Adobe Open Source Subversion Repository

Revision: 14483
Author:   smgilson@adobe.com
Date:     2010-03-01T19:01:18.459430Z

Log Message:
-----------
merge 14456: Adding ASDoc version tags classes

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkRangeAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkRadioButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkPanelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarAutomationImpl.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirFunctionsHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSkinnableContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkValueChangeAutomationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBarBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkNavigatorContentAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTrackBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation/src/mx/automation/events/EventDetails.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkListItemSelectEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTabBarAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableContainerBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/mediaClasses/SparkMuteButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirDragManagerAutomationHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/SOAPResult.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTextBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTitleWindowAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTileGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkToggleButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSpinnerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccConst.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkLabelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkBorderContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkGroupBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkVideoPlayerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableComponentAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGroupAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGroupAutomationImpl.as
@@ -11,231 +11,272 @@

 package spark.automation.delegates.components
 {
-	import flash.display.DisplayObject;
-	import flash.events.Event;
-	import flash.events.KeyboardEvent;
-	import flash.events.MouseEvent;
-
-	import mx.automation.Automation;
-	import mx.automation.IAutomationClass;
-	import mx.automation.IAutomationObject;
-	import mx.automation.IAutomationObjectHelper;
-	import mx.core.EventPriority;
-	import mx.core.IVisualElement;
-	import mx.core.mx_internal;
-
-	import spark.automation.delegates.components.supportClasses.SparkGroupBaseAutomationImpl;
-	import spark.automation.events.SparkListItemSelectEvent;
-	import spark.components.DataGroup;
-	import spark.components.IItemRenderer;
-	import spark.components.Scroller;
-	import spark.events.RendererExistenceEvent;
-
-	use namespace mx_internal;
-
-	[Mixin]
-	public class SparkDataGroupAutomationImpl extends SparkGroupBaseAutomationImpl
-	{
-		include "../../../core/Version.as";
-		//--------------------------------------------------------------------------
-		//
-		//  Class methods
-		//
-		//--------------------------------------------------------------------------
-
-		/**
-		 *  Registers the delegate class for a component class with automation manager.
-		 *
-		 *  @param root The SystemManger of the application.
-		 */
-		public static function init(root:DisplayObject):void
-		{
-			Automation.registerDelegateClass(spark.components.DataGroup, SparkDataGroupAutomationImpl);
-		}
-
-		public function SparkDataGroupAutomationImpl(obj:spark.components.DataGroup)
-		{
-			super(obj);
-		}
-
-		public function get sparkDataGroup():spark.components.DataGroup
-		{
-			return uiComponent as spark.components.DataGroup;
-		}
-
-		//--------------------------------------------------------------------------
-		//
-		//  Overridden methods
-		//
-		//--------------------------------------------------------------------------
-
-		/**
-		 *  @private
-		 *  Replays click interactions on the button.
-		 *  If the interaction was from the mouse,
-		 *  dispatches MOUSE_DOWN, MOUSE_UP, and CLICK.
-		 *  If interaction was from the keyboard,
-		 *  dispatches KEY_DOWN, KEY_UP.
-		 *  Button's KEY_UP handler then dispatches CLICK.
-		 *
-		 *  @param event ReplayableClickEvent to replay.
-		 */
-		override public function replayAutomatableEvent(event:Event):Boolean
-		{
-			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
-
-			if (event is MouseEvent && event.type == MouseEvent.CLICK)
-				return help.replayClick(uiComponent, MouseEvent(event));
-			else if (event is KeyboardEvent)
-			{
-				// the key board events happens on the scroller.
-				var scroller:spark.components.Scroller = getInternalScroller();
-				if(scroller)
-				{
-					var helper:IAutomationObjectHelper = Automation.automationObjectHelper;
-					if(helper)
-						helper.replayKeyboardEvent(scroller,event as KeyboardEvent);
-
-				}
-				return true;
-			}
-			else
-				return super.replayAutomatableEvent(event);
-		}
-
-
-		/**
-		 *  @private
-		 */
-		override public function get numAutomationChildren():int
-		{
-			return sparkDataGroup.numChildren;
-		}
-
-		/**
-		 *  @private
-		 */
-		override public function getAutomationChildAt(index:int):IAutomationObject
-		{
-			return sparkDataGroup.getChildAt(index) as IAutomationObject;
-		}
-
-		/**
-		 * @private
-		 */
-		override protected function componentInitialized():void
-		{
-			addMouseClickHandlerToExistingRenderers();
-
-			if(sparkDataGroup)
-			{
-				sparkDataGroup.addEventListener(
-					RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler, false, 0, true);
-				sparkDataGroup.addEventListener(
-					RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler, false, 0 , true);
-			}
-			super.componentInitialized();
-		}
-
-		protected function dataGroup_rendererAddHandler(event:RendererExistenceEvent):void
-		{
-			var renderer:IVisualElement = event.renderer;
-
-			if (renderer)
-				renderer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler,false,-100,true);
-
-			if(renderer is IAutomationObject)
-				IAutomationObject(renderer).showInAutomationHierarchy = true;
-		}
-
-
-		/**
-		 *  @private
-		 */
-		protected function dataGroup_rendererRemoveHandler(event:RendererExistenceEvent):void
-		{
-			var renderer:Object = event.renderer;
-
-			if (renderer)
-				renderer.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
-		}
-
-		/**
-		 *  @private
-		 */
-
-		protected function mouseDownHandler(event:MouseEvent):void
-		{
-			if(event.currentTarget as IItemRenderer)
-				recordDataGroupItemClickEvent(event.currentTarget as IItemRenderer , event);
-
-		}
-
-		/**
-		 * @private
-		 */
-
-		protected function recordDataGroupItemClickEvent(item:IItemRenderer,
-													 trigger:Event,
-													 cacheable:Boolean=true):void
-		{
-			var selectionType:String = SparkListItemSelectEvent.SELECT;
-			var keyEvent:KeyboardEvent = trigger as KeyboardEvent;
-			var mouseEvent:MouseEvent = trigger as MouseEvent;
-
-			var indexSelection:Boolean = false;
-
-			if (!Automation.automationManager || !Automation.automationManager.automationEnvironment)
-				return ;
-
-			var automationClass:IAutomationClass = Automation.automationManager.automationEnvironment.getAutomationClassByInstance(sparkDataGroup);
-
-			var event:SparkListItemSelectEvent = new SparkListItemSelectEvent(selectionType);
-			if (indexSelection)
-				fillItemRendererIndex(item, event);
-			else
-				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
-		 */
-
-		protected function fillItemRendererIndex(item:IItemRenderer, event:SparkListItemSelectEvent):void
-		{
-			event.itemIndex = sparkDataGroup.getElementIndex(item as IVisualElement);
-
-		}
-
-		protected function addMouseClickHandlerToExistingRenderers():void
-		{
-
-			var count:int = sparkDataGroup? sparkDataGroup.numElements:0;
-			for (var i:int = 0; i<count ; i++)
-			{
-				var currentObj:Object = sparkDataGroup.getElementAt(i);
-				if( currentObj is IItemRenderer)
-					(currentObj as IItemRenderer).addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler,false, -100,true);
-				if(currentObj is IAutomationObject)
-					IAutomationObject(currentObj).showInAutomationHierarchy = true;
-			}
-
-		}
-	}
+    import flash.display.DisplayObject;
+    import flash.events.Event;
+    import flash.events.KeyboardEvent;
+    import flash.events.MouseEvent;
+
+    import mx.automation.Automation;
+    import mx.automation.IAutomationClass;
+    import mx.automation.IAutomationObject;
+    import mx.automation.IAutomationObjectHelper;
+    import mx.core.EventPriority;
+    import mx.core.IVisualElement;
+    import mx.core.mx_internal;
+
+    import spark.automation.delegates.components.supportClasses.SparkGroupBaseAutomationImpl;
+    import spark.automation.events.SparkListItemSelectEvent;
+    import spark.components.DataGroup;
+    import spark.components.IItemRenderer;
+    import spark.components.Scroller;
+    import spark.events.RendererExistenceEvent;
+
+    use namespace mx_internal;
+
+    [Mixin]
+    /**
+     *
+     *  Defines methods and properties required to perform instrumentation for the
+     *  DataGroup control.
+     *
+     *  @see spark.components.DataGroup
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public class SparkDataGroupAutomationImpl extends SparkGroupBaseAutomationImpl
+    {
+        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.5
+         *  @productversion Flex 4
+         */
+        public static function init(root:DisplayObject):void
+        {
+            Automation.registerDelegateClass(spark.components.DataGroup, SparkDataGroupAutomationImpl);
+        }
+
+        /**
+         *  Constructor.
+         *
+         *  @param obj DataGroup object to be automated.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function SparkDataGroupAutomationImpl(obj:spark.components.DataGroup)
+        {
+            super(obj);
+        }
+
+        /**
+         *  The DataGroup object.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get sparkDataGroup():spark.components.DataGroup
+        {
+            return uiComponent as spark.components.DataGroup;
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  @private
+         *  Replays click interactions on the button.
+         *  If the interaction was from the mouse,
+         *  dispatches MOUSE_DOWN, MOUSE_UP, and CLICK.
+         *  If interaction was from the keyboard,
+         *  dispatches KEY_DOWN, KEY_UP.
+         *  Button's KEY_UP handler then dispatches CLICK.
+         *
+         *  @param event ReplayableClickEvent to replay.
+         */
+        override public function replayAutomatableEvent(event:Event):Boolean
+        {
+            var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+
+            if (event is MouseEvent && event.type == MouseEvent.CLICK)
+                return help.replayClick(uiComponent, MouseEvent(event));
+            else if (event is KeyboardEvent)
+            {
+                // the key board events happens on the scroller.
+                var scroller:spark.components.Scroller = getInternalScroller();
+                if(scroller)
+                {
+                    var helper:IAutomationObjectHelper = Automation.automationObjectHelper;
+                    if(helper)
+                        helper.replayKeyboardEvent(scroller,event as KeyboardEvent);
+
+                }
+                return true;
+            }
+            else
+                return super.replayAutomatableEvent(event);
+        }
+
+
+        /**
+         *  @private
+         */
+        override public function get numAutomationChildren():int
+        {
+            return sparkDataGroup.numChildren;
+        }
+
+        /**
+         *  @private
+         */
+        override public function getAutomationChildAt(index:int):IAutomationObject
+        {
+            return sparkDataGroup.getChildAt(index) as IAutomationObject;
+        }
+
+        /**
+         * @private
+         */
+        override protected function componentInitialized():void
+        {
+            addMouseClickHandlerToExistingRenderers();
+
+            if(sparkDataGroup)
+            {
+                sparkDataGroup.addEventListener(
+                    RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler, false, 0, true);
+                sparkDataGroup.addEventListener(
+                    RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler, false, 0 , true);
+            }
+            super.componentInitialized();
+        }
+
+        /**
+         * @private
+         */
+        protected function dataGroup_rendererAddHandler(event:RendererExistenceEvent):void
+        {
+            var renderer:IVisualElement = event.renderer;
+
+            if (renderer)
+                renderer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler,false,-100,true);
+
+            if(renderer is IAutomationObject)
+                IAutomationObject(renderer).showInAutomationHierarchy = true;
+        }
+
+
+        /**
+         *  @private
+         */
+        protected function dataGroup_rendererRemoveHandler(event:RendererExistenceEvent):void
+        {
+            var renderer:Object = event.renderer;
+
+            if (renderer)
+                renderer.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+        }
+
+        /**
+         *  @private
+         */
+
+        protected function mouseDownHandler(event:MouseEvent):void
+        {
+            if(event.currentTarget as IItemRenderer)
+                recordDataGroupItemClickEvent(event.currentTarget as IItemRenderer , event);
+
+        }
+
+        /**
+         * @private
+         */
+
+        protected function recordDataGroupItemClickEvent(item:IItemRenderer,
+                                                     trigger:Event,
+                                                     cacheable:Boolean=true):void
+        {
+            var selectionType:String = SparkListItemSelectEvent.SELECT;
+            var keyEvent:KeyboardEvent = trigger as KeyboardEvent;
+            var mouseEvent:MouseEvent = trigger as MouseEvent;
+
+            var indexSelection:Boolean = false;
+
+            if (!Automation.automationManager || !Automation.automationManager.automationEnvironment)
+                return ;
+
+            var automationClass:IAutomationClass = Automation.automationManager.automationEnvironment.getAutomationClassByInstance(sparkDataGroup);
+
+            var event:SparkListItemSelectEvent = new SparkListItemSelectEvent(selectionType);
+            if (indexSelection)
+                fillItemRendererIndex(item, event);
+            else
+                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
+         */
+
+        protected function fillItemRendererIndex(item:IItemRenderer, event:SparkListItemSelectEvent):void
+        {
+            event.itemIndex = sparkDataGroup.getElementIndex(item as IVisualElement);
+
+        }
+
+        /**
+         * @private
+         */
+        protected function addMouseClickHandlerToExistingRenderers():void
+        {
+
+            var count:int = sparkDataGroup? sparkDataGroup.numElements:0;
+            for (var i:int = 0; i<count ; i++)
+            {
+                var currentObj:Object = sparkDataGroup.getElementAt(i);
+                if( currentObj is IItemRenderer)
+                    (currentObj as IItemRenderer).addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler,false, -100,true);
+                if(currentObj is IAutomationObject)
+                    IAutomationObject(currentObj).showInAutomationHierarchy = true;
+            }
+
+        }
+    }
 }


handle null to prevent RTE

handle null to prevent RTE

--- frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
+++ frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
@@ -78,6 +78,8 @@
 		}
 		public function set text(value:String):void
 		{
+            if (value == null)
+                value == "";
 			_textField.text = value;
 		}


fixed typo

fixed typo

--- source/actionscript/agnostic/src/eu/alebianco/air/extensions/analytics/enum/StatusLevel.as
+++ source/actionscript/agnostic/src/eu/alebianco/air/extensions/analytics/enum/StatusLevel.as
@@ -45,7 +45,7 @@
 		// Utilities.
 		override public function toString():String
 		{
-			return "[Expansion Type (name: " + name + ")]";
+			return "[Status level (name: " + name + ")]";
 		}
 	}
 }


correct example for asx.array.inject

correct example for asx.array.inject

--- src/asx/array/inject.as
+++ src/asx/array/inject.as
@@ -15,7 +15,7 @@
    * @example Summing an array of numbers can be implemented with inject.
    *  <listing version="3.0">
    *  var numbers:Array = [1, 2, 3, 4, 5];
-   *  var sum:Number = inject(0, function(total:Number, n:Number):Number {
+   *  var sum:Number = inject(0, numbers, function(total:Number, n:Number):Number {
    *    return total + n;
    *  });
    *  </listing>


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

--- frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridRendererDescription.as
+++ frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridRendererDescription.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
 {


Added utility function getLocalizedText

Added utility function getLocalizedText

--- collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/metamodel/proxy/LanguageSpecificTextProxy.as
+++ collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/metamodel/proxy/LanguageSpecificTextProxy.as
@@ -6,9 +6,20 @@
  */

 package org.openforis.collect.metamodel.proxy {
+	import mx.collections.IList;

     [Bindable]
     [RemoteClass(alias="org.openforis.collect.metamodel.proxy.LanguageSpecificTextProxy")]
     public class LanguageSpecificTextProxy extends LanguageSpecificTextProxyBase {
+
+		public static function getLocalizedText(list:IList, language = "en"):String {
+			for each (var item:LanguageSpecificTextProxy in list) {
+				if(item.language == language) {
+					return item.text;
+				}
+			}
+			return null;
+		}
+
     }
 }


FLEX-33688 Fixed RTE when list is sorted and items is null

--- frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
+++ frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
@@ -6063,7 +6063,7 @@

         if (useFind)
         {
-            while (items.length)
+            while (items && items.length)
             {
                 var item:Object = items.pop();
                 uid = itemToUID(item);


git-svn-id: https://openwms2005.svn.sourceforge.net/svnroot/openwms2005@1693 fda5f131-174c-0410-8613-e0905860106b

--- org.openwms/trunk/org.openwms.core/org.openwms.core.domain.as/src/main/flex/org/openwms/core/domain/values/PieceUnit.as
+++ org.openwms/trunk/org.openwms.core/org.openwms.core.domain.as/src/main/flex/org/openwms/core/domain/values/PieceUnit.as
@@ -23,11 +23,10 @@
     import org.granite.util.Enum;

     [Bindable]
-    [RemoteClass(alias = "org.openwms.core.domain.values.PieceUnit")]
+    [RemoteClass(alias="org.openwms.core.domain.values.PieceUnit")]
     public class PieceUnit extends Enum {

         public static const PC : PieceUnit = new PieceUnit("PC", _);
-
         public static const DOZ : PieceUnit = new PieceUnit("DOZ", _);

         function PieceUnit(value : String=null, restrictor : *=null) {
@@ -46,4 +45,4 @@
             return PieceUnit(PC.constantOf(name));
         }
     }
-}
+}


fixed bug in backwards compatibility

fixed bug in backwards compatibility

--- WeaveUISpark/src/weave/visualization/plotters/styles/SolidLineStyle.as
+++ WeaveUISpark/src/weave/visualization/plotters/styles/SolidLineStyle.as
@@ -25,7 +25,9 @@
 	import weave.api.core.ICallbackCollection;
 	import weave.api.data.IQualifiedKey;
 	import weave.api.getCallbackCollection;
+	import weave.api.newDisposableChild;
 	import weave.api.newLinkableChild;
+	import weave.api.registerDisposableChild;
 	import weave.api.registerLinkableChild;
 	import weave.api.ui.ILineStyle;
 	import weave.compiler.StandardLib;
@@ -171,11 +173,15 @@
 		}

 		// backwards compatibility
-		[Deprecated(replacement="enable")] public function set enabled(value:Object):void
+		[Deprecated(replacement="enable")] public function get enabled():AlwaysDefinedColumn
 		{
-			try {
-				enable.setSessionState(value['defaultValue']);
-			} catch (e:Error) { }
+			if (!_adc)
+			{
+				_adc = newDisposableChild(this, AlwaysDefinedColumn);
+				_adc.defaultValue.addImmediateCallback(this, function():void { enable.value = _adc.defaultValue.value; });
+			}
+			return _adc;
 		}
+		private var _adc:AlwaysDefinedColumn
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10075
Author:   rfrishbe@adobe.com
Date:     2009-09-09T01:01:58.077369Z

Log Message:
-----------
Cleanups from the spark text changes and some bug fixes for VideoElement.  Also some PARB changes for UIComponent.

TitleBar: Changing the skin part type from Label to Textbase

UIComponent: skipMeasure()->canSkipMeasurement() to be in line with GraphicElement.  This has been PARB approved.
UIComponent: same with hasComplexLayoutMatrix...this replaces hasDeltaIdentityTransform.  This has been PARB approved.

StyleProtoChain: cleanup around what interfaces to use

TextBase: clean up code that’s no longer needed.

VideoElement: Fixing 4 bugs:
SDK-22824: sourceLastPlayed keeps track of what video file we’ve called play() with last.  This way if a user pauses the video and wants to start it up again at the same point, we can call play(null) on the underlying FLVPlayback videoPlayer.  However, anytime the souce changes, we want to null out sourceLastPlayed.  This was causing a bug when someone set the source to null and then reset it to it’s previous value.

SDK-23034 (GUMBO_PRIORITY): This deals with some FLVPlayback quirks around sizing.  I had put in a fix so we weren’t setting width/height on the underlying videoPlayer too many times, but apparently we need to make sure it always gets called once.  Hopefully when switching to Strobe we can cleanup this logic...I put a FIXME in to do this.

SDK-21947/ SDK-22533 - some video files don’t always send out a metadata event.  I’m not quite sure why this is, but in case this happens, we do a check in the ready handler to see whether we should call invalidateSize() to make sure it gets sized properly.

QE notes:-
Doc notes:-
Bugs: SDK-22824, SDK-23034, SDK-21947, SDK-22533
Reviewer: Glenn, Corey
Tests run: checkintests, Button, GraphicTags, VideoElement, and VideoPlayer (some VideoPlayer were failing, but I think it should be fine)
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Skin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/windowClasses/TitleBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/RemoveActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -32,10 +32,6 @@
 import mx.styles.StyleManager;
 import mx.styles.StyleProtoChain;
 import mx.utils.NameUtil;
-
-import spark.components.Group;
-import spark.core.DisplayObjectSharingMode;
-import spark.core.IGraphicElement;

 use namespace mx_internal;

@@ -77,10 +73,6 @@
 /**
  *  The base class for Spark Text controls such as Label and RichText
  *  which display text using CSS styles for the default format.
- *
- *
This class extends GraphicElement to implement
- *  the IAdvancedStyleClient interface in order to support CSS
- *  in the same way that UIComponents do.

  *
  *
In addition to adding a text property,
  *  it also adds maxDisplayedLines
@@ -92,7 +84,6 @@
  *  @productversion Flex 4
  */
 public class TextBase extends UIComponent
-    implements IAdvancedStyleClient
 {
     include "../../core/Version.as";

@@ -166,32 +157,6 @@
      */
     mx_internal var textLines:Vector.<DisplayObject> =
     	new Vector.<DisplayObject>();
-
-    /**
-     *  @private
-	 *  Keeps track of each TextLine's original x position when it was composed.
-	 *  Since multiple TextBases can share a single DisplayObject,
-	 *  the x position of the TextLine gets offset by drawX
-	 *  when it is added to the DisplayObject.
-	 *  We need to save the original position and offset it each time
-	 *  drawX changes; the alternative of accumulating deltas in drawX
-	 *  makes the TextLines drift within the DisplayObject.
-     */
-    mx_internal var textLinesX:Vector.<Number> = new Vector.<Number>;
-
-    // FIXME (rfrishbe): can probably remove textLineX and textLineY
-
-    /**
-     *  @private
-	 *  Keeps track of each TextLine's original y position when it was composed.
-	 *  Since multiple TextBases can share a single DisplayObject,
-	 *  the y position of the TextLine gets offset by drawY
-	 *  when it is added to the DisplayObject.
-	 *  We need to save the original position and offset it each time
-	 *  drawY changes; the alternative of accumulating deltas in drawY
-	 *  makes the TextLines drift within the DisplayObject.
-     */
-    mx_internal var textLinesY:Vector.<Number> = new Vector.<Number>;

     /**
      *  @private
@@ -401,19 +366,6 @@
     }

     //----------------------------------
-    //  styleChainInitialized
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    mx_internal function get styleChainInitialized():Boolean
-    {
-        return inheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED &&
-               nonInheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED;
-    }
-
-    //----------------------------------
     //  text
     //----------------------------------

@@ -423,7 +375,7 @@
     mx_internal var _text:String = "";

     /**
-     *  The text displayed by this GraphicElement.
+     *  The text displayed by this text component.
 	 *
      *
The formatting of this text is controlled by CSS styles.
      *  The supported styles depend on the subclass.

@@ -460,12 +412,6 @@
      */
     override protected function measure():void
     {
-        // The measure() method of a GraphicElement can get called
-        // when its style chain hasn't been initialized
-        // or when no DisplayObject has been assigned to it.
-        if (!styleChainInitialized)
-            return;
-
         // _widthConstraint trumps even explicitWidth as some layouts may choose
         // to specify width different from the explicit.
         var constrainedWidth:Number =
@@ -532,7 +478,7 @@
             return;

         // If we don't measure
-        if (skipMeasure())
+        if (canSkipMeasurement())
             return;

         if (!isNaN(explicitHeight))
@@ -570,30 +516,8 @@
     override protected function updateDisplayList(unscaledWidth:Number,
                                                   unscaledHeight:Number):void
     {
-        //trace(id, drawnDisplayObject.name, "updateDisplayList", unscaledWidth, unscaledHeight);
-
+        //trace(id, drawnDisplayObject.name, "updateDisplayList", unscaledWidth, unscaledHeight);
         super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-        // The updateDisplayList() method of a GraphicElement can get called
-        // when its style chain hasn't been initialized
-        // or when no DisplayObject has been assigned to it.
-        if (!styleChainInitialized)
-            return;
-
-        // FIXME (rfrishbe): do we still need this?
-        if (visibleChanged)
-        {
-            visibleChanged = false;
-
-            var n:int = textLines.length;
-            for (var i:int = 0; i < n; i++)
-            {
-                if (designLayer)
-                    textLines[i].visible = visible && designLayer.effectiveVisibility;
-                else
-                    textLines[i].visible = visible;
-            }
-        }

         // Figure out if a compose is needed or maybe just clip what is already
         // composed.
@@ -840,10 +764,6 @@
 			var textLine:DisplayObject = textLines[i];

             //trace(container.name, "addTextLines", textLine.x, textLine.y, drawX, drawY);
-
-            textLine.x = textLinesX[i];
-            textLine.y = textLinesY[i];
-            textLine.visible = visible;

 			addChildAtMethod(textLine, index);
 		}
@@ -876,11 +796,6 @@
 			var textLine:DisplayObject = textLines[i];

             removeChildMethod(textLine);
-
-            // Reset x and y to be relative to (0, 0).
-            textLine.x = textLinesX[i];
-            textLine.y = textLinesY[i];
-			textLine.visible = true;
 		}
 	}

@@ -906,8 +821,6 @@
         }

         textLinesVector.length = 0;
-        textLinesX.length = 0;
-        textLinesY.length = 0;
    }

     /**