Repository: flex-sdk Updated Branches: refs/heads/develop 2d033139f -> 24c9ab6ba
FLEX-34838 Corrected some AsDocs, changed variable names from 'type' (reserved keyword) to other names, and removed unused variables. Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/bb600fdc Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/bb600fdc Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/bb600fdc Branch: refs/heads/develop Commit: bb600fdc6e1afb6ded39d71e7d07d9b91fc58189 Parents: 2d03313 Author: Mihai Chira <[email protected]> Authored: Wed May 13 17:07:42 2015 +0200 Committer: Mihai Chira <[email protected]> Committed: Wed May 13 17:11:09 2015 +0200 ---------------------------------------------------------------------- .../src/mx/collections/ListCollectionView.as | 73 +++++++++----------- .../framework/src/mx/utils/ObjectUtil.as | 34 ++++----- .../projects/mx/src/mx/controls/DataGrid.as | 2 +- .../spark/src/spark/collections/Sort.as | 1 - .../spark/src/spark/components/DataGrid.as | 2 +- .../components/gridClasses/GridItemEditor.as | 4 +- 6 files changed, 52 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/framework/src/mx/collections/ListCollectionView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as index 5267b2d..3c59a91 100644 --- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as +++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as @@ -20,29 +20,25 @@ package mx.collections { -import flash.events.Event; -import flash.events.EventDispatcher; -import flash.utils.Proxy; -import flash.utils.flash_proxy; -import flash.utils.getQualifiedClassName; - -import mx.collections.errors.CollectionViewError; -import mx.collections.errors.CursorError; -import mx.collections.errors.ItemPendingError; -import mx.collections.errors.SortError; -import mx.core.IMXMLObject; -import mx.core.mx_internal; -import mx.events.CollectionEvent; -import mx.events.CollectionEventKind; -import mx.events.FlexEvent; -import mx.events.PropertyChangeEvent; -import mx.managers.ISystemManager; -import mx.managers.SystemManager; -import mx.resources.IResourceManager; -import mx.resources.ResourceManager; -import mx.utils.ObjectUtil; - -use namespace mx_internal; + import flash.events.Event; + import flash.events.EventDispatcher; + import flash.utils.Proxy; + import flash.utils.flash_proxy; + import flash.utils.getQualifiedClassName; + + import mx.collections.errors.CollectionViewError; + import mx.collections.errors.ItemPendingError; + import mx.collections.errors.SortError; + import mx.core.IMXMLObject; + import mx.core.mx_internal; + import mx.events.CollectionEvent; + import mx.events.CollectionEventKind; + import mx.events.PropertyChangeEvent; + import mx.resources.IResourceManager; + import mx.resources.ResourceManager; + import mx.utils.ObjectUtil; + + use namespace mx_internal; /** * Dispatched when the ICollectionView has been updated in some way. @@ -622,7 +618,7 @@ public class ListCollectionView extends Proxy * Adds a list of items to the current list, placing them at the end of * the list in the order they are passed. * - * @param IList The list of items to add to the current list + * @param addList IList The list of items to add to the current list * * @langversion 3.0 * @playerversion Flash 9 @@ -642,7 +638,7 @@ public class ListCollectionView extends Proxy * index passed in to the function. The items are placed at the index location * and placed in the order they are recieved. * - * @param IList The list of items to add to the current list + * @param addList IList The list of items to add to the current list * @param index The location of the current list to place the new items. * @throws RangeError if index is less than 0 or greater than the length of the list. * @@ -1052,13 +1048,13 @@ public class ListCollectionView extends Proxy * @playerversion AIR 1.1 * @productversion Flex 3 */ - public function addEventListener(type:String, + public function addEventListener(eventType:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void { - eventDispatcher.addEventListener(type, listener, useCapture, + eventDispatcher.addEventListener(eventType, listener, useCapture, priority, useWeakReference); } @@ -1070,11 +1066,11 @@ public class ListCollectionView extends Proxy * @playerversion AIR 1.1 * @productversion Flex 3 */ - public function removeEventListener(type:String, + public function removeEventListener(eventType:String, listener:Function, useCapture:Boolean = false):void { - eventDispatcher.removeEventListener(type, listener, useCapture); + eventDispatcher.removeEventListener(eventType, listener, useCapture); } /** @@ -1098,9 +1094,9 @@ public class ListCollectionView extends Proxy * @playerversion AIR 1.1 * @productversion Flex 3 */ - public function hasEventListener(type:String):Boolean + public function hasEventListener(eventType:String):Boolean { - return eventDispatcher.hasEventListener(type); + return eventDispatcher.hasEventListener(eventType); } /** @@ -1111,9 +1107,9 @@ public class ListCollectionView extends Proxy * @playerversion AIR 1.1 * @productversion Flex 3 */ - public function willTrigger(type:String):Boolean + public function willTrigger(eventType:String):Boolean { - return eventDispatcher.willTrigger(type); + return eventDispatcher.willTrigger(eventType); } //-------------------------------------------------------------------------- @@ -1129,8 +1125,6 @@ public class ListCollectionView extends Proxy * * @param items the items to add into the view * @param sourceLocation the location within the list where the items were added - * @param extendedInfo Object reference to any additional event information - * that needs to be preserved. * @param dispatch true if the view should dispatch a corresponding * CollectionEvent with kind ADD (default is true) * @@ -1260,7 +1254,7 @@ public class ListCollectionView extends Proxy } catch (e:SortError) { - // usually because the find critieria is not compatible with the sort. + // usually because the find criteria is not compatible with the sort. } return -1; @@ -1844,14 +1838,11 @@ public class ListCollectionView extends Proxy } import flash.events.EventDispatcher; -import flash.events.Event; -import flash.events.IEventDispatcher; -import mx.events.*; import mx.collections.*; import mx.collections.errors.*; import mx.core.mx_internal; -import mx.managers.*; +import mx.events.*; import mx.resources.IResourceManager; import mx.resources.ResourceManager; @@ -2300,7 +2291,6 @@ class ListCollectionViewCursor extends EventDispatcher implements IViewCursor * @see mx.collections.IViewCursor#current * @see mx.collections.IViewCursor#movePrevious * @see mx.collections.errors.ItemPendingError - * @see mx.collectoins.events.ItemAvailableEvent * @example * <pre> * var myArrayCollection:ICollectionView = new ArrayCollection(["Bobby", "Mark", "Trevor", "Jacey", "Tyler"]); @@ -2353,7 +2343,6 @@ class ListCollectionViewCursor extends EventDispatcher implements IViewCursor * @see mx.collections.IViewCursor#current * @see mx.collections.IViewCursor#moveNext * @see mx.collections.errors.ItemPendingError - * @see mx.collectoins.events.ItemAvailableEvent * @example * <pre> * var myArrayCollection:ICollectionView = new ArrayCollection(["Bobby", "Mark", "Trevor", "Jacey", "Tyler"]); http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/framework/src/mx/utils/ObjectUtil.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/utils/ObjectUtil.as b/frameworks/projects/framework/src/mx/utils/ObjectUtil.as index 2e79ed9..2d6e7c2 100644 --- a/frameworks/projects/framework/src/mx/utils/ObjectUtil.as +++ b/frameworks/projects/framework/src/mx/utils/ObjectUtil.as @@ -204,8 +204,8 @@ public class ObjectUtil */ public static function isSimple(value:Object):Boolean { - var type:String = typeof(value); - switch (type) + var objectType:String = typeof(value); + switch (objectType) { case "number": case "string": @@ -394,7 +394,7 @@ public class ObjectUtil * (somepackage::MyCustomClass)#0 * clazz = (Date)</pre> * - * @param obj Object to be pretty printed. + * @param value Object to be pretty printed. * * @param namespaceURIs Array of namespace URIs for properties * that should be included in the output. @@ -567,8 +567,8 @@ public class ObjectUtil exclude:Array = null):String { var str:String; - var type:String = value == null ? "null" : typeof(value); - switch (type) + var objectType:String = value == null ? "null" : typeof(value); + switch (objectType) { case "boolean": case "number": @@ -710,7 +710,7 @@ public class ObjectUtil default: { - return "(" + type + ")"; + return "(" + objectType + ")"; } } @@ -791,7 +791,7 @@ public class ObjectUtil if (aRef == bRef) return 0; // the cool thing about our dictionary is that if - // we've seen objects and determined that they are inequal, then + // we've seen objects and determined that they are unequal, then // we would've already exited out of this compare() call. So the // only info in the dictionary are sets of equal items @@ -831,10 +831,10 @@ public class ObjectUtil // if the objects are dynamic they could have different // # of properties and should be treated on that basis first - var isDynamicObject:Boolean = isDynamicObject(a); + var isObjectDynamic:Boolean = isDynamicObject(a); // if it's dynamic, check to see that they have all the same properties - if (isDynamicObject) + if (isObjectDynamic) { bProps = getClassInfo(b).properties; result = arrayCompare(aProps, bProps, currentDepth, newDepth, refs); @@ -860,7 +860,7 @@ public class ObjectUtil } else { - // We must be inequal, so return 1 + // We must be unequal, so return 1 return 1; } break; @@ -881,7 +881,7 @@ public class ObjectUtil * * @param obj The Object to inspect. * - * @param exclude Array of Strings specifying the property names that should be + * @param excludes Array of Strings specifying the property names that should be * excluded from the returned result. For example, you could specify * <code>["currentTarget", "target"]</code> for an Event object since these properties * can cause the returned result to become large. @@ -938,7 +938,7 @@ public class ObjectUtil var classAlias:String; var properties:XMLList; var prop:XML; - var dynamic:Boolean = false; + var isDynamic:Boolean = false; var metadataInfo:Object; if (typeof(obj) == "xml") @@ -954,7 +954,7 @@ public class ObjectUtil var classInfo:XML = DescribeTypeCache.describeType(obj).typeDescription; className = [email protected](); classAlias = [email protected](); - dynamic = ([email protected]() == "true"); + isDynamic = [email protected]() == "true"; if (options.includeReadOnly) properties = classInfo..accessor.(@access != "writeonly") + classInfo..variable; @@ -965,7 +965,7 @@ public class ObjectUtil } // If type is not dynamic, check our cache for class info... - if (!dynamic) + if (!isDynamic) { cacheKey = getCacheKey(obj, excludes, options); result = CLASS_INFO_CACHE[cacheKey]; @@ -977,7 +977,7 @@ public class ObjectUtil result["name"] = className; result["alias"] = classAlias; result["properties"] = propertyNames; - result["dynamic"] = dynamic; + result["dynamic"] = isDynamic; result["metadata"] = metadataInfo = recordMetadata(properties); var excludeObject:Object = {}; @@ -1003,7 +1003,7 @@ public class ObjectUtil propertyNames.push(key); } } - else if (dynamic) + else if (isDynamic) { for (var p:String in obj) { @@ -1134,7 +1134,7 @@ public class ObjectUtil // For normal, non-dynamic classes we cache the class info // Don't cache XML as it can be dynamic - if (!dynamic && className != "XML") + if (!isDynamic && className != "XML") { cacheKey = getCacheKey(obj, excludes, options); CLASS_INFO_CACHE[cacheKey] = result; http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/mx/src/mx/controls/DataGrid.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/mx/src/mx/controls/DataGrid.as b/frameworks/projects/mx/src/mx/controls/DataGrid.as index 03d36b5..341d629 100644 --- a/frameworks/projects/mx/src/mx/controls/DataGrid.as +++ b/frameworks/projects/mx/src/mx/controls/DataGrid.as @@ -3973,7 +3973,7 @@ public class DataGrid extends DataGridBase implements IIMESupport if (sf[i].name == c.dataField) { // we're part of the current sort - f = sf[i] + f = sf[i]; // flip the logic so desc is new desired order desc = !f.descending; break; http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/spark/src/spark/collections/Sort.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/collections/Sort.as b/frameworks/projects/spark/src/spark/collections/Sort.as index a6131b1..ec85d67 100644 --- a/frameworks/projects/spark/src/spark/collections/Sort.as +++ b/frameworks/projects/spark/src/spark/collections/Sort.as @@ -800,7 +800,6 @@ public class Sort extends AdvancedStyleClient implements ISort var fields:Array = this.fields; if (fields && fields.length > 0) { - var i:int; //doing the init value each time may be a little inefficient //but allows for the data to change and the comparators //to update correctly http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/spark/src/spark/components/DataGrid.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/components/DataGrid.as b/frameworks/projects/spark/src/spark/components/DataGrid.as index 9b17f60..6aefbe3 100644 --- a/frameworks/projects/spark/src/spark/components/DataGrid.as +++ b/frameworks/projects/spark/src/spark/components/DataGrid.as @@ -4903,7 +4903,7 @@ public class DataGrid extends SkinnableContainerBase * @see spark.components.gridClasses.GridColumn#sortCompareFunction * @see spark.components.gridClasses.GridColumn#sortDescending * @see spark.components.gridClasses.GridColumn#sortField - * @see spark.components.gridClasses.GridColumnHeaderGroup#visibleSortIndicatorIndices + * @see spark.components.GridColumnHeaderGroup#visibleSortIndicatorIndices * @see spark.events.GridSortEvent * * @langversion 3.0 http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bb600fdc/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as b/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as index 205eec0..aaece2d 100644 --- a/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as +++ b/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as @@ -391,7 +391,7 @@ public class GridItemEditor extends Group implements IGridItemEditor { if (newValue != value) { - _value = newValue + _value = newValue; if (hasEventListener("valueChanged")) { @@ -513,7 +513,7 @@ public class GridItemEditor extends Group implements IGridItemEditor var strNewData:String = newData.toString(); if (strNewData) { - newData = (strNewData.toLowerCase() == "true") ? true : false; + newData = strNewData.toLowerCase() == "true"; } } }
