This is an automated email from the ASF dual-hosted git repository. alinakazi pushed a commit to branch revert-217-branch1 in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 15a41ba9a350806326371398882c18a271e0180d Author: alinakazi <[email protected]> AuthorDate: Wed May 16 14:44:16 2018 +0500 Revert "ISort,ArrayCollection and ListCollectionView Added" --- .../MXRoyale/src/main/royale/MXRoyaleClasses.as | 5 - .../main/royale/mx/collections/ArrayCollection.as | 151 ----- .../src/main/royale/mx/collections/ISort.as | 353 ----------- .../royale/mx/collections/ListCollectionView.as | 668 --------------------- .../MXRoyale/src/main/royale/mx/controls/Alert.as | 612 ------------------- 5 files changed, 1789 deletions(-) diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as index 08ee00c..2750370 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as +++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as @@ -97,7 +97,6 @@ internal class MXRoyaleClasses import mx.charts.HitData; HitData; import mx.collections.GroupingField; GroupingField; import mx.collections.Grouping; Grouping; - import mx.core.IVisualElementContainer; IVisualElementContainer; import mx.managers.BrowserManager; BrowserManager; import mx.containers.FormHeading; FormHeading; @@ -175,10 +174,6 @@ internal class MXRoyaleClasses import mx.messaging.channels.AMFChannel; AMFChannel; import mx.messaging.ChannelSet; ChannelSet; import mx.rpc.soap.WebService; WebService; - import mx.collections.ISort; ISort; - import mx.collections.ListCollectionView; ListCollectionView; - import mx.collections.ArrayCollection; ArrayCollection; - import mx.controls.Alert; Alert; COMPILE::SWF { diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ArrayCollection.as b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ArrayCollection.as deleted file mode 100644 index 2acebf9..0000000 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ArrayCollection.as +++ /dev/null @@ -1,151 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package mx.collections -{ -COMPILE::JS { - import goog.DEBUG; -} -/* -import flash.system.ApplicationDomain; -import flash.utils.IDataInput; -import flash.utils.IDataOutput; -import flash.utils.IExternalizable; - -import mx.core.mx_internal; - -use namespace mx_internal; -*/ -[DefaultProperty("source")] - -[RemoteClass(alias="flex.messaging.io.ArrayCollection")] - -/** - * The ArrayCollection class is a wrapper class that exposes an Array as - * a collection that can be accessed and manipulated using the methods - * and properties of the <code>ICollectionView</code> or <code>IList</code> - * interfaces. Operations on a ArrayCollection instance modify the data source; - * for example, if you use the <code>removeItemAt()</code> method on an - * ArrayCollection, you remove the item from the underlying Array. - * - * @mxml - * - * <p>The <code><mx:ArrayCollection></code> tag inherits all the attributes of its - * superclass, and adds the following attributes:</p> - * - * <pre> - * <mx:ArrayCollection - * <b>Properties</b> - * source="null" - * /> - * </pre> - * - * @example The following code creates a simple ArrayCollection object that - * accesses and manipulates an array with a single Object element. - * It retrieves the element using the IList interface <code>getItemAt</code> - * method and an IViewCursor object that it obtains using the ICollectionView - * <code>createCursor</code> method. - * <pre> - * var myCollection:ArrayCollection = new ArrayCollection([ { first: 'Matt', last: 'Matthews' } ]); - * var myCursor:IViewCursor = myCollection.createCursor(); - * var firstItem:Object = myCollection.getItemAt(0); - * var firstItemFromCursor:Object = myCursor.current; - * if (firstItem == firstItemFromCursor) - * doCelebration(); - * </pre> - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ -public class ArrayCollection extends ListCollectionView //implements IExternalizable -{ - //include "../core/Version.as"; - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * <p>Creates a new ArrayCollection using the specified source array. - * If no array is specified an empty array will be used.</p> - * - * @param source The source Array. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function ArrayCollection(source:Array = null) - { - /*super(); - - this.source = source;*/ - } - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // source - //---------------------------------- - - [Inspectable(category="General", arrayType="Object")] - [Bindable("listChanged")] //superclass will fire this - - /** - * The source of data in the ArrayCollection. - * The ArrayCollection object does not represent any changes that you make - * directly to the source array. Always use - * the ICollectionView or IList methods to modify the collection. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function get source():Array - { - /*if (list && (list is ArrayList)) - { - return ArrayList(list).source; - }*/ - return null; - } - - /** - * @private - */ - public function set source(s:Array):void - { - //list = new ArrayList(s); - } - -} - -} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ISort.as b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ISort.as deleted file mode 100644 index 217900c..0000000 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ISort.as +++ /dev/null @@ -1,353 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package mx.collections -{ - - /** - * The <code>ISort</code> interface defines the interface for classes that - * provide the sorting information required to sort the - * data of a collection view. - * - * @see mx.collections.ICollectionView - * @see mx.collections.ISortField - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ -public interface ISort -{ - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - /** - * The method used to compare items when sorting. - * If you specify this property, Flex ignores any - * <code>compareFunction</code> properties that you specify in the - * <code>ISortField</code> objects that you use in this class. - * - * <p>The compare function must have the following signature:</p> - * - * <pre><code> - * - * function [name](a:Object, b:Object, fields:Array = null):int - * - * </code></pre> - * - * <p>This function must return the following value: - * <ul> - * <li>-1, if the <code>Object a</code> should appear before the - * <code>Object b</code> in the sorted sequence</li> - * <li>0, if the <code>Object a</code> equals the - * <code>Object b</code></li> - * <li>1, if the <code>Object a</code> should appear after the - * <code>Object b</code> in the sorted sequence</li> - * </ul></p> - * <p>To return to the internal comparision function, set this value to - * <code>null</code>.</p> - * <p> - * The <code>fields</code> array specifies the object fields - * to compare. - * Typically the algorithm will compare properties until the field list is - * exhausted or a non-zero value can be returned. - * For example:</p> - * - * <pre><code> - * function myCompare(a:Object, b:Object, fields:Array = null):int - * { - * var result:int = 0; - * var i:int = 0; - * var propList:Array = fields ? fields : internalPropList; - * var len:int = propList.length; - * var propName:String; - * while (result == 0 && (i < len)) - * { - * propName = propList[i]; - * result = compareValues(a[propName], b[propName]); - * i++; - * } - * return result; - * } - * - * function compareValues(a:Object, b:Object):int - * { - * if (a == null && b == null) - * return 0; - * - * if (a == null) - * return 1; - * - * if (b == null) - * return -1; - * - * if (a < b) - * return -1; - * - * if (a > b) - * return 1; - * - * return 0; - * } - * </code></pre> - * - * <p>The default value is an internal compare function that can perform - * a string, numeric, or date comparison in ascending or descending order. - * Specify your own function only if you need a need a custom - * comparison algorithm. This is normally only the case if a calculated - * field is used in a display.</p> - * - * <p>Alternatively you can specify separate compare functions for each - * sort field by using the <code>ISortField</code> class - * <code>compareFunction</code> property; This way you can use the default - * comparison for some fields and a custom comparison for others.</p> - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function get compareFunction():Function; - - /** - * @deprecated A future release of Apache Flex SDK will remove this function. Please use the constructor - * argument instead. - */ - function set compareFunction(value:Function):void; - - /** - * An <code>Array</code> of <code>ISortField</code> objects that - * specifies the fields to compare. - * The order of the ISortField objects in the array determines - * field priority order when sorting. - * The default sort comparator checks the sort fields in array - * order until it determinines a sort order for the two - * fields being compared. - * - * @default null - * - * @see ISortField - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function get fields():Array; - - /** - * @deprecated A future release of Apache Flex SDK will remove this function. Please use the constructor - * argument instead. - */ - function set fields(value:Array):void; - - /** - * Indicates if the sort should be unique. - * Unique sorts fail if any value or combined value specified by the - * fields listed in the fields property result in an indeterminate or - * non-unique sort order; that is, if two or more items have identical - * sort field values. An error is thrown if the sort is not unique. - * The sorting logic uses this <code>unique</code> property value only if sort - * field(s) are specified explicitly. If no sort fields are specified - * explicitly, no error is thrown even when there are identical value - * elements. - * - * @default false - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function get unique():Boolean; - - /** - * @deprecated A future release of Apache Flex SDK will remove this function. Please use the constructor - * argument instead. - */ - function set unique(value:Boolean):void; - - //-------------------------------------------------------------------------- - // - // Methods - // - //-------------------------------------------------------------------------- - - /** - * Finds the specified object within the specified array (or the insertion - * point if asked for), returning the index if found or -1 if not. - * The <code>ListCollectionView</code> class <code>find<i>xxx</i>()</code> - * methods use this method to find the requested item; as a general rule, - * it is easier to use these functions, and not <code>findItem()</code> - * to find data in <code>ListCollectionView</code>-based objects. - * You call the <code>findItem()</code> method directly when writing a - * class that supports sorting, such as a new <code>ICollectionView</code> - * implementation. - * The input items array need to be sorted before calling this function. - * Otherwise this function will not be able to find the specified value - * properly. - * - * @param items the Array within which to search. - * @param values Object containing the properties to look for (or - * the object to search for, itself). - * The object must consist of field name/value pairs, where - * the field names are names of fields specified by the - * <code>fields</code> property, in the same order they - * are used in that property. - * You do not have to specify all of the fields from the - * <code>fields</code> property, but you - * cannot skip any in the order. - * Therefore, if the <code>fields</code> - * properity lists three fields, you can specify its first - * and second fields in this parameter, but you cannot - * specify only the first and third fields. - * @param mode String containing the type of find to perform. - * Valid values are: - * <table> - * <tr> - * <th>ANY_INDEX_MODE</th> - * <th>Return any position that - * is valid for the values.</th> - * </tr> - * <tr> - * <th>FIRST_INDEX_MODE</th> - * <th>Return the position - * where the first occurrance of the values is found.</th> - * </tr> - * <tr> - * <th>LAST_INDEX_MODE</th> - * <th>Return the position where the - * last ocurrance of the specified values is found. - * </th> - * </tr> - * </table> - * @param returnInsertionIndex If the method does not find an item - * identified by the <code>values</code> parameter, - * and this parameter is <code>true</code> the - * <code>findItem()</code> - * method returns the insertion point for the values, - * that is the point in the sorted order where you - * should insert the item. - * @param compareFunction a comparator function to use to find the item. - * If you do not specify this parameter or , or if you - * provide a <code>null</code> value, - * <code>findItem()</code> function uses the - * compare function determined by the <code>ISort</code> - * instance's <code>compareFunction</code> property, - * passing in the array of fields determined - * by the values object and the current - * <code>SortFields</code>. - * - * If you provide a non-null value, <code>findItem()</code> - * function uses it as the compare function. - * - * The signature of the function passed as - * <code>compareFunction</code> must be as follows: - * <code>function myCompareFunction(a:Object, b:Object):int</code>. - * Note that there is no third argument unlike the - * compare function for <code>ISort.compareFunction()</code> - * property. - * @return int The index in the array of the found item. - * If the <code>returnInsertionIndex</code> parameter is - * <code>false</code> and the item is not found, returns -1. - * If the <code>returnInsertionIndex</code> parameter is - * <code>true</code> and the item is not found, returns - * the index of the point in the sorted array where the - * values would be inserted. - * - * @throws SortError If there are any parameter errors, - * the find critieria is not compatible with the sort - * or the comparator function for the sort can not be determined. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function findItem( - items:Array, - values:Object, - mode:String, - returnInsertionIndex:Boolean = false, - compareFunction:Function = null):int; - - /** - * Return whether the specified property is used to control the sort. - * The function cannot determine a definitive answer if the sort uses a - * custom comparator; it always returns <code>true</code> in this case. - * - * @param property The name of the field to test. - * @return Whether the property value might affect the sort outcome. - * If the sort uses the default compareFunction, returns - * <code>true</code> if the - * <code>property</code> parameter specifies a sort field. - * If the sort or any <code>ISortField</code> uses a custom comparator, - * there's no way to know, so return <code>true</code>. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function propertyAffectsSort(property:String):Boolean; - - /** - * Goes through the <code>fields</code> array and calls - * <code>reverse()</code> on each of the <code>ISortField</code> objects in - * the array. If the field was descending now it is ascending, - * and vice versa. - * - * <p>Note: an <code>ICollectionView</code> does not automatically - * update when the objects in the <code>fields</code> array are modified; - * call its <code>refresh()</code> method to update the view.</p> - * - * <p>Note: a future release of Apache Flex SDK will change the signature - * of this function to return a reversed clone of this Sort instance. See - * FLEX-34853.</p> - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function reverse():void; - - /** - * Apply the current sort to the specified array (not a copy). - * To prevent the array from being modified, create a copy - * use the copy in the <code>items</code> parameter. - * - * <p>Flex <code>ICollectionView</code> implementations call the - * <code>sort</code> method automatically and ensure that the sort is - * performed on a copy of the underlying data.</p> - * - * @param items Array of items to sort. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 4.5 - */ - function sort(items:Array):void; -} -} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as deleted file mode 100644 index 04c4e45..0000000 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/ListCollectionView.as +++ /dev/null @@ -1,668 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package mx.collections -{ - COMPILE::JS { - import goog.DEBUG; - } - import org.apache.royale.events.Event; - import org.apache.royale.events.EventDispatcher - /* - import flash.events.Event; - import flash.events.EventDispatcher; - import flash.utils.Proxy; - import flash.utils.flash_proxy; - import flash.utils.getQualifiedClassName; - - import mx.binding.utils.BindingUtils; - import mx.binding.utils.ChangeWatcher; - 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. - * - * @eventType mx.events.CollectionEvent.COLLECTION_CHANGE - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ -[Event(name="collectionChange", type="mx.events.CollectionEvent")] - -[ResourceBundle("collections")] - -/** - * The ListCollectionView class adds the properties and methods of the - * <code>ICollectionView</code> interface to an object that conforms to the - * <code>IList</code> interface. As a result, you can pass an object of this class - * to anything that requires an <code>IList</code> or <code>ICollectionView</code>. - * - * <p>This class also lets you use [ ] array notation - * to access the <code>getItemAt()</code> and <code>setItemAt()</code> methods. - * If you use code such as <code>myListCollectionView[index]</code> - * Flex calls the <code>myListCollectionView</code> object's - * <code>getItemAt()</code> or <code>setItemAt()</code> method.</p> - * - * @mxml - * - * <p>The <code><mx:ListCollectionView></code> has the following attributes, - * which all of its subclasses inherit:</p> - * - * <pre> - * <mx:ListCollectionView - * <b>Properties</b> - * filterFunction="null" - * list="null" - * sort="null" - * <b>Events</b> - * collectionChange="<i>No default</i>" - * /> - * </pre> - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ -public class ListCollectionView //extends Proxy implements ICollectionView, IList, IMXMLObject -{ - //include "../core/Version.as"; - - //-------------------------------------------------------------------------- - // - // Private variables - // - //-------------------------------------------------------------------------- - - /** - * @private - * Change watcher for complex sort fields. - */ - //private var _complexFieldWatcher:ComplexFieldChangeWatcher; - - /** - * @private - * Internal event dispatcher. - */ - private var eventDispatcher:EventDispatcher; - - //mx_internal var dispatchResetEvent:Boolean = true; - - /** - * @private - * Used for accessing localized Error messages. - */ - /* - private var resourceManager:IResourceManager = - ResourceManager.getInstance(); - */ - //-------------------------------------------------------------------------- - // - // Protected variables - // - //-------------------------------------------------------------------------- - - /** - * When the view is sorted or filtered the <code>localIndex</code> property - * contains an array of items in the sorted or filtered (ordered, reduced) - * view, in the sorted order. - * The ListCollectionView class uses this property to access the items in - * the view. - * The <code>localIndex</code> property should never contain anything - * that is not in the source, but may not have everything in the source. - * This property is <code>null</code> when there is no sort. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - protected var localIndex:Array; - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * The ListCollectionView constructor. - * - * @param list the IList this ListCollectionView is meant to wrap. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function ListCollectionView(list:IList = null) - { - super(); - - //eventDispatcher = new EventDispatcher(this); - //this.list = list; - } - - /** - * Adds a list of items to the current list, placing them at the end of - * the list in the order they are passed. - * - * @param addList IList The list of items to add to the current list - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function addAll(addList:IList):void - { - if (localIndex) - addAllAt(addList, localIndex.length); - else - addAllAt(addList, length); - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function addItem(item:Object):void - { - if (localIndex) - addItemAt(item, localIndex.length); - else - addItemAt(item, length); - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function addItemAt(item:Object, index:int):void - { - /* - if (index < 0 || !list || index > length) - { - var message:String = resourceManager.getString( - "collections", "outOfBounds", [ index ]); - - throw new RangeError(message); - } - - var listIndex:int = index; - - // if we're sorted addItemAt is meaningless, just add to the end - if (localIndex && sort) - { - listIndex = list.length; - } - else if (localIndex && filterFunction != null) - { - // if end of filtered list, put at end of source list - if (listIndex == localIndex.length) - listIndex = list.length; - // if somewhere in filtered list, find it and insert before it - // or at beginning - else - listIndex = list.getItemIndex(localIndex[index]); - } - // List is sorted or filtered but refresh has not been called - // Just add to end of list - else if (localIndex) - { - listIndex = list.length; - } - - list.addItemAt(item, listIndex); - */ - } - - /** - * Adds a list of items to the current list, placing them at the position - * index passed in to the function. The items are placed at the index location - * and placed in the order they are recieved. - * - * @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. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function addAllAt(addList:Object, index:int):void - //(addList:IList, index:int):void - { - /*if (index < 0 || index > this.length) - { - var message:String = resourceManager.getString( - "collections", "outOfBounds", [ index ]); - throw new RangeError(message); - } - - var length:int = addList.length; - - for (var i:int=0; i < length; i++) - { - var insertIndex:int = i + index; - - // incremental index may be out of bounds because of filtering, - // so add this item to the end. - if (insertIndex > this.length) - insertIndex = this.length; - - this.addItemAt(addList.getItemAt(i), insertIndex); - }*/ - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function getItemAt(index:int, prefetch:int = 0):Object - { - /* - if (index < 0 || index >= length) - { - var message:String = resourceManager.getString( - "collections", "outOfBounds", [ index ]); - - throw new RangeError(message); - } - - if (localIndex) - { - return localIndex[index]; - } - else if (list) - { - return list.getItemAt(index, prefetch); - } - */ - return null; - } - - //---------------------------------- - // length - //---------------------------------- - - [Bindable("collectionChange")] - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function get length():int - { - if (localIndex) - { - return localIndex.length; - } - /*else if (list) - { - return list.length; - }*/ - else - { - return 0; - } - } - - //---------------------------------- - // list - //---------------------------------- - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function refresh():Boolean - { - return true; //internalRefresh(true); - } - - /** - * Remove all items from the list. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function removeAll():void - { - /* - var len:int = length; - if (len > 0) - { - if (localIndex && filterFunction != null) - { - len = localIndex.length; - for (var i:int = len - 1; i >= 0; i--) - { - removeItemAt(i); - } - } - else - { - localIndex = null; - list.removeAll(); - } - } - */ - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function removeItemAt(index:int):Object - { - /* - if (index < 0 || index >= length) - { - var message:String = resourceManager.getString( - "collections", "outOfBounds", [ index ]); - throw new RangeError(message); - } - - var listIndex:int = index; - if (localIndex) - { - var oldItem:Object = localIndex[index]; - listIndex = list.getItemIndex(oldItem); - } - return list.removeItemAt(listIndex); - */ - return null; - } - - //---------------------------------- - // sort - //---------------------------------- - - /** - * @private - * Storage for the sort property. - */ - private var _sort:ISort; - - [Bindable("sortChanged")] - [Inspectable(category="General")] - - /** - * @inheritDoc - * - * @see #refresh() - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function get sort():ISort - { - return _sort; - } - - /** - * @private - */ - public function set sort(value:ISort):void - { - if(_sort != value) - { - //stopWatchingForComplexFieldsChanges(); - - _sort = value; - - //startWatchingForComplexFieldsChanges(); - - //dispatchEvent(new Event("sortChanged")); - } - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function toArray():Array - { - var ret:Array; - if (localIndex) - ret = localIndex.concat(); - /* - else - ret = list.toArray(); - */ - return ret; - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function createCursor():void - //IViewCursor - { - //return new ListCollectionViewCursor(this); - } - - //---------------------------------- - // filterFunction - //---------------------------------- - - /** - * @private - * Storage for the filterFunction property. - */ - private var _filterFunction:Function; - - [Bindable("filterFunctionChanged")] - [Inspectable(category="General")] - - /** - * @inheritDoc - * - * @see #refresh() - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function get filterFunction():Function - { - return _filterFunction; - } - - /** - * @private - */ - public function set filterFunction(f:Function):void - { - /* - _filterFunction = f; - dispatchEvent(new Event("filterFunctionChanged")); - */ - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function getItemIndex(item:Object):int - { - var i:int; - /* - if (localIndex && filterFunction != null) - { - var len:int = localIndex.length; - for (i = 0; i < len; i++) - { - if (localIndex[i] == item) - return i; - } - - return -1; - } - else if (localIndex && sort) - { - var startIndex:int = findItem(item, Sort.FIRST_INDEX_MODE); - if (startIndex == -1) - return -1; - - var endIndex:int = findItem(item, Sort.LAST_INDEX_MODE); - for (i = startIndex; i <= endIndex; i++) - { - if (localIndex[i] == item) - return i; - } - - return -1; - } - // List is sorted or filtered but refresh has not been called - else if (localIndex) - { - len = localIndex.length; - for (i = 0; i < len; i++) - { - if (localIndex[i] == item) - return i; - } - - return -1; - } - - // fallback - return list.getItemIndex(item); - */ - return i; - } - - /** - * @inheritDoc - * - * @see mx.events.CollectionEvent - * @see mx.core.IPropertyChangeNotifier - * @see mx.events.PropertyChangeEvent - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function itemUpdated(item:Object, property:Object = null, - oldValue:Object = null, - newValue:Object = null):void - { - //list.itemUpdated(item, property, oldValue, newValue); - } - - /** - * @inheritDoc - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function setItemAt(item:Object, index:int):Object - { - /* - if (index < 0 || !list || index >= length) - { - var message:String = resourceManager.getString( - "collections", "outOfBounds", [ index ]); - throw new RangeError(message); - } - - var listIndex:int = index; - if (localIndex) - { - if (index > localIndex.length) - { - listIndex = list.length; - } - else - { - var oldItem:Object = localIndex[index]; - // FIXME fails on duplicates - listIndex = list.getItemIndex(oldItem); - } - } - return list.setItemAt(item, listIndex); - */ - return null; - } - - } -} \ No newline at end of file diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as deleted file mode 100644 index dca8e8e..0000000 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Alert.as +++ /dev/null @@ -1,612 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// - -package mx.controls -{ - - COMPILE::JS { - import goog.DEBUG; - } - import org.apache.royale.events.Event; - import org.apache.royale.events.CloseEvent; - import mx.containers.Panel; - import mx.managers.ISystemManager; - import mx.core.IUIComponent; - import mx.core.FlexGlobals; - /* -import flash.events.Event; -import flash.events.EventPhase; - -import mx.controls.alertClasses.AlertForm; -import mx.core.EdgeMetrics; -import mx.core.FlexVersion; -import mx.core.IFlexDisplayObject; -import mx.core.IFlexModule; -import mx.core.IFlexModuleFactory; -import mx.core.UIComponent; -import mx.core.mx_internal; -import mx.events.CloseEvent; -import mx.events.FlexEvent; -import mx.managers.ISystemManager; -import mx.managers.PopUpManager; -import mx.resources.IResourceManager; -import mx.resources.ResourceManager; - -use namespace mx_internal; -*/ -//-------------------------------------- -// Styles -//-------------------------------------- - -/** - * Name of the CSS style declaration that specifies - * styles for the Alert buttons. - * - * @default "alertButtonStyle" - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ -//[Style(name="buttonStyleName", type="String", inherit="no")] - -/** - * Name of the CSS style declaration that specifies - * styles for the Alert message text. - * - * <p>You only set this style by using a type selector, which sets the style - * for all Alert controls in your application. - * If you set it on a specific instance of the Alert control, it can cause the control to - * size itself incorrectly.</p> - * - * @default undefined - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ -//[Style(name="messageStyleName", type="String", inherit="no")] - -/** - * Name of the CSS style declaration that specifies styles - * for the Alert title text. - * - * <p>You only set this style by using a type selector, which sets the style - * for all Alert controls in your application. - * If you set it on a specific instance of the Alert control, it can cause the control to - * size itself incorrectly.</p> - * - * @default "windowStyles" - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ -//[Style(name="titleStyleName", type="String", inherit="no")] - -//-------------------------------------- -// Other metadata -//-------------------------------------- - -//[AccessibilityClass(implementation="mx.accessibility.AlertAccImpl")] - -//[RequiresDataBinding(true)] - -//[ResourceBundle("controls")] - -/** - * The Alert control is a pop-up dialog box that can contain a message, - * a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon. - * The Alert control is modal, which means it will retain focus until the user closes it. - * - * <p>Import the mx.controls.Alert class into your application, - * and then call the static <code>show()</code> method in ActionScript to display - * an Alert control. You cannot create an Alert control in MXML.</p> - * - * <p>The Alert control closes when you select a button in the control, - * or press the Escape key.</p> - * - * @includeExample examples/SimpleAlert.mxml - * - * @see mx.managers.SystemManager - * @see mx.managers.PopUpManager - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ -public class Alert extends Panel -{ - //include "../core/Version.as"; - - //-------------------------------------------------------------------------- - // - // Class constants - // - //-------------------------------------------------------------------------- - - /** - * Value that enables a Yes button on the Alert control when passed - * as the <code>flags</code> parameter of the <code>show()</code> method. - * You can use the | operator to combine this bitflag - * with the <code>OK</code>, <code>CANCEL</code>, - * <code>NO</code>, and <code>NONMODAL</code> flags. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static const YES:uint = 0x0001; - - /** - * Value that enables a No button on the Alert control when passed - * as the <code>flags</code> parameter of the <code>show()</code> method. - * You can use the | operator to combine this bitflag - * with the <code>OK</code>, <code>CANCEL</code>, - * <code>YES</code>, and <code>NONMODAL</code> flags. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static const NO:uint = 0x0002; - - /** - * Value that enables an OK button on the Alert control when passed - * as the <code>flags</code> parameter of the <code>show()</code> method. - * You can use the | operator to combine this bitflag - * with the <code>CANCEL</code>, <code>YES</code>, - * <code>NO</code>, and <code>NONMODAL</code> flags. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static const OK:uint = 0x0004; - - /** - * Value that enables a Cancel button on the Alert control when passed - * as the <code>flags</code> parameter of the <code>show()</code> method. - * You can use the | operator to combine this bitflag - * with the <code>OK</code>, <code>YES</code>, - * <code>NO</code>, and <code>NONMODAL</code> flags. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static const CANCEL:uint= 0x0008; - - /** - * Value that makes an Alert nonmodal when passed as the - * <code>flags</code> parameter of the <code>show()</code> method. - * You can use the | operator to combine this bitflag - * with the <code>OK</code>, <code>CANCEL</code>, - * <code>YES</code>, and <code>NO</code> flags. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static const NONMODAL:uint = 0x8000; - - //-------------------------------------------------------------------------- - // - // Class mixins - // - //-------------------------------------------------------------------------- - - /** - * @private - * Placeholder for mixin by AlertAccImpl. - */ - //mx_internal static var createAccessibilityImplementation:Function; - - //-------------------------------------------------------------------------- - // - // Class variables - // - //-------------------------------------------------------------------------- - - /** - * @private - * Storage for the resourceManager getter. - * 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 _resourceManager:IResourceManager; - - /** - * @private - */ - //private static var initialized:Boolean = false; - - //-------------------------------------------------------------------------- - // - // Class properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // buttonHeight - //---------------------------------- - - //[Inspectable(category="Size")] - - /** - * Height of each Alert button, in pixels. - * All buttons must be the same height. - * - * @default 22 - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - //public static var buttonHeight:Number = 22; - - //---------------------------------- - // buttonWidth - //---------------------------------- - - //[Inspectable(category="Size")] - - /** - * Width of each Alert button, in pixels. - * All buttons must be the same width. - * - * @default 65 - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - //public static var buttonWidth:Number = 65; - - //---------------------------------- - // cancelLabel - //---------------------------------- - /** - * @private - * Storage for the cancelLabel property. - */ - //private static var _cancelLabel:String; - - /** - * @private - */ - //private static var cancelLabelOverride:String; - - //[Inspectable(category="General")] - - //---------------------------------- - // noLabel - //---------------------------------- - - /** - * @private - * Storage for the noLabel property. - */ - //private static var _noLabel:String; - - /** - * @private - */ - //private static var noLabelOverride:String; - - //[Inspectable(category="General")] - - /** - * @private - * Storage for the okLabel property. - */ - //private static var _okLabel:String; - - /** - * @private - */ - //private static var okLabelOverride:String; - - //[Inspectable(category="General")] - - /** - * @private - * Storage for the yesLabel property. - */ - //private static var _yesLabel:String; - - /** - * @private - */ - //private static var yesLabelOverride:String; - - //[Inspectable(category="General")] - - //-------------------------------------------------------------------------- - // - // Class methods - // - //-------------------------------------------------------------------------- - - /** - * Static method that pops up the Alert control. The Alert control - * closes when you select a button in the control, or press the Escape key. - * - * @param text Text string that appears in the Alert control. - * This text is centered in the alert dialog box. - * - * @param title Text string that appears in the title bar. - * This text is left justified. - * - * @param flags Which buttons to place in the Alert control. - * Valid values are <code>Alert.OK</code>, <code>Alert.CANCEL</code>, - * <code>Alert.YES</code>, and <code>Alert.NO</code>. - * The default value is <code>Alert.OK</code>. - * Use the bitwise OR operator to display more than one button. - * For example, passing <code>(Alert.YES | Alert.NO)</code> - * displays Yes and No buttons. - * Regardless of the order that you specify buttons, - * they always appear in the following order from left to right: - * OK, Yes, No, Cancel. - * - * @param parent Object upon which the Alert control centers itself. - * - * @param closeHandler Event handler that is called when any button - * on the Alert control is pressed. - * The event object passed to this handler is an instance of CloseEvent; - * the <code>detail</code> property of this object contains the value - * <code>Alert.OK</code>, <code>Alert.CANCEL</code>, - * <code>Alert.YES</code>, or <code>Alert.NO</code>. - * - * @param iconClass Class of the icon that is placed to the left - * of the text in the Alert control. - * - * @param defaultButtonFlag A bitflag that specifies the default button. - * You can specify one and only one of - * <code>Alert.OK</code>, <code>Alert.CANCEL</code>, - * <code>Alert.YES</code>, or <code>Alert.NO</code>. - * The default value is <code>Alert.OK</code>. - * Pressing the Enter key triggers the default button - * just as if you clicked it. Pressing Escape triggers the Cancel - * or No button just as if you selected it. - * - * @param moduleFactory The moduleFactory where this Alert should look for - * its embedded fonts and style manager. - * - * @return A reference to the Alert control. - * - * @see mx.events.CloseEvent - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public static function show(text:String = "", title:String = "", - flags:uint = 0x4 /* Alert.OK */, - //parent:Sprite = null, - parent:IUIComponent = null, - closeHandler:Function = null, - iconClass:Class = null, - defaultButtonFlag:uint = 0x4 /* Alert.OK */, - moduleFactory:Object = null):Alert - //moduleFactory:IFlexModuleFactory = null):Alert - { - var modal:Boolean = (flags & Alert.NONMODAL) ? false : true; - - if (!parent) - { - var sm:ISystemManager = ISystemManager(FlexGlobals.topLevelApplication.systemManager); - // no types so no dependencies - var mp:Object; //= sm.getImplementation("mx.managers::IMarshalSystemManager"); - //if (mp && mp.useSWFBridge()) - // parent = Sprite(sm.getSandboxRoot()); - //else - // parent = Sprite(FlexGlobals.topLevelApplication); - } - - var alert:Alert = new Alert(); - /* - if (flags & Alert.OK|| - flags & Alert.CANCEL || - flags & Alert.YES || - flags & Alert.NO) - { - alert.buttonFlags = flags; - } - - if (defaultButtonFlag == Alert.OK || - defaultButtonFlag == Alert.CANCEL || - defaultButtonFlag == Alert.YES || - defaultButtonFlag == Alert.NO) - { - alert.defaultButtonFlag = defaultButtonFlag; - } - - alert.text = text; - alert.title = title;*/ - //alert.iconClass = iconClass; - - if (closeHandler != null) - alert.addEventListener(CloseEvent.CLOSE, closeHandler); - - // Setting a module factory allows the correct embedded font to be found. - /*if (moduleFactory) - alert.moduleFactory = moduleFactory; - else if (parent is IFlexModule) - alert.moduleFactory = IFlexModule(parent).moduleFactory; - else - { - if (parent is IFlexModuleFactory) - alert.moduleFactory = IFlexModuleFactory(parent); - else - alert.moduleFactory = FlexGlobals.topLevelApplication.moduleFactory; - - // also set document if parent isn't a UIComponent - if (!parent is UIComponent) - alert.document = FlexGlobals.topLevelApplication.document; - } - - alert.addEventListener(FlexEvent.CREATION_COMPLETE, static_creationCompleteHandler); - PopUpManager.addPopUp(alert, parent, modal);*/ - - return alert; - } - - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - */ - public function Alert() - { - super(); - - // Panel properties. - //title = ""; - } - - //-------------------------------------------------------------------------- - // - // Overridden properties - // - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // - // Properties - // - //-------------------------------------------------------------------------- - - //---------------------------------- - // alertForm - //---------------------------------- - - /** - * @private - * The internal AlertForm object that contains the text, icon, and buttons - * of the Alert control. - */ - //mx_internal var alertForm:AlertForm; - - //---------------------------------- - // buttonFlags - //---------------------------------- - - /** - * A bitmask that contains <code>Alert.OK</code>, <code>Alert.CANCEL</code>, - * <code>Alert.YES</code>, and/or <code>Alert.NO</code> indicating - * the buttons available in the Alert control. - * - * @default Alert.OK - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - * @royalesuppresspublicvarwarning - */ - //public var buttonFlags:uint = OK; - - //---------------------------------- - // defaultButtonFlag - //---------------------------------- - - //[Inspectable(category="General")] - - /** - * A bitflag that contains either <code>Alert.OK</code>, - * <code>Alert.CANCEL</code>, <code>Alert.YES</code>, - * or <code>Alert.NO</code> to specify the default button. - * - * @default Alert.OK - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - * @royalesuppresspublicvarwarning - */ - //public var defaultButtonFlag:uint = OK; - - //---------------------------------- - // iconClass - //---------------------------------- - - //[Inspectable(category="Other")] - - /** - * The class of the icon to display. - * You typically embed an asset, such as a JPEG or GIF file, - * and then use the variable associated with the embedded asset - * to specify the value of this property. - * - * @default null - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - * @royalesuppresspublicvarwarning - */ - //public var iconClass:Class; - - //---------------------------------- - // text - //---------------------------------- - - //[Inspectable(category="General")] - - /** - * The text to display in this alert dialog box. - * - * @default "" - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Royale 0.9.3 - * @royalesuppresspublicvarwarning - */ - //public var text:String = ""; - -} - -} -- To stop receiving notification emails like this one, please contact [email protected].
