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

--- frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as
+++ frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as
@@ -0,0 +1,1655 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-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.controls.dataGridClasses
+{
+
+import flash.display.DisplayObject;
+import flash.events.Event;
+import flash.utils.Dictionary;
+import mx.controls.DataGrid;
+import mx.controls.TextInput;
+import mx.controls.listClasses.IListItemRenderer;
+import mx.core.ClassFactory;
+import mx.core.EmbeddedFont;
+import mx.core.EmbeddedFontRegistry;
+import mx.core.IEmbeddedFontRegistry;
+import mx.core.IFactory;
+import mx.core.IFlexModuleFactory;
+import mx.core.IIMESupport;
+import mx.core.mx_internal;
+import mx.core.Singleton;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+import mx.utils.StringUtil;
+import mx.core.ContextualClassFactory;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../../styles/metadata/TextStyles.as";
+
+/**
+ *  The Background color of the column.
+ *  The default value is undefined, which means it uses the value of the
+ *  backgroundColor style of the associated DataGrid control.
+ *  The default value for the DataGrid control is 0xFFFFFF.
+ */
+[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  The name of a CSS style declaration for controlling other aspects of
+ *  the appearance of the column headers.
+ *  The default value is undefined, which means it uses the value of the
+ *  headerStyleName style of the associated DataGrid control.
+ *  The default value for the DataGrid control is
+ *  ".dataGridStyles".
+ */
+[Style(name="headerStyleName", type="String", inherit="no")]
+
+/**
+ *  The number of pixels between the container's left border and its content
+ *  area.
+ *  @default 0
+ */
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The number of pixels between the container's right border and its content
+ *  area.
+ *  @default 0
+ */
+[Style(name="paddingRight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The DataGridColumn class describes a column in a DataGrid control.
+ *  There is one DataGridColumn per displayable column, even if a column
+ *  is hidden or off-screen.
+ *  The data provider items of a DataGrid control
+ *  can contain properties that are not displayed
+ *  and, therefore, do not need a DataGridColumn.
+ *  A DataGridColumn allows specification of the color and font of the text
+ *  in a column; what kind of component displays the data for the column;
+ *  whether the column is editable, sortable, or resizable;
+ *  and the text for the column header.
+ *
+ *
Notes:

+ *
A DataGridColumn only holds information about a column;
+ *  it is not the parent of the item renderers in the column.

+ *
If you specify a DataGridColumn class without a dataField
+ *  property, you must specify a sortCompareFunction
+ *  property. Otherwise, sort operations may cause run-time errors.

+ *

+ *
+ *  @mxml
+ *
+ *
You use the <mx.DataGridColumn> tag to configure a column
+ *  of a DataGrid control.
+ *  You specify the <mx.DataGridColumn> tag as a child
+ *  of the columns property in MXML.
+ *  The <mx.DataGridColumn> tag inherits all of the
+ *  tag attributes of its superclass, and adds the following tag attributes:

+ *
+ *

+ *  <mx:DataGridColumn
+ *  Properties
+ *    dataField="No default"
+ *    dataTipField="No default"
+ *    dataTipFunction="No default"
+ *    editable="true|false"
+ *    editorDataField="text"
+ *    editorHeightOffset="0"
+ *    editorUsesEnterKey="false|true"
+ *    editorWidthOffset="0"
+ *    editorXOffset="0"
+ *    editorYOffset="0"
+ *    headerRenderer="DataGridItemRenderer"
+ *    headerText="No default"
+ *    headerWordWrap="undefined"
+ *    imeMode="null"
+ *    itemEditor="TextInput"
+ *    itemRenderer="DataGridItemRenderer"
+ *    labelFunction="No default"
+ *    minWidth="20"
+ *    rendererIsEditor="false|true"
+ *    resizable="true|false"
+ *    showDataTips="false|true"
+ *    sortable="true|false"
+ *    sortCompareFunction="No default"
+ *    sortDescending="false|true"
+ *    visible="true|false"
+ *    width="100"
+ *    wordWrap="false|true"
+ *
+ *  Styles
+ *    backgroundColor="0xFFFFFF"
+ *    color="No default."
+ *    disabledColor="0xAAB3B3"
+ *    fontAntiAliasType="advanced"
+ *    fontFamily="No default"
+ *    fontGridFitType="pixel"
+ *    fontSharpness="0"
+ *    fontSize="No default"
+ *    fontStyle="normal|italic"
+ *    fontThickness="0"
+ *    fontWeight="normal|bold"
+ *    headerStyleName="No default"
+ *    paddingLeft="0"
+ *    paddingRight="0"
+ *    textAlign="right|center|left"
+ *    textDecoration="none|underline"
+ *    textIndent="0"
+ *  />
+ *

+ *

+ *
+ *  @see mx.controls.DataGrid
+ *
+ *  @see mx.styles.CSSStyleDeclaration
+ */
+public class DataGridColumn extends CSSStyleDeclaration implements IIMESupport
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  embeddedFontRegistry
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the embeddedFontRegistry property.
+     *  This gets initialized on first access,
+     *  not at static initialization time, in order to ensure
+     *  that the Singleton registry has already been initialized.
+     */
+    private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
+
+    /**
+     *  @private
+     *  A reference to the embedded font registry.
+     *  Single registry in the system.
+     *  Used to look up the moduleFactory of a font.
+     */
+    private static function get embeddedFontRegistry():IEmbeddedFontRegistry
+    {
+        if (!_embeddedFontRegistry)
+        {
+            _embeddedFontRegistry = IEmbeddedFontRegistry(
+                Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
+        }
+
+        return _embeddedFontRegistry;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param columnName The name of the field in the data provider
+     *  associated with the column, and the text for the header cell of this
+     *  column.  This is equivalent to setting the dataField
+     *  and headerText properties.
+     */
+    public function DataGridColumn(columnName:String = null)
+    {
+        super();
+
+        if (columnName)
+        {
+            dataField = columnName;
+            headerText = columnName;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  The DataGrid that owns this column.
+     */
+    mx_internal var owner:DataGridBase;
+
+    /**
+     *  @private
+     */
+    mx_internal var explicitWidth:Number;
+
+    /**
+     *  @private
+     * Holds the last recorded value of the module factory used to create the font.
+     */
+    private var oldEmbeddedFontContext:IFlexModuleFactory = null;
+
+    /**
+     *  @private
+     *
+     *  true if font properties do not need to be set.
+     */
+    private var fontPropertiesSet:Boolean = false;
+
+    /**
+     *  @private
+     * True if createInFontContext has been called.
+     */
+    private var hasFontContextBeenSaved:Boolean = false;
+
+    /**
+     * @private
+     *
+     * Cache last value of embedded font.
+     */
+    private var cachedEmbeddedFont:EmbeddedFont = null;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  sortDescending
+    //----------------------------------
+
+    /**
+     *  Indicates whether the column sort is
+     *  in ascending order, false,
+     *  or descending order, true.
+     *
+     *
Setting this property does not start a sort; it only sets the sort direction.
+     *  Click on the column header to perform the sort.

+     *
+     *  @default false;
+     */
+    public var sortDescending:Boolean = false;
+
+    //----------------------------------
+    //  itemRenderer
+    //----------------------------------
+    /**
+     *  @private
+     *  Storage for the itemRenderer property.
+     */
+    private var _itemRenderer:IFactory;
+
+    [Bindable("itemRendererChanged")]
+    [Inspectable(category="Other")]
+
+    /**
+     *  The class factory for item renderer instances that display the
+     *  data for each item in the column.
+     *  You can specify a drop-in item renderer,
+     *  an inline item renderer, or a custom item renderer component as the
+     *  value of this property.
+     *
+     *
The default item renderer is the DataGridItemRenderer class,
+     *  which displays the item data as text.

+     */
+    public function get itemRenderer():IFactory
+    {
+        return _itemRenderer;
+    }
+
+    /**
+     *  @private
+     */
+    public function set itemRenderer(value:IFactory):void
+    {
+        _itemRenderer = value;
+
+        // this is expensive... but unless set after init (not recommended), ok.
+        if (owner)
+        {
+            owner.invalidateList();
+            owner.columnRendererChanged(this);
+        }
+
+        dispatchEvent(new Event("itemRendererChanged"));
+    }
+
+    //----------------------------------
+    //  colNum
+    //----------------------------------
+
+    /**
+     *  @private
+     *  The zero-based index of this column as it is displayed in the grid.
+     *  It is not related to the structure of the data being displayed.
+     *  In MXML, the default order of the columns is the order of the
+     *  mx:DataGridColumn tags.
+     */
+    mx_internal var colNum:Number;
+
+    //----------------------------------
+    //  dataField
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="")]
+
+    /**
+     *  The name of the field or property in the data provider item associated
+     *  with the column.
+     *  Each DataGridColumn control
+     *  requires this property and/or the labelFunction property
+     *  to be set in order to calculate the displayable text for the item
+     *  renderer.
+     *  If the dataField
+     *  and labelFunction properties are set,
+     *  the data is displayed using the labelFunction and sorted
+     *  using the dataField.  If the property named in the
+     *  dataField does not exist, the
+     *  sortCompareFunction must be set for the sort to work
+     *  correctly.
+     *
+     *
This value of this property is not necessarily the String that
+     *  is displayed in the column header.  This property is
+     *  used only to access the data in the data provider.
+     *  For more information, see the headerText property.

+     *
+     *  @see #headerText
+     */
+    public var dataField:String;
+
+    //----------------------------------
+    //  dataTipField
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the dataTipField property.
+     */
+    private var _dataTipField:String;
+
+    [Bindable("dataTipFieldChanged")]
+    [Inspectable(category="Advanced", defaultValue="label")]
+
+    /**
+     *  The name of the field in the data provider to display as the datatip.
+     *  By default, the DataGrid control looks for a property named
+     *  label on each data provider item and displays it.
+     *  However, if the data provider does not contain a label
+     *  property, you can set the dataTipField property to
+     *  specify a different property.
+     *  For example, you could set the value to "FullName" when a user views a
+     *  set of people's names included from a database.
+     */
+    public function get dataTipField():String
+    {
+        return _dataTipField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataTipField(value:String):void
+    {
+        _dataTipField = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+
+        dispatchEvent(new Event("dataTipChanged"));
+    }
+
+    //----------------------------------
+    //  dataTipFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the dataTipFunction property.
+     */
+    private var _dataTipFunction:Function;
+
+    [Bindable("dataTipFunctionChanged")]
+    [Inspectable(category="Advanced")]
+
+    /**
+     *  Specifies a callback function to run on each item of the data provider
+     *  to determine its dataTip.
+     *  This property is used by the itemToDataTip method.
+     *
+     *
By default the control looks for a property named label
+     *  on each data provider item and displays it as its dataTip.
+     *  However, some data providers do not have a label property
+     *  nor do they have another property that you can use for displaying data
+     *  in the rows.
+     *  For example, you might have a data provider that contains a lastName
+     *  and firstName fields, but you want to display full names as the dataTip.
+     *  You can specify a function to the dataTipFunction property
+     *  that returns a single String containing the value of both fields. You
+     *  can also use the dataTipFunction property for handling
+     *  formatting and localization.

+     *
+     *
The function must take a single Object parameter, containing the
+     *  data provider element, and return a String.

+     */
+    public function get dataTipFunction():Function
+    {
+        return _dataTipFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataTipFunction(value:Function):void
+    {
+        _dataTipFunction = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+
+        dispatchEvent(new Event("labelFunctionChanged"));
+    }
+
+    //----------------------------------
+    //  draggable
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A flag that indicates whether the user is allowed to drag
+     *  the column to a new position
+     *  If true, the user can drag the
+     *  the column headers to a new position
+     *
+     *  @default true
+     */
+    public var draggable:Boolean = true;
+
+    //----------------------------------
+    //  editable
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A flag that indicates whether the items in the column are editable.
+     *  If true, and the DataGrid's editable
+     *  property is also true, the items in a column are
+     *  editable and can be individually edited
+     *  by clicking on an item or by navigating to the item by using the
+     *  Tab and Arrow keys.
+     *
+     *  @default true
+     */
+    public var editable:Boolean = true;
+
+    //----------------------------------
+    //  itemEditor
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A class factory for the instances of the item editor to use for the
+     *  column, when it is editable.
+     *
+     *  @default new ClassFactory(mx.controls.TextInput)
+     */
+    public var itemEditor:IFactory = new ClassFactory(TextInput);
+
+    //----------------------------------
+    //  editorDataField
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  The name of the property of the item editor that contains the new
+     *  data for the list item.
+     *  For example, the default itemEditor is
+     *  TextInput, so the default value of the editorDataField
+     *  property is "text", which specifies the
+     *  text property of the TextInput control.
+     *
+     *  @default "text"
+     */
+    public var editorDataField:String = "text";
+
+    //----------------------------------
+    //  editorHeightOffset
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  The height of the item editor, in pixels, relative to the size of the
+     *  item renderer.  This property can be used to make the editor overlap
+     *  the item renderer by a few pixels to compensate for a border around the
+     *  editor.
+     *  Note that changing these values while the editor is displayed
+     *  will have no effect on the current editor, but will affect the next
+     *  item renderer that opens an editor.
+     *
+     *  @default 0
+     */
+    public var editorHeightOffset:Number = 0;
+
+    //----------------------------------
+    //  editorWidthOffset
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  The width of the item editor, in pixels, relative to the size of the
+     *  item renderer.  This property can be used to make the editor overlap
+     *  the item renderer by a few pixels to compensate for a border around the
+     *  editor.
+     *  Note that changing these values while the editor is displayed
+     *  will have no effect on the current editor, but will affect the next
+     *  item renderer that opens an editor.
+     *
+     *  @default 0
+     */
+    public var editorWidthOffset:Number = 0;
+
+    //----------------------------------
+    //  editorXOffset
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  The x location of the upper-left corner of the item editor,
+     *  in pixels, relative to the upper-left corner of the item.
+     *  This property can be used to make the editor overlap
+     *  the item renderer by a few pixels to compensate for a border around the
+     *  editor.
+     *  Note that changing these values while the editor is displayed
+     *  will have no effect on the current editor, but will affect the next
+     *  item renderer that opens an editor.
+     *
+     *  @default 0
+     */
+    public var editorXOffset:Number = 0;
+
+    //----------------------------------
+    //  editorYOffset
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  The y location of the upper-left corner of the item editor,
+     *  in pixels, relative to the upper-left corner of the item.
+     *  This property can be used to make the editor overlap
+     *  the item renderer by a few pixels to compensate for a border around the
+     *  editor.
+     *  Note that changing these values while the editor is displayed
+     *  will have no effect on the current editor, but will affect the next
+     *  item renderer that opens an editor.
+     *
+     *  @default 0
+     */
+    public var editorYOffset:Number = 0;
+
+    //----------------------------------
+    //  editorUsesEnterKey
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  A flag that indicates whether the item editor uses Enter key.
+     *  If true the item editor uses the Enter key and the
+     *  DataGrid will not look for the Enter key and move the editor in
+     *  response.
+     *  Note that changing this value while the editor is displayed
+     *  will have no effect on the current editor, but will affect the next
+     *  item renderer that opens an editor.
+     *
+     *  @default false.
+     */
+    public var editorUsesEnterKey:Boolean = false;
+
+    //----------------------------------
+    //  headerRenderer
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the headerRenderer property.
+     */
+    private var _headerRenderer:IFactory;
+
+    [Bindable("headerRendererChanged")]
+    [Inspectable(category="Other")]
+
+    /**
+     *  The class factory for item renderer instances that display the
+     *  column header for the column.
+     *  You can specify a drop-in item renderer,
+     *  an inline item renderer, or a custom item renderer component as the
+     *  value of this property.
+     *
+     *
The default item renderer is the DataGridItemRenderer class,
+     *  which displays the item data as text.

+     */
+    public function get headerRenderer():IFactory
+    {
+        return _headerRenderer;
+    }
+
+    /**
+     *  @private
+     */
+    public function set headerRenderer(value:IFactory):void
+    {
+        _headerRenderer = value;
+
+        // rebuild the headers
+        if (owner)
+        {
+            owner.invalidateList();
+            owner.columnRendererChanged(this);
+        }
+
+        dispatchEvent(new Event("headerRendererChanged"));
+    }
+
+    //----------------------------------
+    //  headerText
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the headerText property.
+     */
+    private var _headerText:String;
+
+    [Bindable("headerTextChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Text for the header of this column. By default, the DataGrid
+     *  control uses the value of the dataField property
+     *  as the header text.
+     */
+    public function get headerText():String
+    {
+        return (_headerText != null) ? _headerText : dataField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set headerText(value:String):void
+    {
+        _headerText = value;
+
+        if (owner)
+            owner.invalidateList();
+
+        dispatchEvent(new Event("headerTextChanged"));
+    }
+
+    //----------------------------------
+    //  headerWordWrap
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the headerWordWrap property.
+     */
+    private var _headerWordWrap:*;
+
+    [Inspectable(category="Advanced")]
+
+    /**
+     *  A flag that indicates whether text in the header will be
+     *  word wrapped if it doesn't fit on one line.
+     *  If undefined, the DataGrid control's wordWrap property
+     *  is used.
+     *
+     *  @default undefined
+     */
+    public function get headerWordWrap():*
+    {
+        return _headerWordWrap;
+    }
+
+    /**
+     *  @private
+     */
+    public function set headerWordWrap(value:*):void
+    {
+        _headerWordWrap = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+    }
+
+    //----------------------------------
+    //  imeMode
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the imeMode property.
+     */
+    private var _imeMode:String;
+
+    [Inspectable(category="Other")]
+
+    /**
+     *  Specifies the IME (input method editor) mode.
+     *  The IME enables users to enter text in Chinese, Japanese, and Korean.
+     *  Flex sets the IME mode when the itemFocusIn event occurs,
+     *  and sets it back
+     *  to the previous value when the itemFocusOut event occurs.
+     *  The flash.system.IMEConversionMode class defines constants for
+     *  the valid values for this property.
+     *
+     *
The default value is null, in which case it uses the value of the
+     *  DataGrid control's imeMode property.

+     *
+     *  @see flash.system.IMEConversionMode
+     */
+    public function get imeMode():String
+    {
+        return _imeMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set imeMode(value:String):void
+    {
+        _imeMode = value;
+    }
+
+    //----------------------------------
+    //  rendererIsEditor
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  A flag that indicates that the item renderer is also an item editor.
+     *  If this property is true, Flex
+     *  ignores the itemEditor property and uses the item
+     *  renderer for that item as the editor.
+     *
+     *  @default false
+     */
+    public var rendererIsEditor:Boolean = false;
+
+    //----------------------------------
+    //  labelFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the labelFunction property.
+     */
+    private var _labelFunction:Function;
+
+    [Bindable("labelFunctionChanged")]
+    [Inspectable(category="Other")]
+
+    /**
+     *  A function that determines the text to display in this column.  By default
+     *  the column displays the text for the field in the data that matches the
+     *  column name.  However, sometimes you want to display text based on
+     *  more than one field in the data, or display something that does not
+     *  have the format that you want.
+     *  In such a case you specify a callback function using labelFunction.
+     *
+     *
For the DataGrid control, the method signature has the following form:

+     *
+     *
labelFunction(item:Object, column:DataGridColumn):String

+     *
+     *
Where item contains the DataGrid item object, and
+     *  column specifies the DataGrid column.

+     *
+     *
A callback function might concatenate the firstName and
+     *  lastName fields in the data, or do some custom formatting on a Date,
+     *  or convert a number for the month into the string for the month.

+     */
+    public function get labelFunction():Function
+    {
+        return _labelFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set labelFunction(value:Function):void
+    {
+        _labelFunction = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+
+        dispatchEvent(new Event("labelFunctionChanged"));
+    }
+
+    //----------------------------------
+    //  minWidth
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the minWidth property.
+     */
+    private var _minWidth:Number = 20;
+
+    [Bindable("minWidthChanged")]
+    [Inspectable(category="General", defaultValue="100")]
+
+    /**
+     *  The minimum width of the column.
+     *  @default 20.
+     */
+    public function get minWidth():Number
+    {
+        return _minWidth;
+    }
+
+    /**
+     *  @private
+     */
+    public function set minWidth(value:Number):void
+    {
+        _minWidth = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+
+        if (_width < value)
+            _width = value;
+
+        dispatchEvent(new Event("minWidthChanged"));
+    }
+
+    //----------------------------------
+    //  nullItemRenderer
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the nullItemRenderer property.
+     */
+    private var _nullItemRenderer:IFactory;
+
+    [Bindable("nullItemRendererChanged")]
+    [Inspectable(category="Other")]
+
+    /**
+     *  The class factory for item renderer instances that display the
+     *  data for each item in the column.
+     *  You can specify a drop-in item renderer,
+     *  an inline item renderer, or a custom item renderer component as the
+     *  value of this property.
+     *
+     *
The default item renderer is the DataGridItemRenderer class,
+     *  which displays the item data as text.

+     */
+    public function get nullItemRenderer():IFactory
+    {
+        return _nullItemRenderer;
+    }
+
+    /**
+     *  @private
+     */
+    public function set nullItemRenderer(value:IFactory):void
+    {
+        _nullItemRenderer = value;
+
+        // this is expensive... but unless set after init (not recommended), ok.
+        if (owner)
+        {
+            owner.invalidateList();
+            owner.columnRendererChanged(this);
+        }
+
+        dispatchEvent(new Event("nullItemRendererChanged"));
+    }
+
+    //----------------------------------
+    //  resizable
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A flag that indicates whether the user is allowed to resize
+     *  the width of the column.
+     *  If true, the user can drag the grid lines between
+     *  the column headers to resize
+     *  the column.
+     *
+     *  @default true
+     */
+    public var resizable:Boolean = true;
+
+    //----------------------------------
+    //  showDataTips
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the showDataTips property.
+     */
+    private var _showDataTips:*;
+
+    [Inspectable(category="Advanced")]
+
+    /**
+     *  A flag that indicates whether the datatips are shown in the column.
+     *  If true, datatips are displayed for text in the rows. Datatips
+     *  are tooltips designed to show the text that is too long for the row.
+     *
+     *  @default false
+     */
+    public function get showDataTips():*
+    {
+        return _showDataTips;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showDataTips(value:*):void
+    {
+        _showDataTips = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+    }
+
+    //----------------------------------
+    //  sortable
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     *  A flag that indicates whether the user can click on the
+     *  header of this column to sort the data provider.
+     *  If this property and the DataGrid sortableColumns property
+     *  are both true, the DataGrid control dispatches a
+     *  headerRelease event when a user releases the mouse button
+     *  on this column's header.
+     *  If no other handler calls the preventDefault() method on
+     *  the headerRelease event, the dataField
+     *  property or sortCompareFunction in the column is used
+     *  to reorder the items in the dataProvider.
+     *
+     *  @default true
+     */
+    public var sortable:Boolean = true;
+
+    //----------------------------------
+    //  sortCompareFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the sortCompareFunction property.
+     */
+    private var _sortCompareFunction:Function;
+
+    [Bindable("sortCompareFunctionChanged")]
+    [Inspectable(category="Advanced")]
+
+    /**
+     *
+     *  A callback function that gets called when sorting the data in
+     *  the column.  If this property is not specified, the sort tries
+     *  to use a basic string or number sort on the data.
+     *  If the data is not a string or number or if the dataField
+     *  property is not a valid property of the data provider, the sort does
+     *  not work or will generate an exception.
+     *  If you specify a value of the labelFunction property,
+     *  you must also provide a function to the sortCompareFunction property,
+     *  unless sorting is not allowed on this column.
+     *
+     *
The DataGrid control uses this function to sort the elements of the data
+     *  provider collection. The function signature of
+     *  the callback function takes two parameters and have the following form:

+     *
+     *
mySortCompareFunction(obj1:Object, obj2:Object):int

+     *
+     *
obj1 — A data element to compare.

+     *
+     *
obj2 — Another data element to compare with obj1.

+     *
+     *
The function should return a value based on the comparison
+     *  of the objects:

+     *

+     *
-1 if obj1 should appear before obj2 in ascending order.

+     *
0 if obj1 = obj2.

+     *
1 if obj1 should appear after obj2 in ascending order.

+     *

+     *
+     *
Note: The obj1 and
+     *  obj2 parameters are entire data provider elements and not
+     *  just the data for the item.

+     *
+     *  @default null
+     */
+    public function get sortCompareFunction():Function
+    {
+        return _sortCompareFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set sortCompareFunction(value:Function):void
+    {
+        _sortCompareFunction = value;
+
+        dispatchEvent(new Event("sortCompareFunctionChanged"));
+    }
+
+    //----------------------------------
+    //  visible
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the visible property.
+     */
+    private var _visible:Boolean = true;
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  A flag that indicates whethe the column is visible.
+     *  If true, the column is visible.
+     *
+     *  @default true
+     */
+    public function get visible():Boolean
+    {
+        return _visible;
+    }
+
+    /**
+     *  @private
+     */
+    public function set visible(value:Boolean):void
+    {
+        if (_visible != value)
+        {
+            _visible = value;
+
+            if (value)
+                newlyVisible = true;
+
+            if (owner)
+            {
+                owner.columnsInvalid = true;
+
+                owner.invalidateSize();
+                owner.invalidateList();
+            }
+        }
+    }
+
+    mx_internal var newlyVisible:Boolean = false;
+
+    //----------------------------------
+    //  width
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the width property.
+     */
+    private var _width:Number = 100;
+
+    // preferred width is the number we should use when measuring
+    // regular width will be changed if we shrink columns to fit.
+    mx_internal var preferredWidth:Number = 100;
+
+    [Bindable("widthChanged")]
+    [Inspectable(category="General", defaultValue="100")]
+
+    /**
+     *  The width of the column, in pixels.
+     *  If the DataGrid's horizontalScrollPolicy property
+     *  is false, all visible columns must fit in the displayable
+     *  area, and the DataGrid will not always honor the width of
+     *  the columns if the total width of the columns is too
+     *  small or too large for the displayable area.
+     *
+     *  @default 100
+     */
+    public function get width():Number
+    {
+        return _width;
+    }
+
+    /**
+     *  @private
+     */
+    public function set width(value:Number):void
+    {
+        // remove any queued equal spacing commands
+        explicitWidth = value;
+        // use this value for future measurements
+        preferredWidth = value;
+        if (owner != null)
+        {
+            // if we aren't resizing as part of grid layout, resize it's column
+            var oldVal:Boolean = resizable;
+            // anchor this column to not accept any overflow width for accurate sizing
+            resizable = false;
+            owner.resizeColumn(colNum, value);
+            resizable = oldVal;
+        }
+        else
+        {
+            // otherwise, just store the size
+            _width = value;
+        }
+        dispatchEvent(new Event("widthChanged"));
+    }
+
+    /**
+     *  @private
+     *  Internal function to allow the DataGrid to set the width of the
+     *  column without locking it as an explicitWidth
+     */
+    mx_internal function setWidth(value:Number):void
+    {
+        _width = value;
+    }
+
+    //----------------------------------
+    //  wordWrap
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the wordWrap property.
+     */
+    private var _wordWrap:*;
+
+    [Inspectable(category="Advanced")]
+
+    /**
+     *  A flag that indicates whether the text in a row of this column
+     *  is word wrapped if it doesn't fit on one line.
+     *  If undefined, the DataGrid control's wordWrap property
+     *  is used.
+     *
+     *
Only takes effect if the DataGrid.variableRowHeight property is also
+     *  true.

+     *
+     *  @default undefined
+     */
+    public function get wordWrap():*
+    {
+        return _wordWrap;
+    }
+
+    /**
+     *  @private
+     */
+    public function set wordWrap(value:*):void
+    {
+        _wordWrap = value;
+
+        if (owner)
+        {
+            owner.invalidateList();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override mx_internal function addStyleToProtoChain(
+                                chain:Object, target:DisplayObject, filterMap:Object = null):Object
+    {
+        var parentGrid:DataGridBase = owner;
+        var item:IListItemRenderer = IListItemRenderer(target);
+
+        // If there is a DataGridColumn.styleName property,
+        // add it to the head of the proto chain.
+        // (The fact that styles can be set on both DataGridColumn
+        // and DataGridColumn.styleName seems a bit redundant,
+        // but both are supported for backward compatibility.)
+        var styleName:Object = styleName;
+        if (styleName)
+        {
+            if (styleName is String)
+            {
+                styleName =
+                    StyleManager.getStyleDeclaration("." + styleName);
+            }
+
+            if (styleName is CSSStyleDeclaration)
+                chain = styleName.addStyleToProtoChain(chain, target);
+        }
+
+        chain = super.addStyleToProtoChain(chain, target);
+
+        // If the target data is a DataGridColumn and has a data
+        // field in its data, then it is a header so add the
+        // DataGrid.headerStyleName object to the head of the proto chain.
+        if (item.data && (item.data is DataGridColumn))
+        {
+            var s:Object;
+
+            var headerStyleName:Object =
+                parentGrid.getStyle("headerStyleName");
+            if (headerStyleName)
+            {
+                if (headerStyleName is String)
+                {
+                    headerStyleName =
+                        StyleManager.getStyleDeclaration("." + headerStyleName);
+                }
+
+                if (headerStyleName is CSSStyleDeclaration)
+                    chain = headerStyleName.addStyleToProtoChain(chain, target);
+            }
+
+            headerStyleName = getStyle("headerStyleName");
+            if (headerStyleName)
+            {
+                if (headerStyleName is String)
+                {
+                    headerStyleName =
+                        StyleManager.getStyleDeclaration("." + headerStyleName);
+                }
+
+                if (headerStyleName is CSSStyleDeclaration)
+                    chain = headerStyleName.addStyleToProtoChain(chain, target);
+            }
+        }
+
+        // save the current font context
+        if (!fontPropertiesSet)
+        {
+            fontPropertiesSet = true;
+            saveFontContext(owner ? owner.moduleFactory : null);
+        }
+
+        return chain;
+    }
+
+    /**
+     *  @private
+     */
+    override public function setStyle(styleProp:String, value:*):void
+    {
+        fontPropertiesSet = false;
+
+        var oldValue:Object = getStyle(styleProp);
+        var regenerate:Boolean = false;
+
+        // If this DataGridColumn didn't previously have a factory, defaultFactory, or
+        // overrides object, then this DataGridColumn hasn't been added to the item
+        // renderers proto chains.  In that case, we need to regenerate all the item
+        // renderers proto chains.
+        if (factory == null &&
+            defaultFactory == null &&
+            !overrides &&
+            (oldValue !== value)) // must be !==
+        {
+            regenerate = true;
+        }
+
+        super.mx_internal::setStyle(styleProp, value);
+
+        // The default implementation of setStyle won't always regenerate
+        // the proto chain when headerStyleName is set, and we need to make sure
+        // that they are regenerated
+        if (styleProp == "headerStyleName")
+        {
+            if (owner)
+            {
+                owner.regenerateStyleCache(true);
+                owner.notifyStyleChangeInChildren("headerStyleName", true);
+            }
+            return;
+        }
+
+        if (owner)
+        {
+            if (regenerate)
+            {
+                owner.regenerateStyleCache(true);
+            }
+
+            if (hasFontContextChanged(owner.moduleFactory))
+            {
+                owner.columnRendererChanged(this);
+            }
+
+            owner.invalidateList();
+        }
+
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns the String that the item renderer displays for the given data object.
+     *  If the DataGridColumn or its DataGrid control
+     *  has a non-null labelFunction
+     *  property, it applies the function to the data object.
+     *  Otherwise, the method extracts the contents of the field specified by the
+     *  dataField property, or gets the string value of the data object.
+     *  If the method cannot convert the parameter to a String, it returns a
+     *  single space.
+     *
+     *  @param data Object to be rendered.
+     *
+     *  @return Displayable String based on the data.
+     */
+    public function itemToLabel(data:Object):String
+    {
+        if (!data)
+            return " ";
+
+        if (labelFunction != null)
+            return labelFunction(data, this);
+
+        if (owner.labelFunction != null)
+            return owner.labelFunction(data, this);
+
+        if (typeof(data) == "object" || typeof(data) == "xml")
+        {
+            try
+            {
+                data = data[dataField];
+            }
+            catch(e:Error)
+            {
+                data = null;
+            }
+        }
+
+        if (data is String)
+            return String(data);
+
+        try
+        {
+            return data.toString();
+        }
+        catch(e:Error)
+        {
+        }
+
+        return " ";
+    }
+
+    /**
+     *  Returns a String that the item renderer displays as the datatip for the given data object,
+     *  based on the dataTipField and dataTipFunction properties.
+     *  If the method cannot convert the parameter to a String, it returns a
+     *  single space.
+     *
+     *
This method is for use by developers who are creating subclasses
+     *  of the DataGridColumn class.
+     *  It is not for use by application developers.

+     *
+     *  @param data Object to be rendered.
+     *
+     *  @return Displayable String based on the data.
+     */
+    public function itemToDataTip(data:Object):String
+    {
+        if (dataTipFunction != null)
+            return dataTipFunction(data);
+
+        if (owner.dataTipFunction != null)
+            return owner.dataTipFunction(data);
+
+        if (typeof(data) == "object" || typeof(data) == "xml")
+        {
+            var field:String = dataTipField;
+            if (!field)
+                field = owner.dataTipField;
+            try
+            {
+                if (data[field] != null)
+                    data = data[field];
+                else if (data[dataField] != null)
+                    data = data[dataField];
+            }
+            catch(e:Error)
+            {
+                data = null;
+            }
+        }
+
+        if (data is String)
+            return String(data);
+
+        try
+        {
+            return data.toString();
+        }
+        catch(e:Error)
+        {
+        }
+
+        return " ";
+    }
+
+    /**
+     *  Return the appropriate factory, using the default factory if none specified.
+     *
+     *  @param forHeader true if this is a header renderer.
+     *
+     *  @param data The data to be presented by the item renderer.
+     *
+     *  @return if data is null, the default item renderer,
+     *  otherwis it returns the custom item renderer.
+     */
+    public function getItemRendererFactory(forHeader:Boolean, data:Object):IFactory
+    {
+        if (forHeader)
+            return replaceItemRendererFactory(headerRenderer);
+
+        if (!data)
+            return replaceItemRendererFactory(nullItemRenderer);
+
+        return replaceItemRendererFactory(itemRenderer);
+    }
+
+    /**
+     * @private
+     *
+     * This methods does two things:
+     *
+     * 1. If the column uses styles that require an embedded font and the column has no renderer,
+     *    then use the owner's item render, so we can replace it.
+     * 2. If the column uses styles that require an embedded font, then replace
+     *    the existing class factory with a ContextualClassFactory so the item can
+     *    be created in the correct context.
+     */
+    private function replaceItemRendererFactory(rendererFactory:IFactory):IFactory
+    {
+        // No use of embedded font so just return
+        if (oldEmbeddedFontContext == null)
+            return rendererFactory;
+
+        // Using an embedded font, but no local item renderer, so
+        // grab the owner's renderer and see if we can convert
+        // it to a ContextualClassFactory.
+        if (rendererFactory == null && owner != null)
+            rendererFactory = owner.itemRenderer;
+
+        if (rendererFactory is ClassFactory)
+            return new ContextualClassFactory(ClassFactory(rendererFactory).generator, oldEmbeddedFontContext);
+
+        return rendererFactory;
+    }
+
+    mx_internal function getMeasuringRenderer(forHeader:Boolean, data:Object):IListItemRenderer
+    {
+        var factory:IFactory = getItemRendererFactory(forHeader, data);
+        if (!factory)
+            factory = owner.itemRenderer;
+
+        if (!measuringObjects)
+            measuringObjects = new Dictionary(false);
+
+        var item:IListItemRenderer = measuringObjects[factory];
+        if (!item)
+        {
+            item = factory.newInstance();
+            item.visible = false;
+            item.styleName = this;
+            measuringObjects[factory] = item;
+        }
+
+        return item;
+    }
+
+    /**
+     * @private
+     *
+     * Get the embedded font for a set of font attributes.
+     */
+    mx_internal function getEmbeddedFont(fontName:String, bold:Boolean, italic:Boolean):EmbeddedFont
+    {
+        // Check if we can reuse a cached value.
+        if (cachedEmbeddedFont)
+        {
+            if (cachedEmbeddedFont.fontName == fontName &&
+                cachedEmbeddedFont.fontStyle == EmbeddedFontRegistry.getFontStyle(bold, italic))
+            {
+                return cachedEmbeddedFont;
+            }
+        }
+
+        cachedEmbeddedFont = new EmbeddedFont(fontName, bold, italic);
+
+        return cachedEmbeddedFont;
+    }
+
+    /**
+     * @private
+     *
+     * Save the current font context to member fields.
+     */
+    private function saveFontContext(flexModuleFactory:IFlexModuleFactory):void
+    {
+        // Save for hasFontContextChanged()
+        hasFontContextBeenSaved = true;
+        var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
+        var fontWeight:String = getStyle("fontWeight");
+        var fontStyle:String = getStyle("fontStyle");
+        var bold:Boolean = fontWeight == "bold";
+        var italic:Boolean = fontStyle == "italic";
+        var embeddedFont:EmbeddedFont =
+            getEmbeddedFont(fontName, bold, italic);
+        oldEmbeddedFontContext =
+            embeddedFontRegistry.getAssociatedModuleFactory(
+                embeddedFont, flexModuleFactory);
+    }
+
+    /**
+     *  @private
+     *  Test if the current font context has changed
+     *  since that last time saveFontContext() was called.
+     */
+    mx_internal function hasFontContextChanged(
+                            flexModuleFactory:IFlexModuleFactory):Boolean
+    {
+
+        // If the font has not been saved yet, then return false,
+        // the font context has not changed.
+        if (!hasFontContextBeenSaved)
+            return false;
+
+        var fontName:String =
+            StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
+        var fontWeight:String = getStyle("fontWeight");
+        var fontStyle:String = getStyle("fontStyle");
+
+        // Check if the module factory has changed.
+        var bold:Boolean = fontWeight == "bold";
+        var italic:Boolean = fontStyle == "italic";
+        var embeddedFont:EmbeddedFont =
+            getEmbeddedFont(fontName, bold, italic);
+        var fontContext:IFlexModuleFactory =
+            embeddedFontRegistry.getAssociatedModuleFactory(
+                embeddedFont, flexModuleFactory)
+        return fontContext != oldEmbeddedFontContext;
+    }
+
+    /**
+     *  @private
+     *  A hash table of objects used to calculate sizes
+     */
+    mx_internal var measuringObjects:Dictionary;
+
+    /**
+     *  A map of free item renderers by factory.
+     *  This property is a Dictionary indexed by factories
+     *  where the values are Dictionaries of itemRenderers
+     *
+     */
+    mx_internal var freeItemRenderersByFactory:Dictionary;
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10475
Author:   jimurphy@adobe.com
Date:     2009-09-21T23:58:45.057679Z

Log Message:
-----------
Merged 3.x revisions 10063,10086,10098,10123,10176,10397,10416-10418,10420 -> trunk

checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/AMFChannel.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.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/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/formatters/CurrencyFormatter.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/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/SortField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>

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

--- frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridHeader.as
+++ frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridHeader.as
@@ -295,7 +295,11 @@
                 extraItem = headerItems.pop();
                 // if it is parented by us, remove it (could be in lockedColumns header)
                 if (extraItem.parent == this)
-                    removeChild(DisplayObject(extraItem));
+                {
+                    // make sure it isn't already in there elsewhere
+                    if (headerItems.indexOf(extraItem) == -1)
+                        removeChild(DisplayObject(extraItem));
+                }
             }
         }
         var headerBG:UIComponent =


Transferred from the Adobe Open Source Subversion Repository

Revision: 16913
Author:   hmuller@adobe.com
Date:     2010-07-14T16:58:29.319435Z

Log Message:
-----------
Renamed Grid defaultItemRenderer property to "itemRenderer".  Added an grid.itemRenderer cover property to DataGrid.

Revised the way DataGrid properties that "cover" grid skin part properties are defined.

Added support for auto column generation.

Made columnSeparators extend to the limit of the Grid (SDK-26892 remains incomplete, waiting for more information).

QE notes: changes apply to Spark DataGrid only
Doc notes:
Bugs: SDK-26828, SDK-26892
Reviewer: Kevin
Tests run: none
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
@@ -100,9 +100,6 @@

         // Only invalidate if we're clipping and scrollR extends outside validBounds

-        // FIXME: the hover indicator may need to be updated if the grid
-        // underneath the pointer scrolls.
-
         const scrollR:Rectangle = grid.scrollRect;
         if (scrollR && !visibleItemRenderersBounds.containsRect(scrollR))
             grid.invalidateDisplayList();
@@ -160,6 +157,13 @@

         const scrollX:Number = horizontalScrollPosition;
         const scrollY:Number = verticalScrollPosition;
+
+        // TBD(hmuller): use this state variable rather than passing scrollX,.. around.  And get rid of
+        // scrollX,Y vars above
+        visibleGridBounds.x = scrollX;
+        visibleGridBounds.y = scrollY;
+        visibleGridBounds.width = unscaledWidth;
+        visibleGridBounds.height = unscaledHeight;

 		updateGridDimensions(scrollX, scrollY, unscaledWidth, unscaledHeight);

@@ -492,6 +496,12 @@
      */
     private const visibleItemRenderersBounds:Rectangle = new Rectangle();

+    /**
+     *  Initialized by updateDisplayList with the current scrollPosition, and grid.width,Height.
+     */
+    private const visibleGridBounds:Rectangle = new Rectangle();
+
+
     private function layoutItemRenderers(itemRendererGroup:Group, scrollX:Number, scrollY:Number, width:Number, height:Number):void
     {
         var rowIndex:int;
@@ -576,7 +586,8 @@
             }

             // If gridDimensions.rowHeight is now larger, we need to make another
-            // pass to fix up the item renderer heights.
+            // pass to fix up the item renderer heights.
+
             const finalRowHeight:Number = gridDimensions.getRowHeight(rowIndex);
             if (rowHeight != finalRowHeight)
             {
@@ -1048,7 +1059,7 @@
     {
         const r:Rectangle = visibleItemRenderersBounds;
         const width:Number = 1;  // TBD: should be max(1, rowGap)
-        const height:Number = r.height;
+        const height:Number = Math.max(r.height, visibleGridBounds.height);
         const bounds:Rectangle = gridDimensions.getColumnBounds(columnIndex);
         if (!bounds)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8509
Author:   smgilson@adobe.com
Date:     2009-07-10T17:58:51.724217Z

Log Message:
-----------
- Explicitly list the default skins for Spark components as part of the fix for SDK-18639
- Fix some bad @see links

QE Notes: None
Doc Notes: None
Bugs: - SDK-18639
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/StreamingVideoSource.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/StreamItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>

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

--- frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as
+++ frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as
@@ -122,6 +122,9 @@
  *  the volume of the video player.  By default it pops up when the
  *  muteButton is rolled over (with a delay of 200 milliseconds).  The
  *  muteButton functions as a mute/unmute button when clicked.
+ *
+ *  @see spark.components.VideoPlayer
+ *  @see spark.primitives.VideoElement
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 3321
Author:   hmuller@adobe.com
Date:     2008-09-23T21:21:31.020570Z

Log Message:
-----------
Created ILayout implementation LayoutBase and made it the base
class for the three existing layouts. LayoutBase defines the
following properties:

  target - the Group or DataGroup (GroupBase) that whose
  layout property is _this_ layout.

  verticalScrollPosition, horizontalScrollPosition - the
  origin of the target's scrollRect.  These properties were
  defined by GroupBase.

LayoutBase also adds some new protected methods:

  scrollPositionChanged() - called when the
  vertical,horizontalScrollPosition properties change.

  updateScrollRect() - syncs the scrollRect with the
  vertical,horizontalScrollPosition properties

  invalidateTargetSizeAndDisplayList() - convenience
  method that calls invalidateSize,DisplayList().

LayoutBase also defines empty implementations of measure
and updateDisplayList.

GroupBase now delegates vertical,horizontalScrollPosition
to its layout and redispatches the layout's propertyChange
events for these properties.

QE: No
Doc: No
Checkintests: Pass
Reviewer: Evtim
Bugs:
   SDK-17002 -  includeInLayout no longer being respected

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/ILayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Scroller.as</path>

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 3930
Author:   egreenfi@adobe.com
Date:     2008-10-28T16:30:24.729265Z

Log Message:
-----------
Step 1 of memory improvements
GraphicElement now optimizes away its AdvancedLayoutFeatures as long is has a trivial (translation only) transform matrix.
Added a new OnDemandEventDispatcher class that only allocates memory for event dispatcher functionality when it gets its first listener.
GraphicElement, OverrideBase, and LayoutBase extend OnDemandEventDispatcher.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/OverrideBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/OnDemandEventDispatcher.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -12,17 +12,14 @@
 package mx.layout
 {

-import flash.events.Event;
 import flash.geom.Rectangle;
-import flash.geom.Point;
 import flash.ui.Keyboard;

 import mx.components.baseClasses.GroupBase;
-import mx.layout.ILayoutItem;
-import flash.events.EventDispatcher;
-
-
-public class LayoutBase extends EventDispatcher
+import mx.utils.OnDemandEventDispatcher;
+
+
+public class LayoutBase extends OnDemandEventDispatcher
 {
     //--------------------------------------------------------------------------
     //


Transferred from the Adobe Open Source Subversion Repository

Revision: 23097
Author:   smgilson@adobe.com
Date:     2011-10-24T14:59:00.248308Z

Log Message:
-----------
Fix for ASDoc bug #2986830 in Watson

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

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -117,8 +117,8 @@
      *  maintainProjectionCenter property here.

      *
      *  @default null
-     *  @see #updateDisplayList
-     *  @see #measure
+     *  @see #updateDisplayList()
+     *  @see #measure()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -198,7 +198,7 @@
      *
      *  @default false
      *
-     *  @see #getScrollRect
+     *  @see #getScrollRect()
      *  @see #typicalLayoutElement
      *
      *  @langversion 3.0
@@ -407,7 +407,7 @@
      *
      *  @default null
      *
-     *  @see target
+     *  @see #target
      *  @see spark.layouts.VerticalLayout#variableRowHeight
      *  @see spark.layouts.HorizontalLayout#variableColumnWidth
      *
@@ -546,7 +546,7 @@
      *  the target's measuredWidth, measuredHeight,
      *  measuredMinWidth and measuredMinHeight.

      *
-     *  @see #updateDisplayList
+     *  @see #updateDisplayList()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -592,7 +592,7 @@
      *  @param unscaledHeight Specifies the height of the component, in pixels,
      *  in the target's coordinates.
      *
-     *  @see #measure
+     *  @see #measure()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -620,7 +620,7 @@
      *
      *  @param index The index of the element that was added.
      *
-     *  @see #elementRemoved
+     *  @see #elementRemoved()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -648,7 +648,7 @@
      *
By default, this method does nothing.

      *
      *  @param index The index of the element that was added.
-     *  @see #elementAdded
+     *  @see #elementAdded()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -953,12 +953,12 @@
      *  @param scrollRect The target's scrollRect.
      *
      *  @return The bounds of the first element that spans or is to
-     *  the left of the scrollRect’s left edge.
-     *
-     *  @see #getElementBoundsRightOfScrollRect
-     *  @see #getElementBoundsAboveScrollRect
-     *  @see #getElementBoundsBelowScrollRect
-     *  @see #getHorizontalScrollPositionDelta
+     *  the left of the scrollRect's left edge.
+     *
+     *  @see #getElementBoundsRightOfScrollRect()
+     *  @see #getElementBoundsAboveScrollRect()
+     *  @see #getElementBoundsBelowScrollRect()
+     *  @see #getHorizontalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -991,12 +991,12 @@
      *  @param scrollRect The target's scrollRect.
      *
      *  @return The bounds of the first element that spans or is to
-     *  the right of the scrollRect’s right edge.
-     *
-     *  @see #getElementBoundsLeftOfScrollRect
-     *  @see #getElementBoundsAboveScrollRect
-     *  @see #getElementBoundsBelowScrollRect
-     *  @see #getHorizontalScrollPositionDelta
+     *  the right of the scrollRect's right edge.
+     *
+     *  @see #getElementBoundsLeftOfScrollRect()
+     *  @see #getElementBoundsAboveScrollRect()
+     *  @see #getElementBoundsBelowScrollRect()
+     *  @see #getHorizontalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1033,12 +1033,12 @@
      *  @param scrollRect The target's scrollRect.
      *
      *  @return The bounds of the first element that spans or is
-     *  above the scrollRect’s top edge.
-     *
-     *  @see #getElementBoundsLeftOfScrollRect
-     *  @see #getElementBoundsRightScrollRect
-     *  @see #getElementBoundsBelowScrollRect
-     *  @see #getVerticalScrollPositionDelta
+     *  above the scrollRect's top edge.
+     *
+     *  @see #getElementBoundsLeftOfScrollRect()
+     *  @see #getElementBoundsRightOfScrollRect()
+     *  @see #getElementBoundsBelowScrollRect()
+     *  @see #getVerticalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1071,12 +1071,12 @@
      *  @param scrollRect The target's scrollRect.
      *
      *  @return The bounds of the first element that spans or is
-     *  below the scrollRect’s bottom edge.
-     *
-     *  @see #getElementBoundsLeftOfScrollRect
-     *  @see #getElementBoundsRightScrollRect
-     *  @see #getElementBoundsAboveScrollRect
-     *  @see #getVerticalScrollPositionDelta
+     *  below the scrollRect's bottom edge.
+     *
+     *  @see #getElementBoundsLeftOfScrollRect()
+     *  @see #getElementBoundsRightOfScrollRect()
+     *  @see #getElementBoundsAboveScrollRect()
+     *  @see #getVerticalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1149,9 +1149,9 @@
      *  @return The change to the horizontal scroll position.
      *
      *  @see spark.core.NavigationUnit
-     *  @see #getElementBoundsLeftOfScrollRect
-     *  @see #getElementBoundsRightOfScrollRect
-     *  @see #getHorizontalScrollPositionDelta
+     *  @see #getElementBoundsLeftOfScrollRect()
+     *  @see #getElementBoundsRightOfScrollRect()
+     *  @see #getHorizontalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1312,9 +1312,9 @@
      *  @return The change to the vertical scroll position.
      *
      *  @see spark.core.NavigationUnit
-     *  @see #getElementBoundsAboveScrollRect
-     *  @see #getElementBoundsBelowScrollRect
-     *  @see #getVerticalScrollPositionDelta
+     *  @see #getElementBoundsAboveScrollRect()
+     *  @see #getElementBoundsBelowScrollRect()
+     *  @see #getVerticalScrollPositionDelta()
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1445,7 +1445,7 @@
     *  @see #clipAndEnableScrolling
     *  @see #verticalScrollPosition
     *  @see #horizontalScrollPosition
-    *  @see #udpdateScrollRect()
+    *  @see #updateScrollRect()
     *
     *  @langversion 3.0
     *  @playerversion Flash 10
@@ -1601,37 +1601,37 @@

     }

-	/**
-	 *  @private
-	 *
-	 *  Given an x\y position and a compare point
-	 *  (topLeft/topRight/bottomRight/bottomLeft/center), returns the element
-	 *  who's compare point is closest to the position.
-	 *  For example, the position might be in the bounds of element A, but
-	 *  closer to the topLeft corner of element B than to the topLeft corner
-	 *  of element A.
-	 *  In which case, this function would return the index for element B.
-	 */
-	mx_internal function getElementNearestScrollPosition(
-		position:Point,
-		elementComparePoint:String = "center"):int
-	{
-		var num:int = target.numElements;
-		var minDistance:Number = Number.MAX_VALUE;
-		var minDistanceElement:int = -1;
-		var i:int;
-		var rect:Rectangle;
-		var dist:int;
-
-		// This base implementation uses brute force:  the compare point of every existing
-		// element is compared to the position and the closest one wins.  Most derived layout
-		// classes will have a better mechanism for finding the closest element without
-		// a linear search like this.
-		// TODO (eday) - possible performance optimization: Pull the switch statement out of the
-		// loop and have a separate loop for each case.
-		for (i = 0; i < num; i++)
-		{
-			rect = getElementBounds(i);
+    /**
+     *  @private
+     *
+     *  Given an x\y position and a compare point
+     *  (topLeft/topRight/bottomRight/bottomLeft/center), returns the element
+     *  who's compare point is closest to the position.
+     *  For example, the position might be in the bounds of element A, but
+     *  closer to the topLeft corner of element B than to the topLeft corner
+     *  of element A.
+     *  In which case, this function would return the index for element B.
+     */
+    mx_internal function getElementNearestScrollPosition(
+        position:Point,
+        elementComparePoint:String = "center"):int
+    {
+        var num:int = target.numElements;
+        var minDistance:Number = Number.MAX_VALUE;
+        var minDistanceElement:int = -1;
+        var i:int;
+        var rect:Rectangle;
+        var dist:int;
+
+        // This base implementation uses brute force:  the compare point of every existing
+        // element is compared to the position and the closest one wins.  Most derived layout
+        // classes will have a better mechanism for finding the closest element without
+        // a linear search like this.
+        // TODO (eday) - possible performance optimization: Pull the switch statement out of the
+        // loop and have a separate loop for each case.
+        for (i = 0; i < num; i++)
+        {
+            rect = getElementBounds(i);

             // Allow for rect being null, as numElements may be
             // non-zero when the actual items haven't been added yet.
@@ -1664,10 +1664,10 @@
                     minDistanceElement = i;
                 }
             }
-		}
-		return minDistanceElement;
-	}
-
+        }
+        return minDistanceElement;
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Drop methods


Transferred from the Adobe Open Source Subversion Repository

Revision: 21892
Author:   aaltman@adobe.com
Date:     2011-08-08T20:36:23.953399Z

Log Message:
-----------
Added metadata for soft keyboard hint properties to SkinnableTextBase

QE notes: None
Doc notes: None
Bugs: SDK-30980
Reviewer: cframpto
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -1374,6 +1374,8 @@
     //  autoCapitalize
     //----------------------------------

+    [Inspectable(category="General",enumeration="none,word,sentence,all",defaultValue="none")]
+
     /**
      *  Hint indicating what captialization behavior soft keyboards should
      *  use.
@@ -1429,12 +1431,14 @@
     //  autoCorrect
     //----------------------------------

+    [Inspectable(category="General",defaultValue="true")]
+
     /**
      *  Hint indicating whether a soft keyboard should use its auto-correct
      *  behavior, if supported.
      *
For the Desktop theme, this is not supported.

      *
-     *  @default false
+     *  @default true
      *
      *  @langversion 3.0
      *  @playerversion AIR 3.0
@@ -1476,6 +1480,8 @@
     //  returnKeyLabel
     //----------------------------------

+    [Inspectable(category="General",enumeration="default,done,go,next,search",defaultValue="default")]
+
     /**
      *  Hint indicating what label should be displayed for the return key on
      *  soft keyboards.
@@ -1532,6 +1538,8 @@
     //  softKeyboardType
     //----------------------------------

+    [Inspectable(category="General",enumeration="default,punctuation,url,number,contact,email",defaultValue="default")]
+
     /**
      *  Hint indicating what kind of soft keyboard should be displayed for
      *  this component.


fix Instruction.computeHash() to prefix the string hash with the instruction id and avoid instructions with the same arguments being mixed up

--- src/aerys/minko/render/shader/compiler/graph/nodes/vertex/Instruction.as
+++ src/aerys/minko/render/shader/compiler/graph/nodes/vertex/Instruction.as
@@ -182,11 +182,11 @@
 			// commutative operations invert the arguments when computing the hash if arg1.crc > arg2.crc
 			// that way, mul(a, b).hash == mul(b, a).hash

-			var hashLeft  : String = argument1.hash.toString(16) + '_' + component1.toString(16);
+			var hashLeft  : String = id.toFixed(16) + '_' + argument1.hash.toString(16)
+				+ '_' + component1.toString(16);

 			if ((FLAGS[_id] & InstructionFlag.SINGLE) != 0)
 				return CRC32.computeForString(hashLeft);
-
 			else
 			{
 				var hashRight : String = argument2.hash.toString(16) + '_' + component2.toString(16);


Fixed typos in IMediatorMap docs.

Fixed typos in IMediatorMap docs.

--- src/org/robotlegs/core/IMediatorMap.as
+++ src/org/robotlegs/core/IMediatorMap.as
@@ -20,9 +20,9 @@
 		 *
 		 * @param viewClassOrName The concrete view Class or Fully Qualified Class Name
 		 * @param mediatorClass The IMediator Class
-		 * @param injectViewAs The explicit view Interface or Class that the mediator depends on OR an Array of such Interfaces/Classess.
+		 * @param injectViewAs The explicit view Interface or Class that the mediator depends on OR an Array of such Interfaces/Classes.
 		 * @param autoCreate Automatically construct and register an instance of Class mediatorClass when an instance of Class viewClass is detected
-		 * @param autoRemove Automatically remove an instance of Class mediatorClass when it's viewClass leaves the ancestory of the context view
+		 * @param autoRemove Automatically remove an instance of Class mediatorClass when its viewClass leaves the ancestory of the context view
 		 */
 		function mapView(viewClassOrName:*, mediatorClass:Class, injectViewAs:* = null, autoCreate:Boolean = true, autoRemove:Boolean = true):void;

@@ -47,7 +47,7 @@
 		/**
 		 * Manually register an IMediator instance
 		 *
-		 *
NOTE: Registering a Mediator will NOT inject it's dependencies.
+		 *
NOTE: Registering a Mediator will NOT inject its dependencies.
 		 * It is assumed that dependencies are already satisfied.

 		 *
 		 * @param viewComponent The view component for the IMediator


Optimize cloning performance.

Optimize cloning performance.

--- dolly-framework/src/main/actionscript/dolly/Cloner.as
+++ dolly-framework/src/main/actionscript/dolly/Cloner.as
@@ -5,9 +5,9 @@
 import dolly.core.metadata.MetadataName;

 import org.as3commons.reflect.Accessor;
+import org.as3commons.reflect.AccessorAccess;
 import org.as3commons.reflect.Field;
 import org.as3commons.reflect.Type;
-import org.as3commons.reflect.Variable;

 use namespace dolly_internal;

@@ -17,44 +17,16 @@
 		return type.hasMetadata(MetadataName.CLONEABLE);
 	}

-	private static function isVariableCloneable(variable:Variable, skipMetadataChecking:Boolean = true):Boolean {
-		return !variable.isStatic && (skipMetadataChecking || variable.hasMetadata(MetadataName.CLONEABLE));
-	}
-
-	private static function isAccessorCloneable(accessor:Accessor, skipMetadataChecking:Boolean = true):Boolean {
-		return !accessor.isStatic && accessor.isReadable() && accessor.isWriteable() &&
-				(skipMetadataChecking || accessor.hasMetadata(MetadataName.CLONEABLE));
-	}
-
-	dolly_internal static function getWritableFieldsOfType(type:Type):Vector.<Field> {
+	dolly_internal static function findAllWritableFieldsForType(type:Type):Vector.<Field> {
 		const result:Vector.<Field> = new Vector.<Field>();

-		var variable:Variable;
-		var accessor:Accessor;
+		for each(var field:Field in type.fields) {
+			if (field.isStatic) {
+				continue;
+			}

-		for each(variable in type.variables) {
-			if (isVariableCloneable(variable)) {
-				result.push(variable);
-			}
-		}
-		for each(accessor in type.accessors) {
-			if (isAccessorCloneable(accessor)) {
-				result.push(accessor);
-			}
-		}
-
-		return result;
-	}
-
-	dolly_internal static function findAllCloneableFieldsForType(type:Type):Vector.<Field> {
-		const result:Vector.<Field> = getWritableFieldsOfType(type);
-
-		const superclassNames:Array = type.extendsClasses;
-		for each(var superclassName:String in superclassNames) {
-			var superclassType:Type = Type.forName(superclassName);
-			var superclassWritableFields:Vector.<Field> = getWritableFieldsOfType(superclassType);
-			if (superclassWritableFields.length > 0) {
-				result.concat(superclassWritableFields);
+			if (!(field is Accessor) || (field as Accessor).access == AccessorAccess.READ_WRITE) {
+				result.push(field);
 			}
 		}

@@ -75,7 +47,7 @@

 		// Find all public writable fields in a hierarchy of a source object
 		// and assign their values to a clone object.
-		const fieldsToClone:Vector.<Field> = findAllCloneableFieldsForType(type);
+		const fieldsToClone:Vector.<Field> = findAllWritableFieldsForType(type);
 		var name:String;
 		for each(var field:Field in fieldsToClone) {
 			name = field.name;


Transferred from the Adobe Open Source Subversion Repository

Revision: 5257
Author:   jszeto@adobe.com
Date:     2009-03-11T22:12:50.289894Z

Log Message:
-----------
Flex SDK Bug Fixes

SDK-19314 Arrow keys which move a slider's thumb also scroll the player window.

If we handle an arrow key or HOME/END, then we stop it from propagating.

SDK-19443 FxHSlider doesnt position tooltip/datatip correctly when on the right edge of the flex app

Added logic to ensure that the dataTip stays in the bounds of the screen

SDK-19384 @review tags are appearing before asdoc descriptions, causing empty ASDoc tooltips in Flex Builder

Removed all occurrences of @review since it is no longer used.

QE Notes: n/a
Doc Notes: n/a
Bugs: SDK-19314, SDK-19443, SDK-19384
Reviewer: Ryan

Modified Paths:
--------------
<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/controls/MenuBar.as</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/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSlider.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/flex4/src/mx/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/DropDownBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>

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

--- frameworks/projects/mx/src/mx/controls/ColorPicker.as
+++ frameworks/projects/mx/src/mx/controls/ColorPicker.as
@@ -1114,7 +1114,6 @@
     /**
      *  Set of styles to pass from the ColorPicker through to the preview swatch.
      *  @see mx.styles.StyleProxy
-     *  @review
      *
      *  @langversion 3.0
      *  @playerversion Flash 9


Transferred from the Adobe Open Source Subversion Repository

Revision: 18685
Author:   chiedozi@adobe.com
Date:     2010-11-17T23:41:28.244847Z

Log Message:
-----------
MobileApplication classes have been renamed to ViewNavigatorApplication.  Specific file changes are:
MobileApplicationBase  -->  ViewNavigatorApplicationBase
MobileApplication --> ViewNavigatorApplication
MobileApplicationSkin -->  ViewNavigatorApplicationSkin
TabbedMobileApplication -->  TabbedViewNavigatorApplication
TabbedMobileApplicationSkin --> TabbedViewNavigatorApplicationSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedASTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedMXMLLabel.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as</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/mobilecomponents/src/spark/components/ViewMenuItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/RadioStations/src/RadioStations.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedMXMLTextField.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers/PersistenceManager.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/ComponentCatalog/src/ComponentCatalog.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedMobileApplicationSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigatorApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchASLabel.mxml</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/tests/performance/mobile/TextTest/src/TextTest.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedMobileApplicationSkin.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchASTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchMXMLLabel.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="dir" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers/IPersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchMXMLTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedASLabel.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TransitionTests/src/TransitionTests.mxml</path>
<path kind="dir" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as
@@ -44,7 +44,7 @@
  *
  *  @see spark.components.ViewMenu
  *  @see spark.layouts.ViewMenuLayout
- *  @see spark.components.supportClasses.MobileApplicationBase
+ *  @see spark.components.supportClasses.ViewNavigatorApplicationBase
  *
  *  @langversion 3.0
  *  @playerversion AIR 2.5


Transferred from the Adobe Open Source Subversion Repository

Revision: 12967
Author:   cframpto@adobe.com
Date:     2009-12-15T20:55:30.958218Z

Log Message:
-----------
Fix comment on textLines vector again.

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

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -187,7 +187,8 @@

     /**
      *  @private
-	 *  The TextLines created to render the text.
+	 *  The TextLines and Shapes created to render the text.
+	 *  (Shapes are used to render the backgroundColor format for RichText.)
      */
     mx_internal var textLines:Vector.<DisplayObject> =
     	new Vector.<DisplayObject>();


csv export now gets probe columns

csv export now gets probe columns

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -64,7 +64,9 @@
 	import weave.WeaveProperties;
 	import weave.api.WeaveAPI;
 	import weave.api.core.ICallbackCollection;
+	import weave.api.core.ILinkableHashMap;
 	import weave.api.core.ILinkableObject;
+	import weave.api.data.IAttributeColumn;
 	import weave.api.data.IDataSource;
 	import weave.api.detectLinkableObjectChange;
 	import weave.api.getCallbackCollection;
@@ -766,7 +768,7 @@
 				}

 				if (Weave.properties.enableManageDataSources.value)
-					_weaveMenu.addMenuItemToMenu(_dataMenu, new WeaveMenuItem(lang("Manage or browse data sources"), DraggablePanel.openStaticInstance, [DataSourceManager]));
+					_weaveMenu.addMenuItemToMenu(_dataMenu, new WeaveMenuItem(lang("Manage or browse data"), DraggablePanel.openStaticInstance, [DataSourceManager]));

 				if (Weave.properties.enableExportCSV.value)
 					_weaveMenu.addMenuItemToMenu(_dataMenu, new WeaveMenuItem(lang("Export CSV from all visualizations"), exportCSV));
@@ -1539,30 +1541,34 @@
 		{
 			try
 			{
-				var tools:Array = tool
-					? [tool]
-					: WeaveAPI.globalHashMap.getObjects(IVisToolWithSelectableAttributes);
-
-				var csvString:String = ColumnUtils.generateTableCSV(
-					VectorUtils.flatten(
-						tools.map(
-							function(tool:IVisToolWithSelectableAttributes, i:int, a:Array):Array {
-								return tool.getSelectableAttributes();
-							}
-						)
-					)
-				);
-
+				var fileName:String = tool
+					? getQualifiedClassName(tool).split(':').pop()
+					: "data-export";
+				fileName = "Weave-" + fileName + ".csv";
+
+				var attrs:Array = [];
+				if (tool)
+				{
+					VectorUtils.flatten(tool.getSelectableAttributes());
+				}
+				else
+				{
+					// get equation columns and color column
+					VectorUtils.flatten(WeaveAPI.globalHashMap.getObjects(IAttributeColumn), attrs);
+					// get probe columns
+					VectorUtils.flatten(WeaveAPI.globalHashMap.getObjects(ILinkableHashMap), attrs);
+					for each (tool in WeaveAPI.globalHashMap.getObjects(IVisToolWithSelectableAttributes))
+						VectorUtils.flatten(tool.getSelectableAttributes(), attrs);
+				}
+
+				var csvString:String = ColumnUtils.generateTableCSV(attrs);
 				if (!csvString)
 				{
 					reportError("No data to export");
 					return;
 				}

-				var name:String = tool
-					? getQualifiedClassName(tool).split(':').pop()
-					: "data-export";
-				exportCSVfileRef.save(csvString, "Weave-" + name + ".csv");
+				exportCSVfileRef.save(csvString, fileName);
 			}
 			catch (e:Error)
 			{


FLEX-32599 continue in loop if headerItem is null

--- frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
+++ frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
@@ -5873,6 +5873,9 @@
             for(var i:int=0; i < n; i++)
             {
                 headerItem = array[i]["headerItem"];
+				if(headerItem == null)
+					continue;
+
                 x = headerItem.x;

                 if(array[i].actualColNum >= lockedColumnCount)


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

--- frameworks/projects/advancedgrids/src/mx/styles/metadata/GapStyles.as
+++ frameworks/projects/advancedgrids/src/mx/styles/metadata/GapStyles.as
@@ -1,24 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.
-//
-////////////////////////////////////////////////////////////////////////////////

-/**
- *  Number of pixels between children in the horizontal direction.
- *  The default value depends on the component class;
- *  if not overriden for the class, the default value is 8.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
 [Style(name="horizontalGap", type="Number", format="Length", inherit="no")]

 /**


Add a phase for when the player has lost with accompanying fade logic.


Transferred from the Adobe Open Source Subversion Repository

Revision: 17889
Author:   chiedozi@adobe.com
Date:     2010-09-28T00:03:51.347470Z

Log Message:
-----------
Added an mx_internal activeView property to MobileApplicationBase
Added inspectable metadata to destructionPolicy on ViewNavigatorBase

QE notes:
Doc notes:
Bugs: SDK-28003
Reviewer: Jason SJ
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
+++ frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
@@ -95,6 +95,21 @@
      *  @private
      */
     private var navigatorProperties:Object = {};
+
+    //----------------------------------
+    //  activeView
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override mx_internal function get activeView():View
+    {
+        if (navigator)
+            return navigator.activeView;
+
+        return null;
+    }

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