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

--- frameworks/projects/mx/src/mx/accessibility/TreeAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/TreeAccImpl.as
@@ -1,434 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2003-2006 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.accessibility
-{
-
-import flash.accessibility.Accessibility;
-import flash.events.Event;
-
-import mx.accessibility.AccConst;
-import mx.collections.CursorBookmark;
-import mx.collections.ICollectionView;
-import mx.collections.IViewCursor;
-import mx.controls.Tree;
-import mx.controls.listClasses.IListItemRenderer;
-import mx.controls.treeClasses.HierarchicalCollectionView;
-import mx.core.UIComponent;
-import mx.core.mx_internal;
-import mx.events.TreeEvent;
-
-use namespace mx_internal;
-
-/**
- *  TreeAccImpl is a subclass of AccessibilityImplementation
- *  which implements accessibility for the Tree class.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-public class TreeAccImpl extends AccImpl
-{
-    include "../core/Version.as";
-
-	//--------------------------------------------------------------------------
-	//
-	//  Class methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Enables accessibility in the Tree class.
-	 *
-	 *
This method is called by application startup code
-	 *  that is autogenerated by the MXML compiler.
-	 *  Afterwards, when instances of Tree are initialized,
-	 *  their accessibilityImplementation property
-	 *  will be set to an instance of this class.

-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 9
-	 *  @playerversion AIR 1.1
-	 *  @productversion Flex 3
-	 */
-	public static function enableAccessibility():void
-	{
-		Tree.createAccessibilityImplementation =
-			createAccessibilityImplementation;
-	}
-
-	/**
-	 *  @private
-	 *  Creates a Tree's AccessibilityImplementation object.
-	 *  This method is called from UIComponent's
-	 *  initializeAccessibility() method.
-	 */
-	mx_internal static function createAccessibilityImplementation(
-								component:UIComponent):void
-	{
-		component.accessibilityImplementation =
-			new TreeAccImpl(component);
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Constructor
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Constructor.
-	 *
-	 *  @param master The UIComponent instance that this AccImpl instance
-	 *  is making accessible.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 9
-	 *  @playerversion AIR 1.1
-	 *  @productversion Flex 3
-	 */
-	public function TreeAccImpl(master:UIComponent)
-	{
-		super(master);
-
-		role = AccConst.ROLE_SYSTEM_OUTLINE;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden properties: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	//----------------------------------
-	//  eventsToHandle
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *	Array of events that we should listen for from the master component.
-	 */
-	override protected function get eventsToHandle():Array
-	{
-		return super.eventsToHandle.concat(
-			[ "change", TreeEvent.ITEM_OPEN, TreeEvent.ITEM_CLOSE ]);
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden methods: AccessibilityImplementation
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Gets the role for the component.
-	 *
-	 *  @param childID children of the component
-	 */
-	override public function get_accRole(childID:uint):uint
-	{
-		return childID == 0 ? role : AccConst.ROLE_SYSTEM_OUTLINEITEM;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the value of the TreeItem/Tree
-	 *  which is spoken out by the screen reader
-	 *  A Tree item reports its depth as its value.
-	 *  The Tree itself reports no value.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Name String
-	 */
-	override public function get_accValue(childID:uint):String
-	{
-		var accValue:String;
-
-		if (childID != 0)
-		{
-			// Assuming childID is always ItemID + 1
-			// because getChildIDArray is not always invoked.
-			var index:int = childID - 1;
-			var item:Object = getItemAt(index);
-			if (!item)
-				return accValue;
-
-			var tree:Tree = Tree(master);
-			var depth:int = tree.getItemDepth(
-				item, index - tree.verticalScrollPosition);
-			accValue = String(depth - 1);
-		}
-
-		return accValue;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the state of the TreeItem.
-	 *  States are predefined for all the components in MSAA.
-	 *  Values are assigned to each state.
-	 *  Depending upon the treeItem being Selected, Selectable,
-	 *  Invisible, Offscreen, a value is returned.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return State uint
-	 */
-	override public function get_accState(childID:uint):uint
-	{
-		var accState:uint = getState(childID);
-
-		if (childID > 0)
-		{
-			var tree:Tree = Tree(master);
-
-			var index:int = childID - 1;
-
-			// For returning states (OffScreen and Invisible)
-			// when the list Item is not in the displayed rows.
-			if (index < tree.verticalScrollPosition ||
-				index >= tree.verticalScrollPosition + tree.rowCount)
-			{
-				accState |= AccConst.STATE_SYSTEM_INVISIBLE;
-			}
-			else
-			{
-				accState |= AccConst.STATE_SYSTEM_SELECTABLE;
-
-				var item:Object = getItemAt(index);
-
-				if (item && tree.dataDescriptor.isBranch(item, tree.dataProvider))
-				{
-					if (tree.isItemOpen(item))
-						accState |= AccConst.STATE_SYSTEM_EXPANDED;
-					else
-						accState |= AccConst.STATE_SYSTEM_COLLAPSED;
-				}
-
-				var renderer:IListItemRenderer =
-					tree.itemToItemRenderer(item);
-
-				if (renderer != null && tree.isItemSelected(renderer.data))
-					accState |= AccConst.STATE_SYSTEM_SELECTED | AccConst.STATE_SYSTEM_FOCUSED;
-			}
-		}
-		return accState;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the Default Action.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return name of default action.
-	 */
-	override public function get_accDefaultAction(childID:uint):String
-	{
-		if (childID == 0)
-			return null;
-
-		var tree:Tree = Tree(master);
-
-		var item:Object = getItemAt(childID - 1);
-		if (!item)
-			return null;
-
-		if (tree.dataDescriptor.isBranch(item, tree.dataProvider))
-			return tree.isItemOpen(item) ? "Collapse" : "Expand";
-
-		return null;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for executing the Default Action.
-	 *
-	 *  @param childID uint
-	 */
-	override public function accDoDefaultAction(childID:uint):void
-	{
-		var tree:Tree = Tree(master);
-
-		if (childID == 0 || !tree.enabled)
-			return;
-
-		var item:Object = getItemAt(childID - 1);
-		if (!item)
-			return;
-
-		if (tree.dataDescriptor.isBranch(item, tree.dataProvider))
-			tree.expandItem(item, !tree.isItemOpen(item));
-	}
-
- 	/**
-	 *  @private
-	 *  Method to return an array of childIDs.
-	 *
-	 *  @return Array
-	 */
-	override public function getChildIDArray():Array
-	{
-		var n:int = Tree(master).dataProvider ?
-					Tree(master).collectionLength :
-					0;
-
-		return createChildIDArray(n);
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the bounding box of the TreeItem.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Location Object
-	 */
-	override public function accLocation(childID:uint):*
-	{
-		var tree:Tree = Tree(master);
-
-		var index:int = childID - 1;
-
-		if (index < tree.verticalScrollPosition ||
-			index >= tree.verticalScrollPosition + tree.rowCount)
-		{
-			return null;
-		}
-
-		return tree.itemToItemRenderer(getItemAt(index));
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the childFocus of the List.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return focused childID.
-	 */
-	override public function get_accFocus():uint
-	{
-		var index:int = Tree(master).selectedIndex;
-
-		return index >= 0 ? index + 1 : 0;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden methods: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  method for returning the name of the TreeItem/Tree
-	 *  which is spoken out by the screen reader
-	 *  The TreeItem should return the label as the name
-	 *  with m of n string with level info and
-	 *  Tree should return the name specified in the Accessibility Panel.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Name String
-	 */
-	override protected function getName(childID:uint):String
-	{
-		if (childID == 0)
-			return "";
-
-		var tree:Tree = Tree(master);
-
-		var item:Object = getItemAt(childID - 1);
-
-		var name:String = "";
-
-		if (!item)
-			return name;
-
-		if (tree.itemToLabel(item))
-			name = tree.itemToLabel(item);
-
-		return name;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private function getItemAt(index:int):Object
-	{
-		var iterator:IViewCursor = Tree(master).collectionIterator;
-		iterator.seek(CursorBookmark.FIRST, index);
-		return iterator.current;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden event handlers: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Override the generic event handler.
-	 *  All AccImpl must implement this
-	 *  to listen for events from its master component.
-	 */
-	override protected function eventHandler(event:Event):void
-	{
-		// Let AccImpl class handle the events
-		// that all accessible UIComponents understand.
-		$eventHandler(event);
-
-		var index:int = Tree(master).selectedIndex;
-
-		var childID:uint = index + 1;
-
-		switch (event.type)
-		{
-			case "change":
-			{
-				if (index >= 0)
-				{
-					Accessibility.sendEvent(master, childID,
-											AccConst.EVENT_OBJECT_FOCUS);
-
-					Accessibility.sendEvent(master, childID,
-											AccConst.EVENT_OBJECT_SELECTION);
-				}
-				break;
-			}
-
-			case TreeEvent.ITEM_OPEN:
-			case TreeEvent.ITEM_CLOSE:
-			{
-				if (index >= 0)
-				{
-					Accessibility.sendEvent(master, childID,
-											AccConst.EVENT_OBJECT_STATECHANGE);
-				}
-				break;
-			}
-		}
-	}
-}
-
-}


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 17070
Author:   cframpto@adobe.com
Date:     2010-07-27T15:16:53.362377Z

Log Message:
-----------
selectIndices(startRowIndex, endRowIndex) -> selectIndices(rowIndex, rowCount)
ensureIndexIsVisible -> ensureCellIsVisible

clean up layout.dataProviderCollectionReset to eliminate RTE on sort

dispatch the changing/change events for ctrl-a that I recently added

many small bug fixes and a few ASdoc corrections which are evident from the diffs

QE notes: API changes again
Doc notes:
Bugs: SDK-27116, SDK-27117, SDK-27111, SDK-27112, SDK-26926, SDK-26951
Reviewer: Hans
Tests run: none
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -317,7 +317,7 @@
     [Bindable("valueCommit")]

     /**
-     *  @copy spark.components.Grid#selectedItems
+     *  @copy spark.components.Grid#selectionLength
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -466,17 +466,17 @@
      *  @playerversion AIR 2.0
      *  @productversion Flex 4.5
      */
-    public function selectIndices(startRowIndex:int, endRowIndex:int):Boolean
-    {
-        var selectionChanged:Boolean;
-
-        if (grid)
-        {
-            selectionChanged = grid.selectIndices(startRowIndex, endRowIndex);
-        }
-        else
-        {
-            selectionChanged = gridSelection.setRows(startRowIndex, endRowIndex);
+    public function selectIndices(rowIndex:int, rowCount:int):Boolean
+    {
+        var selectionChanged:Boolean;
+
+        if (grid)
+        {
+            selectionChanged = grid.selectIndices(rowIndex, rowCount);
+        }
+        else
+        {
+            selectionChanged = gridSelection.setRows(rowIndex, rowCount);
             if (selectionChanged)
             {
                 invalidateDisplayList()


Transferred from the Adobe Open Source Subversion Repository

Revision: 19266
Author:   hmuller@adobe.com
Date:     2010-12-10T17:32:59.920871Z

Log Message:
-----------
Added support for the liveDragging style to ScrollerBase in the same way it was added in SliderBase. In addition to the new style, this adds a protected pendingValue property to ScrollerBase.

Added a Scroller liveScrolling style that sets the liveDragging style on the Scroller's scrollbars.

QE notes: This is a new Scroller feature to be tested.
Doc notes:
Bugs: SDK-28039
Reviewer: Carol
Tests run: checkin
Is noteworthy for integration: yes

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

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -4262,7 +4262,7 @@
         const maxWidth:Number = resizeColumn.maxWidth;
         var newWidth:Number = Math.ceil(resizeColumnWidth + widthDelta);

-        // Layout is LTR (see sparator_mouseDownHandler). Make sure that the
+        // Layout is RTL (see sparator_mouseDownHandler). Make sure that the
         // next column's width can shrink as much as the resizeColumn is growing,
         // or vice versa.


Transferred from the Adobe Open Source Subversion Repository

Revision: 15817
Author:   jszeto@adobe.com
Date:     2010-04-29T17:59:39.385730Z

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

Applied PARB changes.
Added validation support prototype
Replaced helpText with helpContent
Added FormSkin, FormHeading and FormHeadingSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FocusSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/StackedFormItemSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/Form.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormHeadingSkin.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/FormSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/FormItem.as
+++ frameworks/projects/spark/src/spark/components/FormItem.as
@@ -13,9 +13,15 @@

     import mx.containers.Canvas;
     import mx.containers.utilityClasses.ConstraintColumn;
+    import mx.core.IDeferredInstance;
     import mx.core.IVisualElement;
+    import mx.core.UIComponent;
+    import mx.events.FlexEvent;
     import mx.resources.IResourceManager;
     import mx.resources.ResourceManager;
+
+    import spark.components.supportClasses.TextBase;
+    import spark.events.ElementExistenceEvent;

     /**
      *  TODO
@@ -31,7 +37,11 @@

     /**
-     *  FormItem represents an item in a Form. It typically has a label, an optional indicator and a set of input components.
+     *  SkinnableContainer with content and multiple properties. The FormItem's children
+     *  are the content and are placed in the contentGroup skin part. The FormItem
+     *  container defines a number of skin parts, including labelDisplay,
+     *  sequenceLabelDisplay, and helpContentGroup. The content of these skin parts are
+     *  specified in order by the label, sequenceLabel and helpContent properties.
      */
     public class FormItem extends SkinnableContainer implements IFormItem
     {
@@ -39,6 +49,8 @@
         public function FormItem()
         {
             super();
+            addEventListener(spark.events.ElementExistenceEvent.ELEMENT_ADD, elementAddHandler);
+            addEventListener(spark.events.ElementExistenceEvent.ELEMENT_REMOVE, elementRemoveHandler);
         }

         //--------------------------------------------------------------------------
@@ -52,28 +64,23 @@
          */
         [Bindable] // compatability with Halo FormItem itemLabel property
         [SkinPart(required="false")]
-        public var labelElement:Label;
-
-        /**
-         *  A reference to the visual element that indicates that this FormItem's value is required.
-         *
-         *
Typically the skin only includes the required indicator in the layout for states
-         *  "required" and "disabledAndRequired".

+        public var labelDisplay:TextBase;
+
+        /**
+         *  A reference to the visual element that displays the FormItem's sequenceLabel.
          */
         [SkinPart(required="false")]
-        public var indicatorElement:IVisualElement;
-
-        /**
-         *  A reference to the visual element that displays the FormItem's numberLabel.
-         */
+        public var sequenceLabelDisplay:TextBase;
+
+
         [SkinPart(required="false")]
-        public var numberLabelElement:Label;
-
-        /**
-         *  A reference to the visual element that display the FormItem's helpText.
+        public var helpContentGroup:Group;
+
+        /**
+         *  A reference to the visual element that display the FormItem's error strings.
          */
         [SkinPart(required="false")]
-        public var helpTextElement:RichText;
+        public var errorTextDisplay:TextBase;

         // TODO Remove once we have a proper FormItemLayout
         [SkinPart(required="false")]
@@ -85,6 +92,15 @@
         //
         //--------------------------------------------------------------------------

+        /**
+         *  Each vector item contains the error string from a content element.
+         *  If none of the content elements are invalid, then the vector will
+         *  be empty.
+         */
+
+        [Bindable(event="elementErrorStringsChanged")]
+        public var elementErrorStrings:Vector.<String> = new Vector.<String>;
+
         //----------------------------------
         //  resourceManager
         //----------------------------------
@@ -111,8 +127,6 @@
         public function set measuredColumnWidths(value:Vector.<Number>):void
         {
             _measuredColumnWidths = value;
-            /*measuredColumnWidthsChanged = true;
-            invalidateProperties();*/
         }

         public function get measuredColumnWidths():Vector.<Number>
@@ -129,7 +143,6 @@
             }

             return measuredCols;
-            //return _measuredColumnWidths;
         }

@@ -156,6 +169,21 @@
             return _layoutColumnWidths;
         }

+
+        private var _helpContentFactory:IDeferredInstance;
+        private var helpContentFactoryChanged:Boolean = false;
+
+        public function set helpContent(value:IDeferredInstance):void
+        {
+            _helpContentFactory = value;
+            helpContentFactoryChanged = true;
+            invalidateProperties();
+        }
+
+        public function get helpContent():IDeferredInstance
+        {
+            return _helpContentFactory;
+        }

         //----------------------------------
         //  helpText
@@ -225,13 +253,13 @@
         }

         //----------------------------------
-        //  numberLabel
-        //----------------------------------
-
-        private var _numberLabel:String = "";
-        private var numberLabelChanged:Boolean = false;
-
-        [Bindable("numberLabelChanged")]
+        //  sequenceLabel
+        //----------------------------------
+
+        private var _sequenceLabel:String = "";
+        private var sequenceLabelChanged:Boolean = false;
+
+        [Bindable("sequenceLabelChanged")]
         [Inspectable(category="General", defaultValue="")]

         /**
@@ -240,21 +268,21 @@
          *
          *  @default ""
          */
-        public function get numberLabel():String
-        {
-            return _numberLabel;
-        }
-
-        /**
-         *  @private
-         */
-        public function set numberLabel(value:String):void
-        {
-            if (_numberLabel == value)
-                return;
-
-            _numberLabel = value;
-            numberLabelChanged = true;
+        public function get sequenceLabel():String
+        {
+            return _sequenceLabel;
+        }
+
+        /**
+         *  @private
+         */
+        public function set sequenceLabel(value:String):void
+        {
+            if (_sequenceLabel == value)
+                return;
+
+            _sequenceLabel = value;
+            sequenceLabelChanged = true;
             invalidateProperties();
         }

@@ -313,7 +341,7 @@
          */
         override public function get baselinePosition():Number
         {
-            return getBaselinePositionForPart(labelElement);
+            return getBaselinePositionForPart(labelDisplay);
         }

         //--------------------------------------------------------------------------
@@ -332,25 +360,17 @@
             if (labelChanged)
             {
                 labelChanged = false;
-                if (labelElement)
-                    labelElement.text = label;
+                if (labelDisplay)
+                    labelDisplay.text = label;
                 dispatchEvent(new Event("labelChanged"));
             }

-            if (numberLabelChanged)
-            {
-                numberLabelChanged = false;
-                if (numberLabelElement)
-                    numberLabelElement.text = numberLabel;
-                dispatchEvent(new Event("numberLabelChanged"));
-            }
-
-            if (helpTextChanged)
-            {
-                helpTextChanged = false;
-                if (helpTextElement)
-                    helpTextElement.text = helpText;
-                dispatchEvent(new Event("helpTextChanged"));
+            if (sequenceLabelChanged)
+            {
+                sequenceLabelChanged = false;
+                if (sequenceLabelDisplay)
+                    sequenceLabelDisplay.text = sequenceLabel;
+                dispatchEvent(new Event("sequenceLabelChanged"));
             }

             if (layoutColumnWidthsChanged)
@@ -359,6 +379,8 @@
                 if (canvasLayout)
                     applyConstraintColumns(_layoutColumnWidths);
             }
+
+            createHelpContent();
         }

         /**
@@ -366,10 +388,13 @@
          */
         override protected function getCurrentSkinState():String
         {
+            if (elementErrorStrings.length > 0)
+                return "error";
             if(required && (enabled == false))
                 return "requiredAndDisabled";
             if (required)
                 return "required";
+
             return "normal";
         }

@@ -380,14 +405,16 @@
         {
             super.partAdded(partName, instance);

-            if (instance == labelElement)
-                labelElement.text = label;
-            else if (instance == numberLabelElement)
-                numberLabelElement.text = numberLabel;
-            else if (instance == helpTextElement)
-                helpTextElement.text = helpText;
+            if (instance == labelDisplay)
+                labelDisplay.text = label;
+            else if (instance == sequenceLabelDisplay)
+                sequenceLabelDisplay.text = sequenceLabel;
             else if (instance == canvasLayout)
                 applyConstraintColumns(_layoutColumnWidths);
+            else if (instance == errorTextDisplay)
+                applyErrorText();
+            else if (instance == helpContentGroup)
+                createHelpContent();
         }

         /**
@@ -432,6 +459,114 @@
             }
         }

+        public function elementAddHandler(event:ElementExistenceEvent):void
+        {
+            var uicElt:UIComponent = event.element as UIComponent;
+
+            if (uicElt)
+            {
+                uicElt.addEventListener(FlexEvent.VALID, element_validHandler);
+                uicElt.addEventListener(FlexEvent.INVALID, element_invalidHandler);
+                uicElt.showErrorSkin = true;
+                uicElt.showErrorTip = false;
+            }
+        }
+
+        public function elementRemoveHandler(event:ElementExistenceEvent):void
+        {
+            var uicElt:UIComponent = event.element as UIComponent;
+
+            if (uicElt)
+            {
+                uicElt.removeEventListener(FlexEvent.VALID, element_validHandler);
+                uicElt.removeEventListener(FlexEvent.INVALID, element_invalidHandler);
+                uicElt.showErrorSkin = true;
+                uicElt.showErrorTip = true;
+            }
+        }
+
+        protected function element_validHandler(event:FlexEvent):void
+        {
+            // update error string
+            updateErrorString();
+        }
+
+        protected function element_invalidHandler(event:FlexEvent):void
+        {
+            // update error string
+            updateErrorString();
+        }
+
+        private function updateErrorString():void
+        {
+            var uicElt:UIComponent;
+            elementErrorStrings = new Vector.<String>;
+
+            for (var i:int = 0; i < numElements; i++)
+            {
+                uicElt = getElementAt(i) as UIComponent;
+
+                if (uicElt)
+                {
+                    if (uicElt.errorString != "")
+                    {
+                        elementErrorStrings.push(uicElt.errorString);
+                    }
+                }
+            }
+
+            invalidateSkinState();
+
+            applyErrorText();
+            dispatchEvent(new Event("elementErrorStringsChanged"));
+        }
+
+        private function applyErrorText():void
+        {
+            if (!errorTextDisplay)
+                return;
+
+            var msg:String = "";
+            for (var i:int=0; i < elementErrorStrings.length; i++)
+            {
+                if (msg != "")
+                    msg += "\n";
+                msg += elementErrorStrings[i];
+            }
+
+            errorTextDisplay.text = msg;
+
+        }
+
+        private function createHelpContent():void
+        {
+            if (_helpContentFactory && helpContentGroup && helpContentFactoryChanged)
+            {
+                helpContentFactoryChanged = false;
+
+                var content:Object = _helpContentFactory.getInstance();
+
+                if (!(content is Array))
+                {
+                    content = [content];
+                }
+
+                helpContentGroup.mxmlContent = content as Array;
+
+            }
+            /*if (!mxmlContentCreated)
+            {
+                mxmlContentCreated = true;
+
+                if (_mxmlContentFactory)
+                {
+                    var deferredContent:Object = _mxmlContentFactory.getInstance();
+                    mxmlContent = deferredContent as Array;
+                    _deferredContentCreated = true;
+                    dispatchEvent(new FlexEvent(FlexEvent.CONTENT_CREATION_COMPLETE));
+                }
+            }*/
+        }

     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19845
Author:   eday@adobe.com
Date:     2011-01-20T21:50:41.599873Z

Log Message:
-----------
Scroller fixes: resolved Marshall Plan sandbox failure and memory leak.

QE notes:
Doc notes:
Bugs: SDK-29171, SDK-29182
Reviewer: Alex
Tests run: checkintests
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -861,7 +861,6 @@
             viewport.clipAndEnableScrolling = true;
             Group(skin).addElementAt(viewport, 0);
             viewport.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
-            systemManager.stage.addEventListener("orientationChange",orientationChangeHandler);
         }
         if (verticalScrollBar)
             verticalScrollBar.viewport = viewport;
@@ -880,7 +879,6 @@
             viewport.clipAndEnableScrolling = false;
             Group(skin).removeElement(viewport);
             viewport.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
-            systemManager.stage.removeEventListener("orientationChange",orientationChangeHandler);
         }
     }

@@ -1397,7 +1395,7 @@
     //  Touch scrolling methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      *  Add touch listeners
@@ -2178,7 +2176,7 @@

         touchScrollHelper.startScrollWatch(event);
     }
-
+
     /**
      *  @private
      */
@@ -2186,7 +2184,7 @@
     {
         var xMove:int = 0;
         var yMove:int = 0;
-
+
         if (scrollerLayout && scrollerLayout.canScrollHorizontally)
             xMove = dragX;

@@ -2222,7 +2220,7 @@
         // clamp the values here
         newHSP = Math.min(Math.max(newHSP, -viewportWidth), maxWidth+viewportWidth);
         newVSP = Math.min(Math.max(newVSP, -viewportHeight), maxHeight+viewportHeight);
-
+
         viewport.horizontalScrollPosition = newHSP;
         viewport.verticalScrollPosition = newVSP;
     }
@@ -2291,141 +2289,141 @@
         // scrollbars in overlay mode
         skin.invalidateDisplayList();
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Text selection auto scroll
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  When true, use the text selection scroll behavior instead of the
-     *  typical "throw" behavior. This is only used when interactionMode="touch"
-     */
-    mx_internal var textSelectionAutoScrollEnabled:Boolean = false;
-    private var textSelectionAutoScrollTimer:Timer;
-    private var minTextSelectionVScrollPos:int = 0;
-    private var maxTextSelectionVScrollPos:int = -1;
-    private var minTextSelectionHScrollPos:int = 0;
-    private var maxTextSelectionHScrollPos:int = -1;
-    private static const TEXT_SELECTION_AUTO_SCROLL_FPS:int = 10;
-
-    /**
-     *  @private
-     *  Change scroll behavior when selecting text.
-     */
-    mx_internal function enableTextSelectionAutoScroll(enable:Boolean,
-                       minHScrollPosition:int = 0, maxHScrollPosition:int = -1,
-                       minVScrollPosition:int = 0, maxVScrollPosition:int = -1):void
-    {
-        if (getStyle("interactionMode") == InteractionMode.TOUCH)
-        {
-            this.textSelectionAutoScrollEnabled = enable;
-            this.minTextSelectionHScrollPos = minHScrollPosition;
-            this.maxTextSelectionHScrollPos = maxHScrollPosition;
-            this.minTextSelectionVScrollPos = minVScrollPosition;
-            this.maxTextSelectionVScrollPos = maxVScrollPosition;
-        }
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal function setUpTextSelectionAutoScroll():void
-    {
-        if (!textSelectionAutoScrollTimer)
-        {
-            textSelectionAutoScrollTimer = new Timer(1000 / TEXT_SELECTION_AUTO_SCROLL_FPS);
-            textSelectionAutoScrollTimer.addEventListener(TimerEvent.TIMER,
-                textSelectionAutoScrollTimerHandler);
-
-            textSelectionAutoScrollTimer.start();
-        }
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal function stopTextSelectionAutoScroll():void
-    {
-        if (textSelectionAutoScrollTimer)
-        {
-            textSelectionAutoScrollTimer.stop();
-            textSelectionAutoScrollTimer.removeEventListener(TimerEvent.TIMER,
-                textSelectionAutoScrollTimerHandler);
-            textSelectionAutoScrollTimer = null;
-        }
-    }
-
-    /**
-     *  @private
-     */
-    private function textSelectionAutoScrollTimerHandler(event:TimerEvent):void
-    {
-        const SLOW_SCROLL_THRESHOLD:int = 12;       // Distance from edge to trigger a slow scroll
-        const SLOW_SCROLL_SPEED:int = 20;           // Pixels per timer callback to scroll
-        const FAST_SCROLL_THRESHOLD:int = 3;        // Distance from edge to trigger a fast scroll
-        const FAST_SCROLL_DELTA:int = 30;           // Added to SLOW_SCROLL_SPEED to determine fast speed
-
-        var newVSP:Number = viewport.verticalScrollPosition;
-        var newHSP:Number = viewport.horizontalScrollPosition;
-
-        if (scrollerLayout.canScrollHorizontally)
-        {
-            if (mouseX > width - SLOW_SCROLL_THRESHOLD)
-            {
-                newHSP += SLOW_SCROLL_SPEED;
-
-                if (mouseX > width - FAST_SCROLL_THRESHOLD)
-                    newHSP += FAST_SCROLL_DELTA;
-
-                if (maxTextSelectionHScrollPos != -1 && newHSP > maxTextSelectionHScrollPos)
-                    newHSP = maxTextSelectionHScrollPos;
-            }
-
-            if (mouseX < SLOW_SCROLL_THRESHOLD)
-            {
-                newHSP -= SLOW_SCROLL_SPEED;
-
-                if (mouseX < FAST_SCROLL_THRESHOLD)
-                    newHSP -= FAST_SCROLL_DELTA;
-
-                if (newHSP < minTextSelectionHScrollPos)
-                    newHSP = minTextSelectionHScrollPos;
-            }
-        }
-
-        if (scrollerLayout.canScrollVertically)
-        {
-            if (mouseY > height - SLOW_SCROLL_THRESHOLD)
-            {
-                newVSP += SLOW_SCROLL_SPEED;
-
-                if (mouseY > height - FAST_SCROLL_THRESHOLD)
-                    newVSP += FAST_SCROLL_DELTA;
-
-                if (maxTextSelectionVScrollPos != -1 && newVSP > maxTextSelectionVScrollPos)
-                    newVSP = maxTextSelectionVScrollPos;
-            }
-
-            if (mouseY < SLOW_SCROLL_THRESHOLD)
-            {
-                newVSP -= SLOW_SCROLL_SPEED;
-
-                if (mouseY < FAST_SCROLL_THRESHOLD)
-                    newVSP -= FAST_SCROLL_DELTA;
-
-                if (newVSP < minTextSelectionVScrollPos)
-                    newVSP = minTextSelectionVScrollPos;
-            }
-        }
-
-        if (newHSP != viewport.horizontalScrollPosition)
-            viewport.horizontalScrollPosition = newHSP;
-        if (newVSP != viewport.verticalScrollPosition)
-            viewport.verticalScrollPosition = newVSP;
-    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Text selection auto scroll
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  When true, use the text selection scroll behavior instead of the
+	 *  typical "throw" behavior. This is only used when interactionMode="touch"
+	 */
+	mx_internal var textSelectionAutoScrollEnabled:Boolean = false;
+	private var textSelectionAutoScrollTimer:Timer;
+	private var minTextSelectionVScrollPos:int = 0;
+	private var maxTextSelectionVScrollPos:int = -1;
+	private var minTextSelectionHScrollPos:int = 0;
+	private var maxTextSelectionHScrollPos:int = -1;
+	private static const TEXT_SELECTION_AUTO_SCROLL_FPS:int = 10;
+
+	/**
+	 *  @private
+	 *  Change scroll behavior when selecting text.
+	 */
+	mx_internal function enableTextSelectionAutoScroll(enable:Boolean,
+					   minHScrollPosition:int = 0, maxHScrollPosition:int = -1,
+					   minVScrollPosition:int = 0, maxVScrollPosition:int = -1):void
+	{
+		if (getStyle("interactionMode") == InteractionMode.TOUCH)
+		{
+			this.textSelectionAutoScrollEnabled = enable;
+			this.minTextSelectionHScrollPos = minHScrollPosition;
+			this.maxTextSelectionHScrollPos = maxHScrollPosition;
+			this.minTextSelectionVScrollPos = minVScrollPosition;
+			this.maxTextSelectionVScrollPos = maxVScrollPosition;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function setUpTextSelectionAutoScroll():void
+	{
+		if (!textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer = new Timer(1000 / TEXT_SELECTION_AUTO_SCROLL_FPS);
+			textSelectionAutoScrollTimer.addEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+
+			textSelectionAutoScrollTimer.start();
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function stopTextSelectionAutoScroll():void
+	{
+		if (textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer.stop();
+			textSelectionAutoScrollTimer.removeEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+			textSelectionAutoScrollTimer = null;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	private function textSelectionAutoScrollTimerHandler(event:TimerEvent):void
+	{
+		const SLOW_SCROLL_THRESHOLD:int = 12;		// Distance from edge to trigger a slow scroll
+		const SLOW_SCROLL_SPEED:int = 20;			// Pixels per timer callback to scroll
+		const FAST_SCROLL_THRESHOLD:int = 3;		// Distance from edge to trigger a fast scroll
+		const FAST_SCROLL_DELTA:int = 30; 			// Added to SLOW_SCROLL_SPEED to determine fast speed
+
+		var newVSP:Number = viewport.verticalScrollPosition;
+		var newHSP:Number = viewport.horizontalScrollPosition;
+
+		if (scrollerLayout.canScrollHorizontally)
+		{
+			if (mouseX > width - SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP += SLOW_SCROLL_SPEED;
+
+				if (mouseX > width - FAST_SCROLL_THRESHOLD)
+					newHSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionHScrollPos != -1 && newHSP > maxTextSelectionHScrollPos)
+					newHSP = maxTextSelectionHScrollPos;
+			}
+
+			if (mouseX < SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseX < FAST_SCROLL_THRESHOLD)
+					newHSP -= FAST_SCROLL_DELTA;
+
+				if (newHSP < minTextSelectionHScrollPos)
+					newHSP = minTextSelectionHScrollPos;
+    		}
+		}
+
+		if (scrollerLayout.canScrollVertically)
+		{
+			if (mouseY > height - SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP += SLOW_SCROLL_SPEED;
+
+				if (mouseY > height - FAST_SCROLL_THRESHOLD)
+					newVSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionVScrollPos != -1 && newVSP > maxTextSelectionVScrollPos)
+					newVSP = maxTextSelectionVScrollPos;
+			}
+
+			if (mouseY < SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseY < FAST_SCROLL_THRESHOLD)
+					newVSP -= FAST_SCROLL_DELTA;
+
+				if (newVSP < minTextSelectionVScrollPos)
+					newVSP = minTextSelectionVScrollPos;
+			}
+		}
+
+		if (newHSP != viewport.horizontalScrollPosition)
+			viewport.horizontalScrollPosition = newHSP;
+		if (newVSP != viewport.verticalScrollPosition)
+			viewport.verticalScrollPosition = newVSP;
+	}

     //--------------------------------------------------------------------------
     //
@@ -2454,6 +2452,9 @@

             softKeyboardEventHandlersAdded = true;
         }
+
+        if (getStyle("interactionMode") == InteractionMode.TOUCH)
+            systemManager.stage.addEventListener("orientationChange",orientationChangeHandler);
     }

     /**
@@ -2470,6 +2471,9 @@

             softKeyboardEventHandlersAdded = false;
         }
+
+        if (getStyle("interactionMode") == InteractionMode.TOUCH)
+            systemManager.stage.removeEventListener("orientationChange",orientationChangeHandler);
     }

     /**
@@ -2911,7 +2915,7 @@
                 var scrollStartEvent:TouchInteractionEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_START, true, true);
                 scrollStartEvent.relatedObject = scroller;
                 scrollStartEvent.reason = TouchInteractionReason.SCROLL;
-                dispatchBubblingEventOnMouseDownedDisplayObject(scrollStartEvent);
+				dispatchBubblingEventOnMouseDownedDisplayObject(scrollStartEvent);

                 isScrolling = true;

@@ -2968,11 +2972,11 @@
         // if we are scrolling (even if we just started scrolling)
         if (isScrolling)
         {
-            if (scroller.textSelectionAutoScrollEnabled)
-            {
-                scroller.setUpTextSelectionAutoScroll();
-                return;
-            }
+			if (scroller.textSelectionAutoScrollEnabled)
+			{
+				scroller.setUpTextSelectionAutoScroll();
+				return;
+			}

             // calculate the delta
             var dx:Number = event.stageX - scrollGestureAnchorPoint.x;
@@ -3058,14 +3062,14 @@
         if (!isScrolling)
             return;

-        // Don't throw if we're doing a text selection auto scroll
-        if (scroller.textSelectionAutoScrollEnabled)
-        {
-            scroller.stopTextSelectionAutoScroll();
-            endTouchScroll();
-            return;
-        }
-
+		// Don't throw if we're doing a text selection auto scroll
+		if (scroller.textSelectionAutoScrollEnabled)
+		{
+			scroller.stopTextSelectionAutoScroll();
+			endTouchScroll();
+			return;
+		}
+
         if (dragTimer)
         {
             if (dragScrollPending)
@@ -3123,13 +3127,13 @@
         }
         averageDt /= len-1;

-        // if off screen for some reason, let's end scrolling:
-        if (!scroller.stage)
-        {
+		// if off screen for some reason, let's end scrolling:
+		if (!scroller.stage)
+		{
             endTouchScroll();
-            return;
-        }
-
+			return;
+		}
+
         var lastMouseEventPoint:Point = mouseEventCoordinatesHistory[endIndex];

         // calculate the last velocity and make sure there was no pause that occurred
@@ -3225,40 +3229,40 @@

         return new Point(velX,velY);
     }
-
-    /**
-     *  @private
-     *  Helper method to dispatch bubbling events on mouseDownDisplayObject.  Since this
-     *  object can be off the display list, this may be tricky.  Technically, we should
-     *  grab all the live objects at the time of mouseDown and dispatch events to them
-     *  manually, but instead, we just use this heuristic, which is dispatch it to
-     *  mouseDownedDisplayObject.  If it's not inside of scroller and off the display list,
-     *  then dispatch to scroller as well.
-     *
-     *
If you absolutely need to know the touch event ended, add event listeners
-     *  to the mouseDownedDisplayObject directly and don't rely on event
-     *  bubbling.

-     */
-    private function dispatchBubblingEventOnMouseDownedDisplayObject(event:Event):Boolean
-    {
-        var eventAccepted:Boolean = true;
-        if (mouseDownedDisplayObject)
-        {
-            eventAccepted = eventAccepted && mouseDownedDisplayObject.dispatchEvent(event);
-            if (!mouseDownedDisplayObject.stage)
-            {
-                if (scroller && !scroller.contains(mouseDownedDisplayObject))
-                    eventAccepted = eventAccepted && scroller.dispatchEvent(event);
-            }
-        }
-        else
-        {
-            eventAccepted = eventAccepted && scroller.dispatchEvent(event);
-        }
-
-        return eventAccepted;
-    }
-
+
+	/**
+	 *  @private
+	 *  Helper method to dispatch bubbling events on mouseDownDisplayObject.  Since this
+	 *  object can be off the display list, this may be tricky.  Technically, we should
+	 *  grab all the live objects at the time of mouseDown and dispatch events to them
+	 *  manually, but instead, we just use this heuristic, which is dispatch it to
+	 *  mouseDownedDisplayObject.  If it's not inside of scroller and off the display list,
+	 *  then dispatch to scroller as well.
+	 *
+	 *
If you absolutely need to know the touch event ended, add event listeners
+	 *  to the mouseDownedDisplayObject directly and don't rely on event
+	 *  bubbling.

+	 */
+	private function dispatchBubblingEventOnMouseDownedDisplayObject(event:Event):Boolean
+	{
+		var eventAccepted:Boolean = true;
+		if (mouseDownedDisplayObject)
+		{
+			eventAccepted = eventAccepted && mouseDownedDisplayObject.dispatchEvent(event);
+			if (!mouseDownedDisplayObject.stage)
+			{
+				if (scroller && !scroller.contains(mouseDownedDisplayObject))
+					eventAccepted = eventAccepted && scroller.dispatchEvent(event);
+			}
+		}
+		else
+		{
+			eventAccepted = eventAccepted && scroller.dispatchEvent(event);
+		}
+
+		return eventAccepted;
+	}
+
     /**
      *  @private
      *  When the touchScrollThrow is over, we should dispatch a touchInteractionEnd.


Transferred from the Adobe Open Source Subversion Repository

Revision: 10332
Author:   hmuller@adobe.com
Date:     2009-09-16T23:24:55.421539Z

Log Message:
-----------
Added Scroller.measuredSizeIncludesScrollBars property and changed TextAreaSkin
to set this property to false.

After a dataProvider change DataGroup/commitProperties() now resets the scrollPositions
-after- the new ItemRenderers have been created with initializeDataProviders().

QE Notes: Mustella TextArea, DataGroup, Scroller, and List tests pass.
Doc Notes:
Bugs: sdk-22890, sdk-22469, sdk-23175
Reviewer: Jason

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -492,6 +492,47 @@
         _minViewportInset = value;
         invalidateSkin();
     }
+
+    //----------------------------------
+    //  measuredSizeIncludesScrollBars
+    //----------------------------------
+
+    private var _measuredSizeIncludesScrollBars:Boolean = true;
+
+    /**
+     *  If true, the Scroller's measured size includes the space required for
+     *  the visible scrollbars, otherwise the Scroller's measured size depends
+     *  only on its viewport.
+     *
+     *
Components like TextArea, which "reflow" their contents to fit the
+     *  available width or height may use this property to stabilize their
+     *  measured size.  By default a TextArea's is defined by its widthInChars
+     *  and heightInChars properties and in many applications it's preferable
+     *  for the measured size to remain constant, event when scrollbars are displayed
+     *  by the TextArea skin's Scroller.

+     *
+     *
In components where the content does not reflow, like a typical List's
+     *  items, the default behavior is preferable because it makes it less
+     *  likely that the component's content will not obscured by a scrollbar.

+     *
+     *  @default true
+     */
+    public function get measuredSizeIncludesScrollBars():Boolean
+    {
+        return _measuredSizeIncludesScrollBars;
+    }
+
+    /**
+     *  @private
+     */
+    public function set measuredSizeIncludesScrollBars(value:Boolean):void
+    {
+        if (value == _measuredSizeIncludesScrollBars)
+            return;
+
+        _measuredSizeIncludesScrollBars = value;
+        invalidateSkin();
+    }

     //--------------------------------------------------------------------------
     //


Transferred from the Adobe Open Source Subversion Repository

Revision: 3554
Author:   hmuller@adobe.com
Date:     2008-10-09T23:47:11.193434Z

Log Message:
-----------
Bug fixes: 17258, 17146, 17193

Now correctly handle the
HorizontalLayout::horizontalScrollPositionDelta() special case where
there's just one item the scrollRect, and the item is partially
visible and left justified, and the requested scroll unit is RIGHT.
Likewise for right justified and RIGHT and likewise for
VerticalLayout.

The fix is in findLayoutItemBounds() (defined in both Horizontal
and VerticalLayout), which now deals with this case correctly.
This method's responsibilities have changed as part of a larger
refactoring effort that also supports better step/page behavior
for extremely large items.

QE: No
Doc: No
Checkintests: Pass
Reviewer: Evtim
Bugs:
    SDK-17258 - inView method throws an RTE when passing in invalid indexes
    SDK-17146 - Horizontal Scroller only respond to RIGHT/LEFT buttons
    SDK-17193 - Scroll position delta methods loop when scrolling through items larger than the viewport size

Modified Paths:
--------------
<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/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -138,11 +138,18 @@
             skin.addItemAt(viewport, 0);
             viewport.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
         }
-
+ 	    if (verticalScrollBar)
+            verticalScrollBar.viewport = viewport;
+        if (horizontalScrollBar)
+            horizontalScrollBar.viewport = viewport;
     }

     private function uninstallViewport():void
     {
+        if (horizontalScrollBar)
+            horizontalScrollBar.viewport = null;
+        if (verticalScrollBar)
+            verticalScrollBar.viewport = null;
     	if (skin && viewport)
     	{
     		skin.removeItem(viewport);
@@ -369,11 +376,13 @@

         if (instance == verticalScrollBar)
         {
+            verticalScrollBar.viewport = viewport;
         	verticalScrollBar.addEventListener("valueCommit", vsb_valueCommitHandler);
         }

         if (instance == horizontalScrollBar)
         {
+            horizontalScrollBar.viewport = viewport;
             horizontalScrollBar.addEventListener("valueCommit", hsb_valueCommitHandler);
         }
     }
@@ -387,11 +396,13 @@

         if (instance == verticalScrollBar)
         {
+            verticalScrollBar.viewport = null;
             verticalScrollBar.removeEventListener("valueCommit", vsb_valueCommitHandler);
         }

         if (instance == horizontalScrollBar)
         {
+            horizontalScrollBar.viewport = null;
             horizontalScrollBar.removeEventListener("valueCommit", hsb_valueCommitHandler);
         }
     }
@@ -450,4 +461,4 @@

 }

-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10690
Author:   aharui@adobe.com
Date:     2009-09-29T18:17:36.710451Z

Log Message:
-----------
Viewstack wasn't sending IList notifications when removeChild called

QE Notes: None
Doc Notes: None
Bugs: SDK-23444
Reviewer: Ryan
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/components/ViewStack

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>

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

--- frameworks/projects/mx/src/mx/containers/ViewStack.as
+++ frameworks/projects/mx/src/mx/containers/ViewStack.as
@@ -1428,9 +1428,10 @@
     /**
      *  @private
      */
-    override public function removeChildAt(index:int):DisplayObject
-    {
-        var obj:DisplayObject = super.removeChildAt(index);
+    override public function removeChild(item:DisplayObject):DisplayObject
+    {
+        var index:int = getChildIndex(item);
+        var obj:DisplayObject = super.removeChild(item);
         internalDispatchEvent(CollectionEventKind.REMOVE, obj, index);
         return obj;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10919
Author:   gosmith@adobe.com
Date:     2009-10-07T22:15:33.759089Z

Log Message:
-----------
Integrated TLF Build 517.

This isn't the latest TLF build, but it is the one that introduced a significant API change, so I want to take it before taking other TLF changes. The ITextLineCreator interface, with its createTextLine() and recreateTextLine() methods, has been replaced with an ISWFContext interface with a callInContext() method. This required changes in 11 framework classes and in the MXML compiler's autogenerated code for the module factory classes.

The purpose of both the old and the new interface is to support cross-SWF font embedding, by allowing certain FTE calls such as textBlock.createTextLine() to execute in the SWF where the font you're using is embedded.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Alex should review
Tests run: ant checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/TextFlowLine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IFlexModuleFactory.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/textLayout/textLayout_core/src/flashx/textLayout/compose/IFlowComposer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_edit/src/flashx/textLayout/container/TextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/TextFieldFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/CoreClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/BuildInfo.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/ComposeState.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/ReleaseNotes.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/FlowComposerBase.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/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/StringTextLineFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/SimpleCompose.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/elements/FlowLeafElement.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/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/TextLineFactoryBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/tlf.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/TextFlowTextLineFactory.as</path>

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -39,7 +39,7 @@
 import flash.text.engine.TextElement;
 import flash.text.engine.TextLine;

-import flashx.textLayout.compose.ITextLineCreator;
+import flashx.textLayout.compose.ISWFContext;
 import flashx.textLayout.compose.TextLineRecycler;
 import flashx.textLayout.container.TextContainerManager;
 import flashx.textLayout.conversion.ConversionType;
@@ -1880,6 +1880,58 @@
 	}

 	//----------------------------------
+	//  fontContext
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the fontContext property.
+	 */
+	private var _fontContext:ISWFContext;
+
+	/**
+	 *  The ISWFContext instance that FTETextField
+	 *  uses for creating TextLines.
+	 *
+	 *
Set this if you need lines to be created in a different
+	 *  SWF context than the one containing the TLF code.

+	 *
+	 *
Note: This property does not exist in the classic
+	 *  flash.text.TextField API.

+	 *
+	 *  @default null
+	 *
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @langversion 3.0
+	 */
+	public function get fontContext():ISWFContext
+	{
+		return _fontContext;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set fontContext(value:ISWFContext):void
+	{
+		// FTETextField allows a null value to be set;
+		// in fact, this is the default.
+
+		if (value == _fontContext)
+			return;
+
+		_fontContext = value;
+
+		// The TextLines may need to be recreated
+		// and the border and background may need to be redrawn.
+		setFlag(FLAG_TEXT_LINES_INVALID |
+				FLAG_GRAPHICS_INVALID);
+
+		invalidate();
+	}
+
+	//----------------------------------
 	//  locale
 	//----------------------------------

@@ -1914,58 +1966,6 @@
 		// and must be recreated when needed.
 		elementFormat = null;
 		hostFormat = null;
-
-		// The TextLines may need to be recreated
-		// and the border and background may need to be redrawn.
-		setFlag(FLAG_TEXT_LINES_INVALID |
-				FLAG_GRAPHICS_INVALID);
-
-		invalidate();
-	}
-
-	//----------------------------------
-	//  textLineCreator
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *  Storage for the textLineCreator property.
-	 */
-	private var _textLineCreator:ITextLineCreator;
-
-	/**
-	 *  The ITextLineCreator instance that FTETextField
-	 *  uses for creating TextLines.
-	 *
-	 *
Set this if you need lines to be created in a different
-	 *  SWF context than the one containing the TLF code.

-	 *
-	 *
Note: This property does not exist in the classic
-	 *  flash.text.TextField API.

-	 *
-	 *  @default null
-	 *
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @langversion 3.0
-	 */
-	public function get textLineCreator():ITextLineCreator
-	{
-		return _textLineCreator;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set textLineCreator(value:ITextLineCreator):void
-	{
-		// FTETextField allows a null value to be set;
-		// in fact, this is the default.
-
-		if (value == _textLineCreator)
-			return;
-
-		_textLineCreator = value;

 		// The TextLines may need to be recreated
 		// and the border and background may need to be redrawn.
@@ -2697,10 +2697,11 @@
 			var recycleLine:TextLine = TextLineRecycler.getLineForReuse();
 			if (recycleLine)
 			{
-				if (textLineCreator)
+				if (fontContext)
 				{
-					nextTextLine = textLineCreator.recreateTextLine(
-						textBlock, recycleLine, textLine, maxLineWidth);
+					nextTextLine = fontContext.callInContext(
+						textBlock["recreateTextLine"], textBlock,
+						[ recycleLine, textLine, maxLineWidth ]);
 				}
 				else
 				{
@@ -2710,10 +2711,11 @@
 			}
 			else
 			{
-				if (textLineCreator)
+				if (fontContext)
 				{
-					nextTextLine = textLineCreator.createTextLine(
-						textBlock, textLine, maxLineWidth);
+					nextTextLine = fontContext.callInContext(
+						textBlock.createTextLine, textBlock,
+						[ textLine, maxLineWidth ]);
 				}
 				else
 				{
@@ -2831,7 +2833,7 @@

 		textContainerManager.hostFormat = hostFormat;

-		textContainerManager.textLineCreator = textLineCreator;
+		textContainerManager.swfContext = fontContext;

 		textContainerManager.setTextFlow(textFlow)


Transferred from the Adobe Open Source Subversion Repository

Revision: 7910
Author:   egeorgie@adobe.com
Date:     2009-06-17T01:41:55.138890Z

Log Message:
-----------
P-ARB changes:

* IGraphicElement sharedIndex -> DisplayObjectSharingMode
* ScrollUnit -> NavigationUnit
* LayoutBase.getDestinationIndex -> LayoutBase.getNavigationDestinationIndex, param order reversed!!!!
* mouseOpaque -> mouseEnabledWhereTransparent
* various other small renames and changes to non-public APIs

Doc Notes: None
Bugs: N/A
Reviewer: Deepa
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FlexFXG2SWFTranscoder.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/InvalidatingSprite.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/ScrollUnit.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/NavigationUnit.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/DisplayObjectSharingMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/spark/core/IViewport.as
+++ frameworks/projects/spark/src/spark/core/IViewport.as
@@ -133,8 +133,8 @@
      *  Returns the amount to add to the viewport's current
      *  horizontalScrollPosition to scroll by the requested scrolling unit.
      *
-     *  @param scrollUnit The amount to scroll.
-     *  The value of unit must be one of the following spark.core.ScrollUnit
+     *  @param navigationUnit The amount to scroll.
+     *  The value of unit must be one of the following spark.core.NavigationUnit
      *  constants: LEFT, RIGHT, PAGE_LEFT,
      *  PAGE_RIGHT, HOME, or END.
      *  To scroll by a single column, use LEFT or RIGHT.
@@ -142,21 +142,21 @@
      *
      *  @return The number of pixels to add to horizontalScrollPosition.
      *
-     *  @see ScrollUnit
+     *  @see NavigationUnit
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    function getHorizontalScrollPositionDelta(scrollUnit:uint):Number;
+    function getHorizontalScrollPositionDelta(navigationUnit:uint):Number;

     /**
      *  Returns the amount to add to the viewport's current
      *  verticalScrollPosition to scroll by the requested scrolling unit.
      *
-     *  @param scrollUnit The amount to scroll.
-     *  The value of unit must be one of the following spark.core.ScrollUnit
+     *  @param navigationUnit The amount to scroll.
+     *  The value of unit must be one of the following spark.core.NavigationUnit
      *  constants: UP, DOWN, PAGE_UP,
      *  PAGE_DOWN, HOME, or END.
      *  To scroll by a single row use UP or DOWN.
@@ -164,14 +164,14 @@
      *
      *  @return The number of pixels to add to verticalScrollPosition.
      *
-     *  @see ScrollUnit
+     *  @see NavigationUnit
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    function getVerticalScrollPositionDelta(scrollUnit:uint):Number;
+    function getVerticalScrollPositionDelta(navigationUnit:uint):Number;

     /**
      *  If true, specifies to clip the children to the boundaries of the viewport.


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

--- frameworks/projects/spark/src/spark/core/IViewport.as
+++ frameworks/projects/spark/src/spark/core/IViewport.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 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.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4004
Author:   gosmith@adobe.com
Date:     2008-11-04T00:42:40.939572Z

Log Message:
-----------
Added 'restrict', 'maxChars', and 'displayAsPassword' properties to TextView, FxTextInput, and FxTextArea.

Note: They don't currently work properly when text is pasted rather than typed; this requires some additional support in TLF.

QE Notes: None
Doc Notes: None
Bugs: SDK-16293, SDK-16627
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/StringUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/utils/TextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/utils/TextUtil.as
+++ frameworks/projects/spark/src/spark/utils/TextUtil.as
@@ -16,6 +16,7 @@

 import flashx.textLayout.elements.FlowLeafElement;
 import flashx.textLayout.elements.ParagraphElement;
+import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.formats.ICharacterFormat;
 import flashx.textLayout.formats.IContainerFormat;
@@ -139,6 +140,47 @@

         return text;
     }
+
+    /**
+     *  @private
+     */
+    public static function obscureTextFlow(textFlow:TextFlow,
+                                           obscurationChar:String):void
+    {
+        for (var leaf:FlowLeafElement = textFlow.getFirstLeaf();
+             leaf;
+             leaf = leaf.getNextLeaf())
+        {
+            if (leaf is SpanElement)
+            {
+                var leafText:String = SpanElement(leaf).text;
+                if (leafText)
+                {
+                	SpanElement(leaf).text = StringUtil.repeat(
+                		obscurationChar, leafText.length);
+                }
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    public static function unobscureTextFlow(textFlow:TextFlow,
+                                             text:String):void
+    {
+        for (var leaf:FlowLeafElement = textFlow.getFirstLeaf();
+             leaf;
+             leaf = leaf.getNextLeaf())
+        {
+            if (leaf is SpanElement)
+            {
+                var t:String = text.substring(leaf.getAbsoluteStart(),
+                                              leaf.textLength);
+                SpanElement(leaf).text = t;
+            }
+        }
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 7198
Author:   hmuller@adobe.com
Date:     2009-05-21T22:27:07.016124Z

Log Message:
-----------
If a DataGroup changes its itemRenderer or dataProvider it needs to ensure that the
state cached for the sake of virtual layout is cleared.  Added
LayoutBase::clearVirtualLayoutState() for this.

BasicLayout.useVirtualLayout=false is now ignored (generates a warning).

QE Notes: API Change: added LayoutBase::clearVirtualLayoutState()
Doc Notes:
Bugs: sdk-19397, sdk-20443, sdk-20930
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
@@ -806,6 +806,16 @@
         return bounds;
     }

+    /**
+     *  Clear all cached state, reset length to zero.
+     */
+    public function clear():void
+    {
+        length = 0;
+        minorSize = 0;
+        minMinorSize = 0;
+    }
+
     public function toString():String
     {
         return "LinearLayoutVector{" +


Return the Record upon calling setAttributes().

--- src/flails/resource/Record.as
+++ src/flails/resource/Record.as
@@ -16,13 +16,15 @@
       }
     }

-    public function setAttributes(attributes:Object):void {
+    public function setAttributes(attributes:Object):Record {
       trace("setting the record's attributes");

       for (var key:String in attributes) {
         trace("setting " + key + " with " + attributes[key]);
         this[key] = attributes[key];
       }
+
+      return this;
     }

     /*    public function resource():Resource {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12003
Author:   doug.lee@ssbbartgroup.com
Date:     2009-11-19T20:14:34.681716Z

Log Message:
-----------
Added all (three) MSAA role constants defined in MSAA 2.0 that were
not defined in earlier MSAA versions: ROLE_SYSTEM_SPLITBUTTON,
ROLE_SYSTEM_IPADDRESS, and ROLE_SYSTEM_OUTLINEBUTTON.

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

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccConst.as

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

--- frameworks/projects/framework/src/mx/accessibility/AccConst.as
+++ frameworks/projects/framework/src/mx/accessibility/AccConst.as
@@ -510,6 +510,31 @@
 	 *  the object represents a control that displays time.
 	 */
 	public static const ROLE_SYSTEM_CLOCK:uint = 0x3D;
+
+	/**
+	 *  An MSAA role indicating that
+	 *  The object represents a button on a toolbar that has a drop-down
+	 *  list icon directly adjacent to the button.
+	 */
+	public static const ROLE_SYSTEM_SPLITBUTTON:uint = 0x3E;
+
+	/**
+	 *  An MSAA role indicating that
+	 *  the object represents an edit control designed for an Internet
+	 *  Protocol (IP) address. The edit control is divided into sections
+	 *  for the different parts of the IP address.
+	 */
+	public static const ROLE_SYSTEM_IPADDRESS:uint = 0x3F;
+
+	/**
+	 *  An MSAA role indicating that
+	 *  the object represents items that navigate like an outline item.
+	 *  You can use the up and down arrows to move through the outline.
+	 *  However, instead of expanding and collapsing the menus by using
+	 *  left and right arrow keys, these menus expand or collapse when
+	 *  the space bar or enter key is pressed and the item has focus.
+	 */
+	public static const ROLE_SYSTEM_OUTLINEBUTTON:uint = 0x40;

 	//--------------------------------------
 	//  MSAA states


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

--- frameworks/projects/framework/src/mx/accessibility/AccConst.as
+++ frameworks/projects/framework/src/mx/accessibility/AccConst.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2003-2006 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.accessibility
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/core/IProgrammaticSkin.as
+++ frameworks/projects/framework/src/mx/core/IProgrammaticSkin.as
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+/**
+ *  The IProgrammaticSkin interface defines the interface that skin classes must implement
+ *  if they use the name property skin interface.
+ */
+public interface IProgrammaticSkin
+{
+    /**
+     *  @copy mx.skins.ProgrammaticSkin#validateNow()
+     */
+    function validateNow():void;
+
+    /**
+     *  @copy mx.skins.ProgrammaticSkin#validateDisplayList()
+     */
+    function validateDisplayList():void;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10919
Author:   gosmith@adobe.com
Date:     2009-10-07T22:15:33.759089Z

Log Message:
-----------
Integrated TLF Build 517.

This isn't the latest TLF build, but it is the one that introduced a significant API change, so I want to take it before taking other TLF changes. The ITextLineCreator interface, with its createTextLine() and recreateTextLine() methods, has been replaced with an ISWFContext interface with a callInContext() method. This required changes in 11 framework classes and in the MXML compiler's autogenerated code for the module factory classes.

The purpose of both the old and the new interface is to support cross-SWF font embedding, by allowing certain FTE calls such as textBlock.createTextLine() to execute in the SWF where the font you're using is embedded.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Alex should review
Tests run: ant checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/TextFlowLine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IFlexModuleFactory.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/textLayout/textLayout_core/src/flashx/textLayout/compose/IFlowComposer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_edit/src/flashx/textLayout/container/TextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/TextFieldFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/CoreClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/BuildInfo.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/ComposeState.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/ReleaseNotes.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/FlowComposerBase.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/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/StringTextLineFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/compose/SimpleCompose.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/elements/FlowLeafElement.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/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/TextLineFactoryBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/tlf.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/textLayout/textLayout_core/src/flashx/textLayout/factory/TextFlowTextLineFactory.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -1750,8 +1750,12 @@
     /**
    	 *  @private
 	 *  This method is overridden in the autogenerated subclass.
+	 *  It is part of TLF's ISWFContext interface.
+	 *  Although this class does not declare that it implements this interface,
+	 *  the autogenerated subclass does.
    	 */
-    public function callInContext(fn:Function, thisArg:*, argsArray:*, returns:Boolean=true):*
+    public function callInContext(fn:Function, thisArg:Object,
+								  argArray:Array, returns:Boolean = true):*
     {
         return undefined;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 11650
Author:   dloverin@adobe.com
Date:     2009-11-11T14:00:10.715278Z

Log Message:
-----------
Fix global styles defined in a module and a module loading bug.

Fixes a case where a module locally modified the global style but it wasn’t taking effect. If a module has a global style defined in its style manager then add it to the inherit chain after its parent’s inherit chain.

QE notes: None.
Doc notes: None.
Bugs: SDK-24111, SDK-24095
Reviewer: Alex, Glenn
Tests run: checkintests, PerModuleStyles, Managers/StyleManager
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/styles/StyleProtoChain.as
+++ frameworks/projects/framework/src/mx/styles/StyleProtoChain.as
@@ -30,6 +30,7 @@
 import mx.core.mx_internal;
 import mx.effects.EffectManager;
 import mx.managers.SystemManager;
+import mx.modules.Module;
 import mx.modules.ModuleManager;
 import mx.utils.NameUtil;
 import mx.utils.OrderedObject;
@@ -186,16 +187,28 @@
         if (nonInheritChain && nonInheritChain.effects)
             object.registerEffects(nonInheritChain.effects);

-        var p:IStyleClient;
+        var p:IStyleClient = null;
         if (object is IVisualElement)
             p = IVisualElement(object).parent as IStyleClient;
-

         if (p)
         {
             var inheritChain:Object = p.inheritingStyles;
             if (inheritChain == StyleProtoChain.STYLE_UNINITIALIZED)
                 inheritChain = nonInheritChain;
+
+            // If this object is a module then add its global styles to the
+            // inheritChain. If we don't have global styles in this style manager
+            // then the user didn't declare a global style in the module and the
+            // compiler didn't add a duplicate default style. In that case don't
+            // add global styles to the chain because the parent style manager's
+            // global styles are already on the chain.
+            if (object is Module)
+            {
+                styleDeclaration = styleManager.getStyleDeclaration("global");
+                if (styleDeclaration)
+                    inheritChain = styleDeclaration.addStyleToProtoChain(inheritChain, DisplayObject(object));
+            }
         }
         else
         {


DONE FLEX-33994 Need a way to distinguish phone and tablet target devices through css Removed trace statements

--- frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
+++ frameworks/projects/framework/src/mx/utils/MediaQueryParser.as
@@ -551,7 +551,7 @@
             deviceWidth = new CSSDimension(w, deviceDPI);
             deviceHeight = new CSSDimension(h, deviceDPI);
             flexDeviceDiagonal = new CSSDimension(  diag, deviceDPI );
-            trace(" width:", deviceWidth, " height: ", deviceHeight, " diag:", flexDeviceDiagonal);
+     //       trace(" width:", deviceWidth, " height: ", deviceHeight, " diag:", flexDeviceDiagonal);

            return needToUpdateStyles;
         }


FLEX-27509
CAUSE: In an AdvancedDataGrid with non-text item renderers AdvancedDataGrid.expandItem() applies masks onto those item renderers when it needs to close a node. At the same time, AdvancedListBase has its own custom mechanism for using masks to scroll vertically in a more efficient way. In order to detect whether it's used this mechanism, and reset the changes (detection happens in AdvancedListBase.removeClipMask(), while the mechanism is applied in addClipMask()), it simply asks whether the non-text item renderer has a mask applied. However, this mask could have been applied by the expandItem() mechanism mentioned above, which means that addClipMask() will never have been called. As a result, itemMaskFreeList is still null, which leads to the fatal.

SOLUTION: Ideally there should be a flag that specifies whether AdvancedListBase.addClipMask() has applied the masking mechanism. But for now we can simply check that itemMaskFreeList isn't null before we use it.

--- frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
+++ frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
@@ -5231,7 +5231,10 @@
             }
             else if (item && item.mask)
             {
-                itemMaskFreeList.push(item.mask);
+                if(itemMaskFreeList)
+                {
+                    itemMaskFreeList.push(item.mask);
+                }
                 item.mask = null;
             }
         }


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

--- frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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.supportClasses
 {


FLEX-34778
CAUSE: When a node is opened, HierarchicalCollectionView starts to listen to changes to its children collection. And when it's closed, it doesn't stop listening to these CollectionEvents. So when a closed node's child is replaced, nestedCollectionChangeHandler is triggered, even if the node itself is closed. Part of nestedCollectionChangeHandler's function is to dispatch a REMOVE CollectionEvent for all the nodes which were removed by the replacement (which is, all the descendants of the replaced - but closed! - node). Then, since the node that's being replaced is not accessible anymore (because its parent was closed), it's not added to convertedEvent.items. But the next lines assume that the replaced node will be in that array without mistake. Otherwise (as it happens in this bus) it goes into an infinite loop trying to find it.

SOLUTION: instead of looking for the node with an (indefinitely) incrementing index, we're now using Array.indexOf() to locate the node and remove it if it's found.

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as
@@ -1152,7 +1152,7 @@
     private function internalRefresh(dispatch:Boolean):Boolean
     {
         var obj:Object;
-        var coll:ICollectionView
+        var coll:ICollectionView;
         var needUpdate:Boolean = false;

         // apply filter function to all the collections including the child collections
@@ -1531,9 +1531,9 @@
                 for (i = 0; i < n; i++)
                 {
                     node = ce.items[i].oldValue;
-                    while (convertedEvent.items[j] != node)
-                        j++;
-                    convertedEvent.items.splice(j, 1);
+                    var replacedNodePosition:int = convertedEvent.items.indexOf(node);
+                    if(replacedNodePosition != -1)
+                        convertedEvent.items.splice(replacedNodePosition, 1);
                 }
                 if (convertedEvent.items.length)
                 {
@@ -1654,9 +1654,10 @@
                     changingNode = ce.items[i].oldValue;
                     if (changingNode is XML)
                         stopTrackUpdates(changingNode);
-                    while (convertedEvent.items[j] != changingNode)
-                        j++;
-                    convertedEvent.items.splice(j, 1);
+
+                    var replacedNodePosition:int = convertedEvent.items.indexOf(changingNode);
+                    if(replacedNodePosition != -1)
+                        convertedEvent.items.splice(replacedNodePosition, 1);
                 }
                 if (convertedEvent.items.length)
                 {


OFC-528 User with role DATA_ENTRY can edit records in phase 2 and 3. He can even reject the record\!\!\!

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/Application.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/Application.as
@@ -30,6 +30,7 @@

 		private static var _activeSurvey:SurveyProxy;
 		private static var _activeRecord:RecordProxy;
+		private static var _activeRecordEditable:Boolean;
 		private static var _activeRootEntity:EntityDefinitionProxy;
 		private static var _activeStep:CollectRecord$Step;
 		private static var _serverOffline:Boolean;
@@ -118,6 +119,15 @@
 		}

 		[Bindable]
+		public static function get activeRecordEditable():Boolean {
+			return _activeRecordEditable;
+		}
+
+		public static function set activeRecordEditable(value:Boolean):void{
+			_activeRecordEditable = value;
+		}
+
+		[Bindable]
 		public static function get activeStep():CollectRecord$Step {
 			return _activeStep;
 		}