Transferred from the Adobe Open Source Subversion Repository

Revision: 3057
Author:   jimurphy@adobe.com
Date:     2008-09-02T15:18:38.819662Z

Log Message:
-----------
Merged 3.0.x revisions [2966,2969,2995,3004,3018-3019,3023,3029-3030,3046,3049,3052] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/ModalWindowRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/PopUpRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerGlobals.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/EventProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SizeRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/InterManagerRequest.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterManagerRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FocusRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/wsdl/WSDL.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/dividedBoxClasses/BoxDivider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootDragEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.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/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxMouseEvent.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/EventUtil.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeRequest.as</path>

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

--- frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as
+++ frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as
@@ -32,8 +32,8 @@
 import mx.core.FlexSprite;
 import mx.core.mx_internal;
 import mx.core.IUIComponent;
-import mx.events.SandboxRootRequest;
-import mx.events.SandboxRootMouseEvent;
+import mx.events.InterManagerRequest;
+import mx.events.SandboxMouseEvent;
 import mx.events.SWFBridgeRequest;
 import mx.styles.CSSStyleDeclaration;
 import mx.styles.StyleManager;
@@ -99,8 +99,8 @@
 			this.systemManager = SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager;

 		sandboxRoot = this.systemManager.getSandboxRoot();
-		sandboxRoot.addEventListener(SandboxRootRequest.CURSOR_MANAGER_REQUEST, marshalCursorManagerHandler, false, 0, true);
-		var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+		sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST, marshalCursorManagerHandler, false, 0, true);
+		var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 		me.name = "update";
 		// trace("--->update request for CursorManagerImpl", sm);
 		sandboxRoot.dispatchEvent(me);
@@ -215,7 +215,7 @@
         _currentCursorID = value;
 		if (!cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "currentCursorID";
 			me.value = currentCursorID;
 			// trace("-->dispatched currentCursorID for CursorManagerImpl", sm, currentCursorID);
@@ -252,7 +252,7 @@
         _currentCursorXOffset = value;
 		if (!cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "currentCursorXOffset";
 			me.value = currentCursorXOffset;
 			// trace("-->dispatched currentCursorXOffset for CursorManagerImpl", sm, currentCursorXOffset);
@@ -289,7 +289,7 @@
         _currentCursorYOffset = value;
 		if (!cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "currentCursorYOffset";
 			me.value = currentCursorYOffset;
 			// trace("-->dispatched currentCursorYOffset for CursorManagerImpl", sm, currentCursorYOffset);
@@ -317,7 +317,7 @@
 	        cursorHolder.visible = true;
 		else
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "showCursor";
 			// trace("-->dispatched showCursor for CursorManagerImpl", sm);
 			sandboxRoot.dispatchEvent(me);
@@ -338,7 +338,7 @@
 	        cursorHolder.visible = false;
 		else
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "hideCursor";
 			// trace("-->dispatched hideCursor for CursorManagerImpl", sm);
 			sandboxRoot.dispatchEvent(me);
@@ -389,7 +389,7 @@
         */
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "setCursor";
 			me.value = [ cursorClass, priority, xOffset, yOffset ];
 			// trace("-->dispatched setCursor for CursorManagerImpl", sm, me.value);
@@ -450,7 +450,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "removeCursor";
 			me.value = cursorID;
 			// trace("-->dispatched removeCursor for CursorManagerImpl", sm, me.value);
@@ -483,7 +483,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "removeAllCursors";
 			// trace("-->dispatched removeAllCursors for CursorManagerImpl", sm);
 			sandboxRoot.dispatchEvent(me);
@@ -509,7 +509,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "setBusyCursor";
 			// trace("-->dispatched setBusyCursor for CursorManagerImpl", sm);
 			sandboxRoot.dispatchEvent(me);
@@ -537,7 +537,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "removeBusyCursor";
 			// trace("-->dispatched removeBusyCursor for CursorManagerImpl", sm);
 			sandboxRoot.dispatchEvent(me);
@@ -572,7 +572,7 @@

                 initialized = true;

-				var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+				var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 				me.name = "initialized";
 				// trace("-->dispatched removeBusyCursor for CursorManagerImpl", sm);
 				sandboxRoot.dispatchEvent(me);
@@ -651,7 +651,7 @@
 						systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,
                                                    mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);

-                    sandboxRoot.addEventListener(SandboxRootMouseEvent.MOUSE_MOVE_SOMEWHERE,
+                    sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,
                                                    marshalMouseMoveHandler,false,EventPriority.CURSOR_MANAGEMENT);
                 }

@@ -676,7 +676,7 @@
 					systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,
                                                   mouseMoveHandler,true);

-                sandboxRoot.removeEventListener(SandboxRootMouseEvent.MOUSE_MOVE_SOMEWHERE,
+                sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,
                                                   marshalMouseMoveHandler,false);
                 cursorHolder.removeChild(currentCursor);

@@ -706,7 +706,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "registerToUseBusyCursor";
 			me.value = source;
 			// trace("-->dispatched registerToUseBusyCursor for CursorManagerImpl", sm, me.value);
@@ -732,7 +732,7 @@
     {
         if (initialized && !cursorHolder)
 		{
-			var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 			me.name = "unRegisterToUseBusyCursor";
 			me.value = source;
 			// trace("-->dispatched unRegisterToUseBusyCursor for CursorManagerImpl", sm, me.value);
@@ -909,7 +909,7 @@
 	 */
 	private function marshalCursorManagerHandler(event:Event):void
 	{
-		if (event is SandboxRootRequest)
+		if (event is InterManagerRequest)
 			return;

 		var marshalEvent:Object = event;
@@ -990,25 +990,25 @@
 			if (cursorHolder)
 			{
 				// trace("-->marshaled update for CursorManagerImpl", sm);
-				var me:SandboxRootRequest = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+				var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 				me.name = "initialized";
 				me.value = true;
 				// trace("-->dispatched initialized for CursorManagerImpl", sm, true);
 				sandboxRoot.dispatchEvent(me);
 				// trace("<--dispatched initialized for CursorManagerImpl", sm, true);
-				me = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+				me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 				me.name = "currentCursorID";
 				me.value = currentCursorID;
 				// trace("-->dispatched currentCursorID for CursorManagerImpl", sm, true);
 				sandboxRoot.dispatchEvent(me);
 				// trace("<--dispatched currentCursorID for CursorManagerImpl", sm, true);
-				me = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+				me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 				me.name = "currentCursorXOffset";
 				me.value = currentCursorXOffset;
 				// trace("-->dispatched currentCursorXOffset for CursorManagerImpl", sm, true);
 				sandboxRoot.dispatchEvent(me);
 				// trace("<--dispatched currentCursorXOffset for CursorManagerImpl", sm, true);
-				me = new SandboxRootRequest(SandboxRootRequest.CURSOR_MANAGER_REQUEST);
+				me = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
 				me.name = "currentCursorYOffset";
 				me.value = currentCursorYOffset;
 				// trace("-->dispatched currentCursorYOffset for CursorManagerImpl", sm, true);


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package flex.component
+package mx.components
 {

 import flash.display.Graphics;
@@ -47,9 +47,9 @@
 import flashx.tcal.operations.FlowOperation;
 import flashx.tcal.operations.SplitParagraphOperation;

-import flex.events.TextOperationEvent;
-import flex.intf.IViewport;
-import flex.utils.TextUtil;
+import mx.events.TextOperationEvent;
+import mx.core.IViewport;
+import mx.utils.TextUtil;

 import mx.core.UIComponent;
 import mx.events.FlexEvent;
@@ -70,12 +70,12 @@
  *  You can alter the operation, or cancel the event
  *  to prevent the operation from being processed.
  */
-[Event(name="changing", type="flex.events.TextOperationEvent")]
+[Event(name="changing", type="mx.events.TextOperationEvent")]

 /**
  *  Dispatched after a user editing operation is complete.
  */
-[Event(name="change", type="flex.events.TextOperationEvent")]
+[Event(name="change", type="mx.events.TextOperationEvent")]

 /**
  *  Dispatched when the user pressed the Enter key.
@@ -346,7 +346,7 @@
     //----------------------------------

     /**
-     * @copy flex.layout.LayoutBase#horizontalScrollPositionDelta
+     * @copy mx.layout.LayoutBase#horizontalScrollPositionDelta
      */
     public function horizontalScrollPositionDelta(unit:uint):Number
     {
@@ -384,7 +384,7 @@
     }

     /**
-     * @copy flex.layout.LayoutBase#horizontalScrollPositionDelta
+     * @copy mx.layout.LayoutBase#horizontalScrollPositionDelta
      */
     public function verticalScrollPositionDelta(unit:uint):Number
     {
@@ -428,7 +428,7 @@
     private var _clipContent:Boolean = true;

     /**
-     * @copy flex.layout.LayoutBase#clipContent
+     * @copy mx.layout.LayoutBase#clipContent
      */
     public function get clipContent():Boolean
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3148
Author:   gosmith@adobe.com
Date:     2008-09-08T22:01:15.712225Z

Log Message:
-----------
You can now use CSS styles to set the default text format for TextView. It no longer has any formatting properties. It supports the entire set of Gumbo text format styles.

SkinnableComponent and Group now also support all these styles. However, skins such as ButtonSkin, TextInputSkin, and TextAreaSkin continue for now to specify instance styles on their TextBox, TextGraphic, and TextView, in order to give them a Gumbo look rather than a Halo look. So if you try setting, for example, the fontSize on the Application, it doesn't yet affect the text format of a Button, TextInput, TextArea, etc. unless you remove the instance style in the skin.

Reviewer: Glenn
Bugs: -
QA: Lots of new stuff to test!
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -16,9 +16,6 @@
 import flash.events.Event;
 import flash.text.engine.ElementFormat;
 import flash.text.engine.FontDescription;
-import flash.text.engine.FontPosture;
-import flash.text.engine.FontWeight;
-import flash.text.engine.Kerning;
 import flash.text.engine.TextBlock;
 import flash.text.engine.TextElement;
 import flash.text.engine.TextLine;
@@ -33,7 +30,6 @@
 import text.container.IContainerController;
 import text.edit.EditManager;
 import text.edit.ISelectionManager;
-import text.edit.SelectionState;
 import text.elements.FlowElement;
 import text.elements.ParagraphElement;
 import text.elements.SpanElement;
@@ -41,19 +37,12 @@
 import text.events.CompositionCompletionEvent;
 import text.events.FlowOperationEvent;
 import text.events.SelectionEvent;
-import text.formats.BlockProgression;
 import text.formats.CharacterFormat;
 import text.formats.ContainerFormat;
-import text.formats.Direction;
 import text.formats.ICharacterFormat;
 import text.formats.IContainerFormat;
 import text.formats.IParagraphFormat;
-import text.formats.LineBreak;
 import text.formats.ParagraphFormat;
-import text.formats.TextAlign;
-import text.formats.TextDecoration;
-import text.formats.VerticalAlign;
-import text.formats.WhitespaceCollapse;
 import text.importExport.TextFilter;
 import text.operations.ApplyCharacterFormatOperation;
 import text.operations.ApplyContainerFormatOperation;
@@ -89,6 +78,21 @@
  */
 [Event(name="enter", type="mx.events.FlexEvent")]

+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/BasicContainerFormatTextStyles.as"
+include "../styles/metadata/AdvancedContainerFormatTextStyles.as"
+include "../styles/metadata/BasicParagraphFormatTextStyles.as"
+include "../styles/metadata/AdvancedParagraphFormatTextStyles.as"
+include "../styles/metadata/BasicCharacterFormatTextStyles.as"
+include "../styles/metadata/AdvancedCharacterFormatTextStyles.as"
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
 [DefaultProperty("content")]

 /**
@@ -127,6 +131,26 @@

     /**
      *  @private
+     *  This set keeps track of which text formats were specified
+     *  on the graphic element's TextFlow as opposed to on the
+     *  graphic element itself.
+     *
+     *  For example, if you have
+     *
+     *      <TextGraphic fontSize="10">
+     *          <content>
+     *              <TextFlow fontSize="20">
+     *                  ...
+     *              </TextFlow>
+     *          </content>
+     *      </TextGraphic>
+     *
+     *  then this set would be { fontSize: 20 }.
+     */
+    private var textFlowTextFormat:Object = {};
+
+    /**
+     *  @private
      */
     private var textAttributeChanged:Boolean = true;

@@ -154,939 +178,6 @@
      *  @private
      */
     private var charWidth:Number;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties: Text formatting
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  blockProgression
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _blockProgression:String = BlockProgression.TB;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get blockProgression():String
-    {
-        return _blockProgression;
-    }
-
-    /**
-     *  @private
-     */
-    public function set blockProgression(value:String):void
-    {
-        if (value == _blockProgression)
-            return;
-
-        _blockProgression = value;
-        textAttributeChanged = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  color
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _color:uint = 0x000000;
-
-    /**
-     *  The color of the text.
-     *
-     *  @default 0x000000
-     */
-    public function get color():uint
-    {
-        return _color;
-    }
-
-    /**
-     *  @private
-     */
-    public function set color(value:uint):void
-    {
-        if (value == _color)
-            return;
-
-        _color = value;
-        textAttributeChanged = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  direction
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _direction:String = Direction.LTR;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get direction():String
-    {
-        return _direction;
-    }
-
-    /**
-     *  @private
-     */
-    public function set direction(value:String):void
-    {
-        if (value == _direction)
-            return;
-
-        _direction = value;
-        textAttributeChanged = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  fontFamily
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _fontFamily:String = "Times New Roman";
-
-    /**
-     *  The name of the font used to render the text.
-     *
-     *  @default "Times New Roman"
-     */
-    public function get fontFamily():String
-    {
-        return _fontFamily;
-    }
-
-    /**
-     *  @private
-     */
-    public function set fontFamily(value:String):void
-    {
-        if (value == _fontFamily)
-            return;
-
-        _fontFamily = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  fontSize
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _fontSize:Number = 12;
-
-    /**
-     *  The size, in pixels, of the font used to render the text.
-     *
-     *  @default 12
-     */
-    public function get fontSize():Number
-    {
-        return _fontSize;
-    }
-
-    /**
-     *  @private
-     */
-    public function set fontSize(value:Number):void
-    {
-        if (value == _fontSize)
-            return;
-
-        _fontSize = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  fontStyle
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _fontStyle:String = FontPosture.NORMAL;
-
-    /**
-     *  Determines whether the text is italic.
-     *  Recognized values are "normal" and "italic".
-     *
-     *  @default "normal"
-     */
-    public function get fontStyle():String
-    {
-        return _fontStyle;
-    }
-
-    /**
-     *  @private
-     */
-    public function set fontStyle(value:String):void
-    {
-        if (value == _fontStyle)
-            return;
-
-        _fontStyle = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  fontWeight
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _fontWeight:String = FontWeight.NORMAL;
-
-    /**
-     *  Determines whether the text is boldface.
-     *  Recognized values are "normal" and "bold".
-     *
-     *  @default "normal"
-     */
-    public function get fontWeight():String
-    {
-        return _fontWeight;
-    }
-
-    /**
-     *  @private
-     */
-    public function set fontWeight(value:String):void
-    {
-        if (value == _fontWeight)
-            return;
-
-        _fontWeight = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  kerning
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _kerning:String = Kerning.AUTO;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get kerning():String
-    {
-        return _kerning;
-    }
-
-    /**
-     *  @private
-     */
-    public function set kerning(value:String):void
-    {
-        if (value == _kerning)
-            return;
-
-        _kerning = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  lineBreak
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _lineBreak:String = LineBreak.TO_FIT;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get lineBreak():String
-    {
-        return _lineBreak;
-    }
-
-    /**
-     *  @private
-     */
-    public function set lineBreak(value:String):void
-    {
-        if (value == _lineBreak)
-            return;
-
-        _lineBreak = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  lineHeight
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _lineHeight:Object = "120%";
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get lineHeight():Object
-    {
-        return _lineHeight;
-    }
-
-    /**
-     *  @private
-     */
-    public function set lineHeight(value:Object):void
-    {
-        if (value == _lineHeight)
-            return;
-
-        _lineHeight = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  lineThrough
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _lineThrough:Boolean = false;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get lineThrough():Boolean
-    {
-        return _lineThrough;
-    }
-
-    /**
-     *  @private
-     */
-    public function set lineThrough(value:Boolean):void
-    {
-        if (value == _lineThrough)
-            return;
-
-        _lineThrough = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  marginBottom
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _marginBottom:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get marginBottom():Number
-    {
-        return _marginBottom;
-    }
-
-    /**
-     *  @private
-     */
-    public function set marginBottom(value:Number):void
-    {
-        if (value == _marginBottom)
-            return;
-
-        _marginBottom = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  marginLeft
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _marginLeft:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get marginLeft():Number
-    {
-        return _marginLeft;
-    }
-
-    /**
-     *  @private
-     */
-    public function set marginLeft(value:Number):void
-    {
-        if (value == _marginLeft)
-            return;
-
-        _marginLeft = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  marginRight
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _marginRight:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get marginRight():Number
-    {
-        return _marginRight;
-    }
-
-    /**
-     *  @private
-     */
-    public function set marginRight(value:Number):void
-    {
-        if (value == _marginRight)
-            return;
-
-        _marginRight = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  marginTop
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _marginTop:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get marginTop():Number
-    {
-        return _marginTop;
-    }
-
-    /**
-     *  @private
-     */
-    public function set marginTop(value:Number):void
-    {
-        if (value == _marginTop)
-            return;
-
-        _marginTop = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  paddingBottom
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _paddingBottom:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get paddingBottom():Number
-    {
-        return _paddingBottom;
-    }
-
-    /**
-     *  @private
-     */
-    public function set paddingBottom(value:Number):void
-    {
-        if (value == _paddingBottom)
-            return;
-
-        _paddingBottom = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  paddingLeft
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _paddingLeft:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get paddingLeft():Number
-    {
-        return _paddingLeft;
-    }
-
-    /**
-     *  @private
-     */
-    public function set paddingLeft(value:Number):void
-    {
-        if (value == _paddingLeft)
-            return;
-
-        _paddingLeft = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  paddingRight
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _paddingRight:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get paddingRight():Number
-    {
-        return _paddingRight;
-    }
-
-    /**
-     *  @private
-     */
-    public function set paddingRight(value:Number):void
-    {
-        if (value == _paddingRight)
-            return;
-
-        _paddingRight = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  paddingTop
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _paddingTop:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get paddingTop():Number
-    {
-        return _paddingTop;
-    }
-
-    /**
-     *  @private
-     */
-    public function set paddingTop(value:Number):void
-    {
-        if (value == _paddingTop)
-            return;
-
-        _paddingTop = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  textAlign
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _textAlign:String = TextAlign.START;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get textAlign():String
-    {
-        return _textAlign;
-    }
-
-    /**
-     *  @private
-     */
-    public function set textAlign(value:String):void
-    {
-        if (value == _textAlign)
-            return;
-
-        _textAlign = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  textAlignLast
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _textAlignLast:String = TextAlign.START;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get textAlignLast():String
-    {
-        return _textAlignLast;
-    }
-
-    /**
-     *  @private
-     */
-    public function set textAlignLast(value:String):void
-    {
-        if (value == _textAlignLast)
-            return;
-
-        _textAlignLast = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  textAlpha
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _textAlpha:Number = 1.0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get textAlpha():Number
-    {
-        return _textAlpha;
-    }
-
-    /**
-     *  @private
-     */
-    public function set textAlpha(value:Number):void
-    {
-        if (value == _textAlpha)
-            return;
-
-        _textAlpha = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  textDecoration
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _textDecoration:String = TextDecoration.NONE;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get textDecoration():String
-    {
-        return _textDecoration;
-    }
-
-    /**
-     *  @private
-     */
-    public function set textDecoration(value:String):void
-    {
-        if (value == _textDecoration)
-            return;
-
-        _textDecoration = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  textIndent
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _textIndent:Number = 0;
-
-    /**
-     *  Documentation is not currently available.
-     */
-    public function get textIndent():Number
-    {
-        return _textIndent;
-    }
-
-    /**
-     *  @private
-     */
-    public function set textIndent(value:Number):void
-    {
-        if (value == _textIndent)
-            return;
-
-        _textIndent = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  tracking
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _tracking:Object = 0;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get tracking():Object
-    {
-        return _tracking;
-    }
-
-    /**
-     *  @private
-     */
-    public function set tracking(value:Object):void
-    {
-        if (value == _tracking)
-            return;
-
-        _tracking = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  verticalAlign
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _verticalAlign:String = VerticalAlign.TOP;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get verticalAlign():String
-    {
-        return _verticalAlign;
-    }
-
-    /**
-     *  @private
-     */
-    public function set verticalAlign(value:String):void
-    {
-        if (value == _verticalAlign)
-            return;
-
-        _verticalAlign = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  whiteSpaceCollapse
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _whiteSpaceCollapse:String = WhitespaceCollapse.PRESERVE;
-
-    /**
-     *  Documentation is not currrently available.
-     */
-    public function get whiteSpaceCollapse():String
-    {
-        return _whiteSpaceCollapse;
-    }
-
-    /**
-     *  @private
-     */
-    public function set whiteSpaceCollapse(value:String):void
-    {
-        if (value == _whiteSpaceCollapse)
-            return;
-
-        _whiteSpaceCollapse = value;
-        textAttributeChanged = true;
-        fontMetricsInvalid = true;
-
-        invalidateProperties();
-        invalidateSize();
-        invalidateDisplayList();
-    }

     //--------------------------------------------------------------------------
     //
@@ -1572,11 +663,13 @@
     {
         super.measure();

-        measuredWidth = paddingLeft + widthInChars * charWidth + paddingRight;
-
-        measuredHeight = paddingTop +
+        measuredWidth = getStyle("paddingLeft") +
+                        widthInChars * charWidth +
+                        getStyle("paddingRight");
+
+        measuredHeight = getStyle("paddingTop") +
                          heightInLines * (ascent + descent) +
-                         paddingBottom;
+                         getStyle("paddingBottom");

         //trace("measure", measuredWidth, measuredHeight);
     }
@@ -1622,11 +715,11 @@
     private function calculateFontMetrics():void
     {
         var fontDescription:FontDescription = new FontDescription();
-        fontDescription.fontName = fontFamily;
+        fontDescription.fontName = getStyle("fontFamily");

         var elementFormat:ElementFormat = new ElementFormat();
         elementFormat.fontDescription = fontDescription;
-        elementFormat.fontSize = fontSize;
+        elementFormat.fontSize = getStyle("fontSize");

         var textElement:TextElement = new TextElement();
         textElement.elementFormat = elementFormat;
@@ -1670,115 +763,111 @@

 	/**
 	 *  @private
+     *  Keep this method in sync with the same method in TextGraphic.
 	 */
 	private function createTextFlow():TextFlow
 	{
-		if (contentChanged)
-		{
-            if (content is TextFlow)
+        var p:String;
+
+		if (contentChanged || textChanged)
+        {
+		    if (contentChanged)
+		    {
+                if (content is TextFlow)
+                {
+                    textFlow = TextFlow(content);
+                }
+                else if (content is Array)
+                {
+                    textFlow = createEmptyTextFlow();
+                    textFlow.mxmlChildren = content as Array;
+                }
+                else if (content is FlowElement)
+                {
+                    textFlow = createEmptyTextFlow();
+                    textFlow.mxmlChildren = [ content ];
+                }
+			    else if (content is String)
+			    {
+				    textFlow = importMarkup(String(content));
+			    }
+			    else if (content == null)
+			    {
+				    textFlow = createEmptyTextFlow();
+			    }
+                else
+                {
+                    throw new Error("invalid content");
+                }
+		    }
+		    else if (textChanged)
+		    {
+			    if (text != null && text != "")
+			    {
+				    textFlow = TextFilter.importFromString(text, TextFilter.PLAIN_TEXT_FORMAT);
+			    }
+			    else
+			    {
+				    textFlow = createEmptyTextFlow();
+			    }
+		    }
+
+            // Build a textFlowTextFormat object which keeps track
+            // of which text formats were specified on the TextFlow
+            // as opposed to on the TextGraphic.
+            // For example, if the 'content' were
+            // <TextFlow fontSize="12">...</TextFlow>
+            // then the textFlowTextFormat would be { fontSize: 12 }.
+
+            var containerFormat:IContainerFormat =
+                textFlow.containerFormat;
+            var paragraphFormat:IParagraphFormat =
+                textFlow.paragraphFormat;
+            var characterFormat:ICharacterFormat =
+                textFlow.characterFormat;
+
+            for each (p in TextUtil.ALL_FORMAT_NAMES)
             {
-                textFlow = TextFlow(content);
+                var kind:String = TextUtil.FORMAT_MAP[p];
+
+                if (kind == TextUtil.CONTAINER &&
+                    containerFormat != null &&
+                    containerFormat[p] != null)
+                {
+                    textFlowTextFormat[p] = containerFormat[p];
+                }
+                else if (kind == TextUtil.PARAGRAPH &&
+                         paragraphFormat != null &&
+                         paragraphFormat[p] != null)
+                {
+                    textFlowTextFormat[p] = paragraphFormat[p];
+                }
+                else if (kind == TextUtil.CHARACTER &&
+                         characterFormat != null &&
+                         characterFormat[p] != null)
+                {
+                    textFlowTextFormat[p] = characterFormat[p];
+                }
             }
-            else if (content is Array)
-            {
-                textFlow = createEmptyTextFlow();
-                textFlow.mxmlChildren = content as Array;
-            }
-            else if (content is FlowElement)
-            {
-                textFlow = createEmptyTextFlow();
-                textFlow.mxmlChildren = [ content ];
-            }
-			else if (content is String)
-			{
-				textFlow = importMarkup(String(content));
-			}
-			else if (content == null)
-			{
-				textFlow = createEmptyTextFlow();
-			}
-            else
-            {
-                throw new Error("invalid content");
-            }
-		}
-		else if (textChanged)
-		{
-			if (text != null && text != "")
-			{
-				textFlow = TextFilter.importFromString(text, TextFilter.PLAIN_TEXT_FORMAT);
-			}
-			else
-			{
-				textFlow = createEmptyTextFlow();
-			}
-		}
+        }

 		contentChanged = false;
 		textChanged = false;

-        var containerFormat:IContainerFormat =
-            textFlow.containerFormat;
-        var paragraphFormat:IParagraphFormat =
-            textFlow.paragraphFormat;
-        var characterFormat:ICharacterFormat =
-            textFlow.characterFormat;
-
-        if (!containerFormat || containerFormat.blockProgression == null)
-            textFlow.blockProgression = blockProgression;
-        if (!characterFormat || characterFormat.color == null)
-            textFlow.color = color;
-        if (!paragraphFormat || paragraphFormat.direction == null)
-            textFlow.direction = direction;
-		if (!characterFormat || characterFormat.fontFamily == null)
-            textFlow.fontFamily = fontFamily;
-		if (!characterFormat || characterFormat.fontSize == null)
-            textFlow.fontSize = fontSize;
-		if (!characterFormat || characterFormat.fontStyle == null)
-		    textFlow.fontStyle = fontStyle;
-		if (!characterFormat || characterFormat.fontWeight == null)
-		    textFlow.fontWeight = fontWeight;
-		if (!characterFormat || characterFormat.kerning == null)
-		    textFlow.kerning = kerning;
-		if (!characterFormat || characterFormat.lineHeight == null)
-		    textFlow.lineHeight = lineHeight;
-		if (!containerFormat || containerFormat.lineBreak == null)
-		    textFlow.lineBreak = lineBreak;
-		if (!characterFormat || characterFormat.lineThrough == null)
-		    textFlow.lineThrough = lineThrough;
-        if (!paragraphFormat || paragraphFormat.marginBottom == null)
-		    textFlow.marginBottom = marginBottom;
-        if (!paragraphFormat || paragraphFormat.marginLeft == null)
-		    textFlow.marginLeft = marginLeft;
-        if (!paragraphFormat || paragraphFormat.marginRight == null)
-		    textFlow.marginRight = marginRight;
-        if (!paragraphFormat || paragraphFormat.marginTop == null)
-		    textFlow.marginTop = marginTop;
-        if (!containerFormat || containerFormat.paddingBottom == null)
-		    textFlow.paddingBottom = paddingBottom;
-        if (!containerFormat || containerFormat.paddingLeft == null)
-		    textFlow.paddingLeft = paddingLeft;
-        if (!containerFormat || containerFormat.paddingRight == null)
-		    textFlow.paddingRight = paddingRight;
-        if (!containerFormat || containerFormat.paddingTop == null)
-		    textFlow.paddingTop = paddingTop;
-        if (!paragraphFormat || paragraphFormat.textAlign == null)
-		    textFlow.textAlign = textAlign;
-        if (!paragraphFormat || paragraphFormat.textAlignLast == null)
-		    textFlow.textAlignLast = textAlignLast;
-		if (!characterFormat || characterFormat.textAlpha == null)
-		    textFlow.textAlpha = textAlpha;
-		if (!characterFormat || characterFormat.textDecoration == null)
-		    textFlow.textDecoration = textDecoration;
-        if (!paragraphFormat || paragraphFormat.textIndent == null)
-		    textFlow.textIndent = textIndent;
-		if (!characterFormat || characterFormat.trackingRight == null)
-		    textFlow.trackingRight = tracking; // what about trackingLeft?
-        if (!containerFormat || containerFormat.verticalAlign == null)
-		    textFlow.verticalAlign = verticalAlign;
-		if (!characterFormat || characterFormat.whitespaceCollapse == null)
-		    textFlow.whitespaceCollapse = whiteSpaceCollapse; // different case
-
+        // For each attribute whose value wasn't specified by the TextFlow,
+        // apply the value from the TextGraphic.
+
+        for each (p in TextUtil.ALL_FORMAT_NAMES)
+        {
+            if (!(p in textFlowTextFormat))
+            {
+            	var value:* = getStyle(p);
+            	if (p == "tabStops" && value === undefined)
+            		value = null; // TODO Setting this to [] causes RTE during paste
+            	textFlow[p] = value;
+            }
+         }
+
 		return textFlow;
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 9029
Author:   aharui@adobe.com
Date:     2009-08-03T23:03:01.197795Z

Log Message:
-----------
Adjust the way RET gets its windowActivate/deactivate events.  Also adjust the way SkinnableContainer handles the temporary contentGroup when the main contentGroup gets created.

QE Notes: None
Doc Notes: None
Bugs: SDK-22418, SDK-22179
Reviewer: Corey
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/Managers/FocusManager mustella/gumbo/components/TextInput,TextArea

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -1624,17 +1624,18 @@

         if (focusManager)
         {
-            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE,
-                _textContainerManager.activateHandler, false, 0, true)
-            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_DEACTIVATE,
-                _textContainerManager.deactivateHandler, false, 0, true)
+            addActivateHandlers();
         }
         else
         {
             // if no focusmanager yet, add capture phase to detect when it
             // gets added
-            systemManager.getSandboxRoot().addEventListener(FlexEvent.ADD_FOCUS_MANAGER,
+            if (systemManager)
+                systemManager.getSandboxRoot().addEventListener(FlexEvent.ADD_FOCUS_MANAGER,
                     addFocusManagerHandler, true, 0, true)
+            else
+                // no systemManager yet?  Check again when added to stage
+                addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
         }

     }
@@ -3139,6 +3140,31 @@

     /**
      *  @private
+     *  find the right time to listen to the focusmanager
+     */
+    private function addedToStageHandler(event:Event):void
+    {
+        if (event.target == this)
+        {
+            removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
+            callLater(addActivateHandlers);
+        }
+    }
+
+    /**
+     *  @private
+     *  add listeners to focusManager
+     */
+    private function addActivateHandlers():void
+    {
+        focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE,
+            _textContainerManager.activateHandler, false, 0, true)
+        focusManager.addEventListener(FlexEvent.FLEX_WINDOW_DEACTIVATE,
+            _textContainerManager.deactivateHandler, false, 0, true)
+    }
+
+    /**
+     *  @private
      *  Called when a FocusManager is added to an IFocusManagerContainer.
      *  We need to check that it belongs
      *  to us before listening to it.
@@ -3151,10 +3177,7 @@
         {
             systemManager.getSandboxRoot().removeEventListener(FlexEvent.ADD_FOCUS_MANAGER,
                     addFocusManagerHandler, true)
-            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE,
-                _textContainerManager.activateHandler, false, 0, true)
-            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_DEACTIVATE,
-                _textContainerManager.deactivateHandler, false, 0, true)
+            addActivateHandlers();
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2993
Author:   gosmith@adobe.com
Date:     2008-08-25T21:43:44.257744Z

Log Message:
-----------
Made trunk compilable against TCAL build 156 by removing an unnecessary import of a class that no longer exists.

Reviewer: N/A
Bugs: -
QA: No
Doc: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -36,7 +36,6 @@
 import text.edit.OperationEvent;
 import text.edit.ParagraphStyleChangeOperation;
 import text.edit.SelectionChangedEvent;
-import text.edit.SelectionColor;
 import text.edit.SelectionState;
 import text.edit.SplitParOperation;
 import text.edit.StyleChangeOperation;


Transferred from the Adobe Open Source Subversion Repository

Revision: 19412
Author:   jasonsj@adobe.com
Date:     2010-12-15T23:54:30.560146Z

Log Message:
-----------
New TabbedViewNavigatorButtonBarSkin.
Fixed label alignment issues when using IconPlacement.BOTTOM.
Fixed disabled state (alpha) handling of Buttons.
Added DPI-specific styles to defaults.css using new CSS media query support.

QE notes: TabbedViewNavigatorButtonBarSkin is complete. Need to add tests for changing Button enabled state before/after icon changes.
Doc notes:
Bugs:
SDK-28715 Cannot size and position button correctly in i4 build.
Reviewer: jszeto
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarLastButton_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarFirstButtonSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarLastButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarFirstButton_up.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarLastButton_up.fxg</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/.settings</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TabbedViewNavigatorButtonBarHorizontalLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorSkin.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults320.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarLastButtonSkin.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults160.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TabbedViewNavigatorButtonBarButtonSkinBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarLastButton_up.fxg</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
@@ -82,6 +82,12 @@
     private var _icon:Object;           // The currently set icon, can be Class, DisplayObject, URL

     /**
+     *  @private
+     *  Flag that is set when the currentState changes from enabled to disabled
+     */
+    private var enabledChanged:Boolean;
+
+    /**
      *  labelDisplay skin part.
      */
     public var labelDisplay:StyleableTextField;
@@ -93,34 +99,53 @@
      */
     protected var useIconStyle:Boolean = true;

-    //--------------------------------------------------------------------------
-    //
-    //  Layout variables
-    //
-    //--------------------------------------------------------------------------
-
-    protected var layoutBorderSize:uint;
-
-    protected var layoutGap:int;
-
-    protected var layoutPaddingLeft:int;
-
-    protected var layoutPaddingRight:int;
-
-    protected var layoutPaddingTop:int;
-
-    protected var layoutPaddingBottom:int;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden properties
-    //
-    //--------------------------------------------------------------------------
+    private var _hostComponent:ButtonBase;

     /**
      * @copy spark.skins.spark.ApplicationSkin#hostComponent
      */
-    public var hostComponent:ButtonBase; // SkinnableComponent will popuplate
+    public function get hostComponent():ButtonBase
+    {
+        return _hostComponent;
+    }
+
+    /**
+     * @private
+     */
+    public function set hostComponent(value:ButtonBase):void
+    {
+        _hostComponent = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Layout variables
+    //
+    //--------------------------------------------------------------------------
+
+    protected var layoutBorderSize:uint;
+
+    protected var layoutGap:int;
+
+    /**
+     *  Left padding for icon or labelDisplay
+     */
+    protected var layoutPaddingLeft:int;
+
+    /**
+     *  Right padding for icon or labelDisplay
+     */
+    protected var layoutPaddingRight:int;
+
+    /**
+     *  Top padding for icon or labelDisplay
+     */
+    protected var layoutPaddingTop:int;
+
+    /**
+     *  Bottom padding for icon or labelDisplay
+     */
+    protected var layoutPaddingBottom:int;

     //--------------------------------------------------------------------------
     //
@@ -131,26 +156,24 @@
     /**
      *  @private
      */
-    override protected function commitCurrentState():void
-    {
-        super.commitCurrentState();
-
-        commitDisabled(currentState.indexOf("disabled") >= 0);
-    }
-
-    /**
-     *  @private
-     */
-    protected function commitDisabled(isDisabled:Boolean):void
-    {
-        alpha = isDisabled ? 0.5 : 1;
+    override public function set currentState(value:String):void
+    {
+        var isDisabled:Boolean = currentState && currentState.indexOf("disabled") >= 0;
+
+        super.currentState = value;
+
+        if (isDisabled != currentState.indexOf("disabled") >= 0)
+        {
+            enabledChanged = true;
+            invalidateProperties();
+        }
     }

     /**
      *  @private
      */
     override protected function createChildren():void
-    {
+    {
         labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
         labelDisplay.styleName = this;

@@ -194,11 +217,18 @@
     {
         super.commitProperties();

-        if (iconChanged)
-        {
+        if (useIconStyle && iconChanged)
+        {
+            // force enabled update when icon changes
+            enabledChanged = true;
+            setIcon(getStyle("icon"));
+        }
+
+        if (enabledChanged)
+        {
+            commitDisabled();
+            enabledChanged = false;
             iconChanged = false;
-            if (useIconStyle)
-                setIcon(getStyle("icon"));
         }
     }

@@ -213,6 +243,7 @@

         var textWidth:Number = 0;
         var textHeight:Number = 0;
+        var textDescent:Number = 0;

         // reset text if it was truncated before.
         if (hostComponent && labelDisplay.isTruncated)
@@ -260,12 +291,16 @@
                 h += layoutGap;
         }

+        // minimums
+        measuredMinWidth = w
+        measuredMinHeight = h;
+
         w += layoutPaddingLeft + layoutPaddingRight;
         h += layoutPaddingTop + layoutPaddingBottom;

+        // measured sizes are no smaller than spec for touch-based sizes
         measuredWidth = Math.max(w, layoutMeasuredWidth);
-        measuredMinHeight = measuredHeight = Math.max(h, layoutMeasuredHeight);
-        measuredMinWidth = iconWidth + layoutPaddingLeft + layoutPaddingRight;
+        measuredHeight = Math.max(h, layoutMeasuredHeight);
     }

     /**
@@ -359,6 +394,8 @@
             {
                 labelWidth = 0;
             }
+
+            // button viewHeight may be smaller than the labelDisplay textHeight
             labelHeight = Math.min(viewHeight, textHeight);

             if (textAlign == "left")
@@ -386,8 +423,10 @@
                 iconX  = labelX + labelWidth + horizontalGap;
             }

-            // FIXME (jasonsj): enforcement of layoutPaddingTop && layoutPaddingBottom for text
-            iconY  = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
+            iconY = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
+
+            // vertial center labelDisplay based on ascent
+            // text "height" = min(measuredTextSize.y, viewHeight) - descent + gutter
             labelY = ((viewHeight - labelHeight + textDescent - StyleableTextField.TEXT_HEIGHT_PADDING) / 2);
         }
         else
@@ -399,9 +438,12 @@

             if (textWidth > 0)
             {
+                // label width is constrained to left and right edges
                 labelWidth = Math.max(viewWidth - layoutPaddingLeft - layoutPaddingRight, 0);
-                labelHeight =
-                    Math.min(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, textHeight);
+
+                // label height is constrained to available height after icon, padding and gap heights
+                labelHeight = Math.max(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, 0);
+                labelHeight = Math.min(labelHeight, textHeight);
             }
             else
             {
@@ -432,9 +474,11 @@
             }
             else
             {
-                iconY += ((viewHeight - labelHeight - iconHeight -
-                    layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
-                labelY += iconY + iconHeight + verticalGap;
+                // label bottom is constrained by layoutPaddingBottom
+                labelY = viewHeight - layoutPaddingBottom - labelHeight;
+
+                // icon is vertically centered in the space above the label
+                iconY = Math.max(((labelY - iconHeight - verticalGap) / 2), layoutPaddingTop);
             }
         }

@@ -465,6 +509,16 @@
     //  Class methods
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  Commit alpha values for the skin when in a disabled state.
+     *
+     *  @see mx.core.UIComponent#enabled
+     */
+    protected function commitDisabled():void
+    {
+        alpha = hostComponent.enabled ? 1 : 0.5;
+    }

     /**
      *  The current skin part that displays the icon.
@@ -508,7 +562,7 @@
         if (needsHolder && !iconHolder)
         {
             iconHolder = new Group();
-            this.addChildAt(iconHolder, 0);
+            addChild(iconHolder);
         }
         else if (!needsHolder && iconHolder)
         {
@@ -532,7 +586,7 @@
                 else
                     iconInstance = icon;

-                addChildAt(iconInstance as DisplayObject, 0);
+                addChild(iconInstance as DisplayObject);
             }
         }


That last bug would have been a lot easier to track down if a disabled link button didn't still
look like it should be clickable.  Let's turn buttonMode off when we get disabled.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@492 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flex/CommandLinkButton.as
+++ src/as/com/threerings/flex/CommandLinkButton.as
@@ -50,6 +50,17 @@
         _arg = arg;
     }

+    override public function set enabled (enable :Boolean) :void
+    {
+        super.enabled = enable;
+
+        if (enable) {
+            buttonMode = true;
+        } else {
+            buttonMode = false;
+        }
+    }
+
     /**
      * Set the command and argument to be issued when this button is pressed.
      */


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/binding/FunctionReturnWatcher.as
+++ frameworks/projects/framework/src/mx/binding/FunctionReturnWatcher.as
@@ -99,6 +99,11 @@

     /**
      *  Storage for the functionGetter property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     private var functionGetter:Function;


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

--- frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as
+++ frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.resources
 {


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

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

 package spark.globalization
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3257
Author:   jimurphy@adobe.com
Date:     2008-09-18T18:16:26.838722Z

Log Message:
-----------
-Merged 3.0.X revisions 3232,3236,3238,3244 -> trunk
-integrated:
 Player build d604
 flex-messaging-common.jar 4.0.0.3256

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/lib/flex-messaging-common.jar</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/Install Flash Player 10 Plugin.exe</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/mac/Install Flash Player 10 UB.dmg</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/Install Flash Player 10 ActiveX.exe</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/player/10/playerglobal.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults-2.0.0.css</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults-2.0.1.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/lnx/flashplayer.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/lnx/install_flash_player_10_linux.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.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/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/lnx/libflashplayer.so.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/FlashPlayer.exe</path>
<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/in/player/10/mac/Flash Player.app.zip</path>

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

--- frameworks/projects/mx/src/mx/controls/ComboBox.as
+++ frameworks/projects/mx/src/mx/controls/ComboBox.as
@@ -12,6 +12,7 @@
 package mx.controls
 {

+import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
@@ -45,10 +46,12 @@
 import mx.events.DropdownEvent;
 import mx.events.FlexEvent;
 import mx.events.FlexMouseEvent;
+import mx.events.InterManagerRequest;
 import mx.events.ListEvent;
 import mx.events.SandboxMouseEvent;
 import mx.events.ScrollEvent;
 import mx.events.ScrollEventDetail;
+import mx.managers.ISystemManager;
 import mx.managers.PopUpManager;
 import mx.styles.CSSStyleDeclaration;
 import mx.styles.StyleManager;
@@ -1524,6 +1527,21 @@
         var point:Point = new Point(0, unscaledHeight);
         point = localToGlobal(point);

+        var sm:ISystemManager = systemManager.topLevelSystemManager;
+        var sbRoot:DisplayObject = sm.getSandboxRoot();
+        var screen:Rectangle;
+
+        if (sm != sbRoot)
+        {
+            var request:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST,
+                                    false, false,
+                                    "getVisibleApplicationRect");
+            sbRoot.dispatchEvent(request);
+            screen = Rectangle(request.value);
+        }
+        else
+            screen = sm.getVisibleApplicationRect();
+
         //opening the dropdown
         if (show)
         {
@@ -1543,13 +1561,11 @@
             else
                 PopUpManager.bringToFront(_dropdown);

-            point = _dropdown.parent.globalToLocal(point);
-
             // if we donot have enough space in the bottom display the dropdown
             // at the top. But if the space there is also less than required
             // display it below.
-            if (point.y + _dropdown.height > screen.height &&
-                point.y > _dropdown.height)
+            if (point.y + _dropdown.height > screen.bottom &&
+                point.y > screen.top + _dropdown.height)
             {
                 // Dropdown will go below the bottom of the stage
                 // and be clipped. Instead, have it grow up.
@@ -1563,6 +1579,8 @@
                 tweenUp = false;
             }

+            point = _dropdown.parent.globalToLocal(point);
+
             var sel:int = _dropdown.selectedIndex;
             if (sel == -1)
                 sel = 0;
@@ -1596,9 +1614,8 @@
         // closing the dropdown
         else if (_dropdown)
         {
-            point = _dropdown.parent.globalToLocal(point);
             // Set up the tween and relevant variables.
-            endY = (point.y + _dropdown.height > screen.height || tweenUp
+            endY = (point.y + _dropdown.height > screen.bottom || tweenUp
                                ? -_dropdown.height
                                : _dropdown.height);
             _showingDropdown = show;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/collections/SummaryObject.as
+++ frameworks/projects/advancedgrids/src/mx/collections/SummaryObject.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.collections
+{
+/**
+ *  The SummaryObject class defines the object used to store information when
+ *  performing custom data summaries on grouped data.
+ *  Use the SummaryRow.summaryObjectFunction property and the
+ *  SummaryField.summaryFunction property to add the
+ *  custom summary logic to your application.
+ *
+ *  @see mx.collections.SummaryField
+ *  @see mx.collections.SummaryRow
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public dynamic class SummaryObject
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function SummaryObject()
+    {
+        super();
+    }
+
+}
+}


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

--- frameworks/projects/airframework/src/mx/utils/DirectoryEnumeration.as
+++ frameworks/projects/airframework/src/mx/utils/DirectoryEnumeration.as
@@ -0,0 +1,496 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.utils
+{
+
+import flash.filesystem.File;
+import mx.collections.ArrayCollection;
+import mx.collections.Sort;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ *
+ *  The DirectoryEnumeration class supports filtering and sorting
+ *  a list of File instances representing the files and directories
+ *  in a file system directory.
+ */
+public class DirectoryEnumeration
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param source An Array of File instances representing
+     *  the files and subdirectories in a file system directory.
+     */
+	public function DirectoryEnumeration(source:Array = null)
+	{
+		super();
+
+		this.source = source;
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  A hash table for looking up extensions quickly.
+	 */
+	private var extensionsSet:Object;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  collection
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+	private var _collection:ArrayCollection;
+
+    /**
+     *  An ArrayCollection representing a filtered and sorted view
+     *  of the source Array of File instances.
+     *  The filtering is determined by the enumerationMode,
+     *  extensions, filterFunction properties,
+     *  and showHidden properties.
+     *  The sorting is determined by the enumerationMode
+     *  and nameCompareFunction properties.
+     */
+	public function get collection():ArrayCollection
+	{
+		return _collection;
+	}
+
+    //----------------------------------
+    //  enumerationMode
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the enumerationMode property.
+	 */
+	private var _enumerationMode:String =
+					DirectoryEnumerationMode.DIRECTORIES_FIRST;
+
+    /**
+     *  A String specifying whether the collection
+     *  includes only files, only subdirectories, or both.
+     *  In the case that both are included,
+     *  it also specifies whether the subdirectories are ordered
+     *  before, after, or mixed in with the files.
+     *  The possible values are specified
+     *  by the DirectoryEnumerationMode class.
+     *
+     *
You must call refresh() after setting
+     *  this property to change the collection.

+     *
+     *
This property affects which subdirectories
+     *  and files are in the collection.
+     *  However, it does not affect which File instances
+     *  are the source property; it works
+     *  by changing the behavior of the fileFilterFunction()
+     *  that is applied to the source.

+     *
+     *  @default DirectoryEnumerationMode.DIRECTORIES_FIRST
+     *
+     *  @see mx.utils.DirectoryEnumerationMode
+     */
+    public function get enumerationMode():String
+    {
+		return _enumerationMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set enumerationMode(value:String):void
+    {
+ 		_enumerationMode = value;
+   }
+
+    //----------------------------------
+    //  extensions
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the extensions property.
+	 */
+   	private var _extensions:Array /* of String */;
+
+    /**
+     *  An Array of extensions specifying which files
+     *  are included in the collection
+     *  If this property is set, for example,
+     *  to [ "htm", "html" ],
+     *  then only files with these extensions are included.
+     *
+     *
Extensions are considered case-insensitive
+     *  and the preceding dot is optional.
+     *  For example, specifying ".HTML"
+     *  is equivalent to specifying "html".

+     *
+     *
Directories are not subject to extension filtering,
+     *  even if they have names containing dots.

+     *
+     *
The enumerationMode and filterFunction
+     *  properties are also involved in determining which files
+     *  are included in the collection.
+     *  For example, if this property is [ ".htm", ".html" ],
+     *  an .html file will not be included if the
+     *  enumerationMode property is
+     *  DirectoryEnumerationMode.DIRECTORIES_ONLY,
+     *  or if the filterFunction returns false
+     *  for the file.

+     *
+     *
If this property is null, no extension filtering
+     *  occurs, and all files are included.
+     *  If this property is an empty Array, all extensions are filtered out
+     *  and no files with extensions are included.

+     *
+     *
You must call refresh() after setting
+     *  this property to change the collection.

+     *
+     *
Although this property affects which files are included,
+     *  it does not affect which File instances are in the
+     *  source property; it works
+     *  by changing the behavior of the fileFilterFunction()
+     *  that is applied to the source.

+     *
+     *  @default null
+     */
+    public function get extensions():Array /* of String */
+    {
+		return _extensions;
+    }
+
+    /**
+     *  @private
+     */
+    public function set extensions(value:Array /* of String */):void
+    {
+ 		_extensions = value;
+
+		extensionsSet = {};
+		for each (var s:String in extensions)
+		{
+			if (s.charAt(0) == ".")
+				s = s.substr(1);
+			extensionsSet[s.toLowerCase()] = true;
+		}
+   }
+
+    //----------------------------------
+    //  filterFunction
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the filterFunction property.
+	 */
+   	private var _filterFunction:Function;
+
+    /**
+     *  A callback Function that you can use to perform additional filtering,
+     *  after the enumerationMode and extensions
+     *  properties have been applied, to determine which files
+     *  and subdirectories are included in the collection.
+     *
+     *
This function must have the following signature:

+     *
+     *
function myFilterFunction(file:File):Boolean

+     *
+     *
This function should return true to include
+	 *  the specified file or subdirectory.

+     *
+     *
To ensure that every enumerated file and subdirectory is passed
+     *  to this function, the enumerationMode property must
+     *  not be DirectoryEnumerationMode.FILES_ONLY or
+     *  DirectoryEnumerationMode.DIRECTORIES_ONLY,
+     *  and the extensions property must be null.
+     *  Otherwise, these properties will cause pre-filtering to occur
+     *  before this filter function is called.

+     *
+     *
You must call refresh() after setting
+     *  this property to change the collection.

+     *
+     *  @default null
+     */
+    public function get filterFunction():Function
+    {
+		return _filterFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set filterFunction(value:Function):void
+    {
+		_filterFunction = value;
+   }
+
+    //----------------------------------
+    //  nameCompareFunction
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the nameCompareFunction property.
+	 */
+   	private var _nameCompareFunction:Function;
+
+    /**
+     *  A callback Function that you can use to change how file and subdirectory
+     *  names are compared in order to produce the sort order.
+     *
+     *
This function must have the following signature:

+     *
+     *
function myNameCompareFunction(name1:String, name2:String):int

+     *
+     *
It returns -1 if name1 should sort before
+     *  name2, 1 if name1 should
+     *  sort after name2, and 0 if the names
+     *  are the same.

+     *
+     *
If you do not set this property, this class performs
+     *  a case-insensitive, locale-dependent comparison of the two names,
+     *  by first calling the String method toLocaleLowerCase()
+     *  on each name and then comparing them with the <
+     *  and > operators.

+     *
+     *
If you have set enumerationMode to either
+     *  DirectoryEnumerationMode.FILES_FIRST or
+     *  DirectoryEnumerationMode.DIRECTORIES_FIRST,
+     *  then this method will be used to compare names only within
+     *  the separate groups of files and directories.

+     *
+     *  @default null
+     */
+    public function get nameCompareFunction():Function
+    {
+		return _nameCompareFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set nameCompareFunction(value:Function):void
+    {
+		_nameCompareFunction = value;
+    }
+
+    //----------------------------------
+    //  showHidden
+    //----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the showHidden property.
+	 */
+ 	private var _showHidden:Boolean = false;
+
+    /**
+     *  A flag that specifies whether files and directories
+     *  that the operating system considers hidden
+	 *  are included in the collection.
+     *  Set this property to true
+     *  to include hidden files and directories.
+     *
+     *  @default false
+     */
+    public function get showHidden():Boolean
+    {
+		return _showHidden;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showHidden(value:Boolean):void
+    {
+		_showHidden = value;
+    }
+
+    //----------------------------------
+    //  source
+    //----------------------------------
+
+	private var _source:Array /* of File */;
+
+    /**
+	 *  The source of data for the collection.
+	 *
+	 *
This class expects this property to be set to an Array
+	 *  of File instances representing the files and directories
+	 *  in a single file system directory.
+	 *  You can obtain such an Array by calling the
+	 *  listDirectory() or listDirectoryAsync()
+	 *  of the File class.

+     */
+    public function get source():Array /* of File */
+    {
+        return _source;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:Array /* of File */):void
+    {
+        _source = value;
+
+		_collection = new ArrayCollection(source);
+		_collection.filterFunction = fileFilterFunction
+		_collection.sort = new Sort();
+		_collection.sort.compareFunction = fileCompareFunction;
+		_collection.refresh();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Filters and sorts the source Array of File instances
+	 *  to produce the collection, as specified by the
+	 *  enumerationMode, extensions,
+	 *  filterFunction, nameCompareFunction,
+	 *  and showHidden properties.
+	 */
+	public function refresh():void
+	{
+		_collection.refresh();
+	}
+
+	/**
+	 *  The filter function that is actually applied to filter
+	 *  the source</code Array to produce the collection.
+	 *
+	 *
At the end of its processing, this method calls your
+	 *  filterFunction if one is specified.

+	 */
+	public function fileFilterFunction(file:File):Boolean
+	{
+		// Some files like C:\pagefile.sys throw exceptions
+		// if a labelFunction tries to access other properties
+		// like size, creationDate, or modificationDate.
+		// Fortunately, these seem to have their 'exists' property
+		// set to false.
+		if (!file.exists)
+			return false;
+
+		// Omit hidden files if showHidden is false.
+		// BUG WORKAROUND: Root directories like C:\ and D:\
+		// have their hidden property set to true.
+		// Ignore it and show them.
+		if (!showHidden && file.isHidden && file.parent)
+			return false;
+
+		// Omit all directories if "filesOnly"
+		// or all files if "directoriesOnly".
+		if (enumerationMode == DirectoryEnumerationMode.FILES_ONLY &&
+			file.isDirectory ||
+			enumerationMode == DirectoryEnumerationMode.DIRECTORIES_ONLY &&
+			!file.isDirectory)
+		{
+			return false;
+		}
+
+		// Now do extension-based filtering.
+		// Extension-filtering only occurs if the extensions property
+		// is non-null, and it only applies to files.
+		if (extensions && !file.isDirectory)
+		{
+			// If the file has no extension or that extension was not in
+			// the specified 'extensions' array, then filter out the file.
+			var extension:String = file.extension;
+			if (!extension || !extensionsSet[extension.toLowerCase()])
+				return false;
+		}
+
+		// Finally, do custom filtering.
+		return Boolean(filterFunction != null ? filterFunction(file) : true);
+	}
+
+	/**
+	 *  The comparison function that is actually applied to sort
+	 *  the source</code Array to produce the collection.
+	 *
+	 *
At the end of its processing, this method calls your
+	 *  nameCompareFunction if one is specified.

+	 */
+	public function fileCompareFunction(file1:File, file2:File,
+										fields:Array = null):int
+	{
+		if (file1.isDirectory && !file2.isDirectory)
+		{
+			if (enumerationMode == DirectoryEnumerationMode.DIRECTORIES_FIRST)
+				return -1;
+			if (enumerationMode == DirectoryEnumerationMode.FILES_FIRST)
+				return 1;
+		}
+
+		if (!file1.isDirectory && file2.isDirectory)
+		{
+			if (enumerationMode == DirectoryEnumerationMode.DIRECTORIES_FIRST)
+				return 1;
+			if (enumerationMode == DirectoryEnumerationMode.FILES_FIRST)
+				return -1;
+		}
+
+		return nameCompareFunction != null ?
+			   nameCompareFunction(file1.name, file2.name) :
+			   defaultNameCompareFunction(file1.name, file2.name);
+	}
+
+	/**
+	 *  Performs a case-insensitive, locale-dependent comparison
+	 *  of two file or directory names, using the String method
+	 *  toLocaleLowerCase().
+	 */
+	protected function defaultNameCompareFunction(name1:String, name2:String):int
+	{
+		name1 = name1.toLocaleLowerCase();
+		name2 = name2.toLocaleLowerCase();
+
+		if (name1 < name2)
+			return -1;
+
+		if (name1 > name2)
+			return 1;
+
+		return 0;
+	}
+}
+
+}