This is an automated email from the ASF dual-hosted git repository.
pushminakazi pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new a6427d6 Added executeBindings() in UIComponent.as and Added
Binding.as,IBindingClient.as,BindingManager.as,UIComponentDescriptor.as and
ComponentDescriptor.as in MXRoyale
a6427d6 is described below
commit a6427d602680d0fb7c73661778be048207325617
Author: pashminakazi <[email protected]>
AuthorDate: Wed Jun 23 07:13:17 2021 -0700
Added executeBindings() in UIComponent.as and Added
Binding.as,IBindingClient.as,BindingManager.as,UIComponentDescriptor.as and
ComponentDescriptor.as in MXRoyale
---
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 5 +
.../MXRoyale/src/main/royale/mx/binding/Binding.as | 554 +++++++++++++++++++++
.../src/main/royale/mx/binding/BindingManager.as | 275 ++++++++++
.../src/main/royale/mx/binding/IBindingClient.as | 35 ++
.../src/main/royale/mx/core/ComponentDescriptor.as | 436 ++++++++++++++++
.../src/main/royale/mx/core/UIComponent.as | 52 +-
.../main/royale/mx/core/UIComponentDescriptor.as | 208 ++++++++
7 files changed, 1563 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index aff013c..d0d9baf 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -390,6 +390,11 @@ internal class MXRoyaleClasses
import mx.core.IBorder; IBorder;
import mx.core.IRectangularBorder; IRectangularBorder;
import mx.events.EventPhase; EventPhase;
+ import mx.core.ComponentDescriptor; ComponentDescriptor;
+ import mx.core.UIComponentDescriptor; UIComponentDescriptor;
+ import mx.binding.Binding; Binding;
+ import mx.binding.IBindingClient; IBindingClient;
+ import mx.binding.BindingManager; BindingManager;
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/binding/Binding.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/Binding.as
new file mode 100644
index 0000000..3c7c94b
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/Binding.as
@@ -0,0 +1,554 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.binding
+{
+
+import mx.collections.errors.ItemPendingError;
+import mx.core.mx_internal;
+//import flash.utils.Dictionary;
+
+use namespace mx_internal;
+
+//[ExcludeClass]
+
+/**
+ * @private
+ */
+public class Binding
+{
+ //include "../core/Version.as";
+
+ // Certain errors are normal during binding execution, so we swallow them.
+ // 1507 - invalid null argument
+ // 2005 - argument error (null gets converted to 0)
+ mx_internal static var allowedErrors:Object = generateAllowedErrors();
+ mx_internal static function generateAllowedErrors():Object
+ {
+ var o:Object = {};
+ o[1507] = 1;
+ o[2005] = 1;
+ return o;
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Create a Binding object
+ *
+ * @param document The document that is the target of all of this work.
+ *
+ * @param srcFunc The function that returns us the value
+ * to use in this Binding.
+ *
+ * @param destFunc The function that will take a value
+ * and assign it to the destination.
+ *
+ * @param destString The destination represented as a String.
+ * We can then tell the ValidationManager to validate this field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Binding(document:Object, srcFunc:Function,
+ destFunc:Function,
destString:String,
+ srcString:String = null)
+ {
+ super();
+
+ this.document = document;
+ this.srcFunc = srcFunc;
+ this.destFunc = destFunc;
+ this.destString = destString;
+ this.srcString = srcString;
+ this.destFuncFailed = false;
+
+ if (this.srcFunc == null)
+ {
+ this.srcFunc = defaultSrcFunc;
+ }
+
+ if (this.destFunc == null)
+ {
+ this.destFunc = defaultDestFunc;
+ }
+
+ _isEnabled = true;
+ isExecuting = false;
+ isHandlingEvent = false;
+ hasHadValue = false;
+ uiComponentWatcher = -1;
+
+ BindingManager.addBinding(document, destString, this);
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Internal storage for isEnabled property.
+ */
+ mx_internal var _isEnabled:Boolean;
+
+ /**
+ * @private
+ * Indicates that a Binding is enabled.
+ * Used to disable bindings.
+ */
+ mx_internal function get isEnabled():Boolean
+ {
+ return _isEnabled;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set isEnabled(value:Boolean):void
+ {
+ _isEnabled = value;
+
+ if (value)
+ {
+ processDisabledRequests();
+ }
+ }
+
+ /**
+ * @private
+ * Indicates that a Binding is executing.
+ * Used to prevent circular bindings from causing infinite loops.
+ */
+ mx_internal var isExecuting:Boolean;
+
+ /**
+ * @private
+ * Indicates that the binding is currently handling an event.
+ * Used to prevent us from infinitely causing an event
+ * that re-executes the the binding.
+ */
+ mx_internal var isHandlingEvent:Boolean;
+
+ /**
+ * @private
+ * Queue of watchers that fired while we were disabled.
+ * We will resynch with our binding if isEnabled is set to true
+ * and one or more of our watchers fired while we were disabled.
+ */
+ //mx_internal var disabledRequests:Dictionary;
+ mx_internal var disabledRequests:Object;
+
+ /**
+ * @private
+ * True as soon as a non-null or non-empty-string value has been used.
+ * We don't auto-validate until this is true
+ */
+ private var hasHadValue:Boolean;
+
+ /**
+ * @private
+ * This is no longer used in Flex 3.0, but it is required to load
+ * Flex 2.0.0 and Flex 2.0.1 modules.
+ */
+ public var uiComponentWatcher:int;
+
+ /**
+ * @private
+ * It's possible that there is a two-way binding set up, in which case
+ * we'll do a rudimentary optimization by not executing ourselves
+ * if our counterpart is already executing.
+ */
+ public var twoWayCounterpart:Binding;
+
+ /**
+ * @private
+ * If there is a twoWayCounterpart, hasHadValue is false, and
+ * isTwoWayPrimary is true, then the twoWayCounterpart will be
+ * executed first.
+ */
+ public var isTwoWayPrimary:Boolean;
+
+ /**
+ * @private
+ * True if a wrapped function call does not throw an error. This is used
by
+ * innerExecute() to tell if the srcFunc completed successfully.
+ */
+ private var wrappedFunctionSuccessful:Boolean;
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * All Bindings hang off of a document for now,
+ * but really it's just the root of where these functions live.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var document:Object;
+
+ /**
+ * The function that will return us the value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var srcFunc:Function;
+
+ /**
+ * The function that takes the value and assigns it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var destFunc:Function;
+
+ /**
+ * @private
+ */
+ mx_internal var destFuncFailed:Boolean;
+
+ /**
+ * The destination represented as a String.
+ * This will be used so we can signal validation on a field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var destString:String;
+
+ /**
+ * The source represented as a String.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ mx_internal var srcString:String;
+
+ /**
+ * @private
+ * Used to suppress calls to destFunc when incoming value is either
+ * a) an XML node identical to the previously assigned XML node, or
+ * b) an XMLList containing the identical node sequence as the
previously assigned XMLList
+ */
+ private var lastValue:Object;
+
+
+
//--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+
//--------------------------------------------------------------------------
+
+ private function defaultDestFunc(value:Object):void
+ {
+ var chain:Array = destString.split(".");
+ var element:Object = document;
+ var i:uint = 0;
+
+ if (chain[0] == "this")
+ {
+ i++;
+ }
+
+ while (i < (chain.length - 1))
+ {
+ element = element[chain[i++]];
+ //if the element does not exist : avoid exception as it's heavy on
memory allocations
+ if (element == null) {
+ destFuncFailed = true;
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error =
1009");
+ }
+ return;
+ }
+ }
+
+ element[chain[i]] = value;
+ }
+
+ private function defaultSrcFunc():Object
+ {
+ return document[srcString];
+ }
+
+ /**
+ * Execute the binding.
+ * Call the source function and get the value we'll use.
+ * Then call the destination function passing the value as an argument.
+ * Finally try to validate the destination.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function execute(o:Object = null):void
+ {
+ if (!isEnabled)
+ {
+ if (o != null)
+ {
+ registerDisabledExecute(o);
+ }
+ return;
+ }
+
+ if (twoWayCounterpart && !twoWayCounterpart.hasHadValue &&
twoWayCounterpart.isTwoWayPrimary)
+ {
+ twoWayCounterpart.execute();
+ hasHadValue = true;
+ return;
+ }
+
+ if (isExecuting || (twoWayCounterpart &&
twoWayCounterpart.isExecuting))
+ {
+ // If there is a twoWayCounterpart already executing, that means
that it is
+ // assigning something of value so even though we won't execute we
should be
+ // sure to mark ourselves as having had a value so that future
executions will
+ // be correct. If isExecuting is true but we re-entered, that
means we
+ // clearly had a value so setting hasHadValue is safe.
+ hasHadValue = true;
+ return;
+ }
+
+ try
+ {
+ isExecuting = true;
+ wrapFunctionCall(this, innerExecute, o);
+ }
+ catch(error:Error)
+ {
+ /* if (allowedErrors[error.errorID] == null)
+ throw error; */
+ }
+ finally
+ {
+ isExecuting = false;
+ }
+ }
+
+ /**
+ * @private
+ * Take note of any execute request that occur when we are disabled.
+ */
+ private function registerDisabledExecute(o:Object):void
+ {
+ if (o != null)
+ {
+ disabledRequests = (disabledRequests != null) ? disabledRequests :
+ new Object();
+ //new Dictionary(true);
+
+ disabledRequests[o] = true;
+ }
+ }
+
+ /**
+ * @private
+ * Resynch with any watchers that may have updated while we were disabled.
+ */
+ private function processDisabledRequests():void
+ {
+ if (disabledRequests != null)
+ {
+ for (var key:Object in disabledRequests)
+ {
+ execute(key);
+ }
+
+ disabledRequests = null;
+ }
+ }
+
+
+ /**
+ * @private
+ * Note: use of this wrapper needs to be reexamined. Currently there's
at least one situation where a
+ * wrapped function invokes another wrapped function, which is
unnecessary (i.e., only the inner function
+ * will throw), and also risks future errors due to the
'wrappedFunctionSuccessful' member variable
+ * being stepped on. Leaving alone for now to minimize pre-GMC
volatility, but should be revisited for
+ * an early dot release.
+ * Also note that the set of suppressed error codes below is repeated
verbatim in Watcher.wrapUpdate.
+ * These need to be consolidated and the motivations for each need to
be documented.
+ */
+ protected function wrapFunctionCall(thisArg:Object,
wrappedFunction:Function, object:Object = null, ...args):Object
+ {
+ wrappedFunctionSuccessful = false;
+
+ try
+ {
+ var result:Object = wrappedFunction.apply(thisArg, args);
+ if(destFuncFailed == true) {
+ destFuncFailed = false;
+ return null;
+ }
+ wrappedFunctionSuccessful = true;
+ return result;
+ }
+ catch(error:Error)
+ {
+ if (error is ItemPendingError) {
+ //(error as ItemPendingError).addResponder(new
EvalBindingResponder(this, object));
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error
= " + error);
+ }
+ } else if (error is RangeError) {
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error
= " + error);
+ }
+ } else {
+ // Certain errors are normal when executing a srcFunc or
destFunc,
+ // so we swallow them:
+ // Error #1006: Call attempted on an object that is not a
function.
+ // Error #1009: null has no properties.
+ // Error #1010: undefined has no properties.
+ // Error #1055: - has no properties.
+ // Error #1069: Property - not found on - and there is no
default value
+ // We allow any other errors to be thrown.
+ /* if ((error.errorID != 1006) &&
+ (error.errorID != 1009) &&
+ (error.errorID != 1010) &&
+ (error.errorID != 1055) &&
+ (error.errorID != 1069))
+ {
+ throw error;
+ } */
+ if(error)
+ {
+
+ }
+ else
+ {
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ",
error = " + error);
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @private
+ * true if XMLLists x and y contain the same node sequence.
+ */
+ private static function nodeSeqEqual(x:XMLList, y:XMLList):Boolean
+ {
+ var n:uint = x.length();
+ if (n == y.length())
+ {
+ for (var i:uint = 0; i < n && x[i] === y[i]; i++)
+ {
+ }
+ return i == n;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function innerExecute():void
+ {
+ destFuncFailed = false;
+ var value:Object = wrapFunctionCall(document, srcFunc);
+
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", srcFunc result =
" + value);
+ }
+
+ if (hasHadValue || wrappedFunctionSuccessful)
+ {
+ // Suppress binding assignments on non-simple XML:
identical single nodes, or
+ // lists over identical node sequences.
+ // Note: outer tests are inline for efficiency
+ if (!(lastValue is XML && lastValue.hasComplexContent() &&
lastValue === value) &&
+ !(lastValue is XMLList && lastValue.hasComplexContent()
&& value is XMLList &&
+ nodeSeqEqual(lastValue as XMLList, value as
XMLList)))
+ {
+ destFunc.call(document, value);
+
+ if(destFuncFailed == false) {
+ // Note: state is not updated if destFunc throws
+ lastValue = value;
+ hasHadValue = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * This function is called when one of this binding's watchers
+ * detects a property change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function watcherFired(commitEvent:Boolean, cloneIndex:int):void
+ {
+ if (isHandlingEvent)
+ return;
+
+ try
+ {
+ isHandlingEvent = true;
+ execute(cloneIndex);
+ }
+ finally
+ {
+ isHandlingEvent = false;
+ }
+ }
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/binding/BindingManager.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/BindingManager.as
new file mode 100644
index 0000000..cb0fda9
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/BindingManager.as
@@ -0,0 +1,275 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.binding
+{
+
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+//[ExcludeClass]
+
+/**
+ * @private
+ */
+public class BindingManager
+{
+ //include "../core/Version.as";
+
+
//--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Store a Binding for the destination relative to the passed in document.
+ * We don't hold a list of bindings per destination
+ * even though it is possible to have multiple.
+ * The reason is that when we refresh the last binding will
+ * always win anyway, so why execute the ones that will lose.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field of this binding.
+ *
+ * @param b The binding itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function addBinding(document:Object, destStr:String,
+
b:Binding):void
+ {
+ if (!document._bindingsByDestination)
+ {
+ document._bindingsByDestination = {};
+ document._bindingsBeginWithWord = {};
+ }
+
+ document._bindingsByDestination[destStr] = b;
+ document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
+ }
+
+ /**
+ * Set isEnabled for all bindings associated with a document.
+ *
+ * @param document The document that contains the bindings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setEnabled(document:Object, isEnabled:Boolean):void
+ {
+ if ((document is IBindingClient) && document._bindings)
+ {
+ var bindings:Array = document._bindings as Array;
+
+ for (var i:uint = 0; i < bindings.length; i++)
+ {
+ var binding:Binding = bindings[i];
+ binding.isEnabled = isEnabled;
+ }
+ }
+ }
+
+ /**
+ * Execute all bindings that bind into the specified object.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field that needs to be refreshed.
+ *
+ * @param destObj The actual destination object
+ * (used for RepeatableBinding).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function executeBindings(document:Object,
+ destStr:String,
+
destObj:Object):void
+ {
+ // Bail if this method is accidentally called with an empty or
+ // null destination string. Otherwise, all bindings will
+ // be executed!
+ if (!destStr || (destStr == ""))
+ return;
+
+ // Flex 3 documents will implement IBindingClient when using
+ // data binding. Flex 2.X document's will have a non-null
+ // public _bindingsByDestination variable.
+ if (document &&
+ (document is IBindingClient ||
document.hasOwnProperty("_bindingsByDestination")) &&
+ document._bindingsByDestination &&
+ document._bindingsBeginWithWord[getFirstWord(destStr)])
+ {
+ for (var binding:String in document._bindingsByDestination)
+ {
+ // If we have been told to execute bindings into a UIComponent
+ // or Repeater with id "a", we want to execute all bindings
+ // whose destination strings look like "a", "a.b", "a.b.c",
+ // "a['b']", etc. but not "aa.bb", "b.a", "b.a.c", "b['a']",
+ // etc.
+
+ // Currently, the only way that this method is used by the
+ // framework is when the destStr passed in is the id of a
+ // UIComponent or Repeater.
+
+ // However, advanced users can call
+ // BindingManager.executeBindings() and pass a compound
+ // destStr like "a.b.c". This has a gotcha: If they have
+ // written <mx:Binding> tags with destination attributes
+ // like "a['b'].c.d" rather than "a.b.c.d", these will
+ // not get executed. They should pass the same form of
+ // destStr to executeBindings() as they used in their
+ // Binding tags.
+
+ if (binding.charAt(0) == destStr.charAt(0))
+ {
+ var length:int = destStr.length;
+ if (
+ //check if binding start with destStr+"." or
destStr+"[" with a minimum number of string allocations
+ (length < binding.length && binding.indexOf(destStr) ==
0 && (binding.charAt(length) == "." || binding.charAt(length) == "["))
+ || binding == destStr)
+ {
+ // If this is a RepeatableBindings, execute it on just
the
+ // specified object, not on all its repeated siblings.
For
+ // example, if we are instantiating o[2][3], we don't
want to also
+ // refresh o[0][0], o[0][1], etc.
+
document._bindingsByDestination[binding].execute(destObj);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Enable or disable all bindings that bind into the specified object
+ * and match the input destStr.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field that needs to be refreshed.
+ *
+ * @param enable If true enables the specified binding(s), otherwise
+ * disables.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2/5
+ * @productversion Flex 4.5
+ */
+ public static function enableBindings(document:Object,
+ destStr:String,
+ enable:Boolean = true):void
+ {
+ // See implementation comments above for executeBindings as this
+ // method follows the same logic.
+
+ if (!destStr || (destStr == ""))
+ return;
+
+ if (document &&
+ (document is IBindingClient ||
document.hasOwnProperty("_bindingsByDestination")) &&
+ document._bindingsByDestination &&
+ document._bindingsBeginWithWord[getFirstWord(destStr)])
+ {
+ for (var binding:String in document._bindingsByDestination)
+ {
+ if (binding.charAt(0) == destStr.charAt(0))
+ {
+ if (binding.indexOf(destStr + ".") == 0 ||
+ binding.indexOf(destStr + "[") == 0 ||
+ binding == destStr)
+ {
+ document._bindingsByDestination[binding].isEnabled =
enable;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private static function getFirstWord(destStr:String):String
+ {
+ // indexPeriod and indexBracket will be equal only if they
+ // both are -1.
+ var indexPeriod:int = destStr.indexOf(".");
+ var indexBracket:int = destStr.indexOf("[");
+ if (indexPeriod == indexBracket)
+ return destStr;
+
+ // Get the characters leading up to the first period or
+ // bracket.
+ var minIndex:int = Math.min(indexPeriod, indexBracket);
+ if (minIndex == -1)
+ minIndex = Math.max(indexPeriod, indexBracket);
+
+ return destStr.substr(0, minIndex);
+ }
+
+ /**
+ * @private
+ */
+ internal static var debugDestinationStrings:Object = {};
+
+ /**
+ * Enables debugging output for the Binding or Bindings with a matching
+ * destination string.
+ *
+ * @param destinationString The Binding's destination string.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function debugBinding(destinationString:String):void
+ {
+ debugDestinationStrings[destinationString] = true;
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * BindingManager has only static methods.
+ * We don't create instances of BindingManager.
+ */
+ public function BindingManager()
+ {
+ super();
+ }
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/binding/IBindingClient.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/IBindingClient.as
new file mode 100644
index 0000000..dfe6950
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/IBindingClient.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.binding
+{
+
+/**
+ * This is used to mark documents, which have data bindings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IBindingClient
+{
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ComponentDescriptor.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ComponentDescriptor.as
new file mode 100644
index 0000000..5d75ef5
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ComponentDescriptor.as
@@ -0,0 +1,436 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * ComponentDescriptor is the base class for the UIComponentDescriptor class,
+ * which encapsulates the information that you specified in an MXML tag
+ * for an instance of a visual component.
+ * In Flex, non-visual components are treated differently and do not
+ * have descriptors, but in a future version the ComponentDescriptor
+ * base class may be used for them as well.
+ *
+ * <p>Most of the tags in an MXML file describe a tree of UIComponent objects.
+ * For example, the <code><mx:Application></code> tag represents a
+ * UIComponent object, and its child containers and controls are all
+ * UIComponent objects.</p>
+ *
+ * <p>The MXML compiler compiles each of these MXML tags into a
+ * UIComponentDescriptor instance.
+ * To be precise, the MXML compiler autogenerates an ActionScript
+ * data structure which is a tree of UIComponentDescriptor objects.</p>
+ *
+ * <p>At runtime, the <code>createComponentsFromDescriptors()</code> method
+ * of the Container class uses the information in the UIComponentDescriptor
+ * objects in the container's <code>childDescriptors</code> array to create
+ * the actual UIComponent objects that are the container's children,
+ * plus deeper descendants as well.
+ * Depending on the value of the container's <code>creationPolicy</code>,
+ * property, the descendants might be created at application startup,
+ * when some part of the component is about to become visible,
+ * or when the application developer manually calls
+ * the <code>createComponentsFromDescriptors()</code> method.</p>
+ *
+ * <p>You do not typically create ComponentDescriptor or UIComponentDescriptor
+ * instances yourself; you can access the ones that the MXML compiler
+ * autogenerates, via the <code>childDescriptors</code> array
+ * of the Container class.</p>
+ *
+ * @see mx.core.UIComponentDescriptor
+ * @see mx.core.Container#childDescriptors
+ * @see mx.core.Container#creationPolicy
+ * @see mx.core.Container#createComponentsFromDescriptors()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ComponentDescriptor
+{
+ //include "../core/Version.as";
+
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param descriptorProperties An Object containing name/value pairs
+ * for the properties of the ComponentDescriptor object, such as its
+ * <code>type</code>, <code>id</code>, <code>propertiesFactory</code>
+ * and <code>events</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ComponentDescriptor(descriptorProperties:Object)
+ {
+ super();
+
+ for (var p:String in descriptorProperties)
+ {
+ this[p] = descriptorProperties[p];
+ }
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // document
+ //----------------------------------
+
+ /**
+ * A reference to the document Object in which the component
+ * is to be created.
+ *
+ * @see mx.core.IUIComponent#document
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var document:Object;
+
+ //----------------------------------
+ // events
+ //----------------------------------
+
+ /**
+ * An Object containing name/value pairs for the component's
+ * event handlers, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:DataGrid id="dg" initialize="fetchData(); initDataGrid();"
change="changeHandler(event);"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>events</code> property is the Object</p>
+ *
+ * <pre>
+ * { initialize: "__dg_initialize", change: "__dg_change" }
+ * </pre>
+ *
+ * <p>The <code>event</code>property is <code>null</code>
+ * if no MXML event handlers were specified for the component</p>
+ *
+ * <p>The strings <code>"__dg_initialize"</code>
+ * and <code>"__dg_change"</code> are the names of event handler
+ * methods that the MXML compiler autogenerates.
+ * The body of these methods contain the ActionScript statements
+ * that you specified as the values of the event attributes.
+ * For example, the autogenerated <code>initialize</code> handler is</p>
+ *
+ * <pre>
+ * public function __dg_initialize(event:mx.events.FlexEvent):void
+ * {
+ * fetchData();
+ * initDataGrid();
+ * }
+ * </pre>
+ *
+ * <p>You should not assume that the autogenerated event handlers
+ * will always be specified by name; this may change in a future
+ * version of Flex.</p>
+ *
+ * <p>This property is used by the Container method
+ * <code>createComponentsFromDescriptors()</code>
+ * to register the autogenerated event handlers
+ * using the <code>addEventListener()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var events:Object;
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * The identifier for the component, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput id="firstName" text="Enter your first name here"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>id</code> property is the String
+ * <code>"firstName"</code>.</p>
+ *
+ * <p>The <code>id</code> property is <code>null</code>
+ * if no MXML id was specified for the component.</p>
+ *
+ * <p>The value of the <code>id</code> property becomes the name
+ * of a public variable in the MXML document object,
+ * autogenerated by the MXML compiler.
+ * The value of this variable is a reference to the UIComponent object
+ * created from this descriptor.
+ * This is why you can, for example, reference the TextInput control's
+ * <code>text</code> property as <code>firstName.text</code>
+ * from anywhere within the document containing this TextInput
instance.</p>
+ *
+ * <p>If an <code>id</code> is specified, and it isn't the empty string,
+ * it also becomes the <code>name</code> of the DisplayObject object.
+ * If an <code>id</code> is not specified or is empty, the DisplayObject
+ * object's <code>name</code> remains an autogenerated string,
+ * such as <code>"Button3"</code>, as returned by the
+ * <code>NameUtil.createUniqueName()</code> method.
+ * The <code>name</code> is used in generating the string returned
+ * by the <code>toString()</code> method.
+ * It can also be used to find the component from its parent
+ * by calling <code>getChildByName()</code>.</p>
+ *
+ * @see flash.display.DisplayObject#name
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var id:String;
+
+ //----------------------------------
+ // properties
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _properties:Object;
+
+ /**
+ * An Object containing name/value pairs for the component's properties,
+ * as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput width="150" text="Hello"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>properties</code> property
+ * is the Object</p>
+ *
+ * <pre>
+ * { width: 150, text: "Hello" }
+ * </pre>
+ *
+ * <p>The <code>properties</code> property is <code>null</code>
+ * if no MXML properties were specified for the component.
+ * In this case, the component will use default property values.</p>
+ *
+ * <p> This Object is produced by calling the function specified by the
+ * <code>propertiesFactory</code> property, and then cached
+ * for subsequent access.
+ * However, when a Repeater produces multiple instances of a component
+ * from the same descriptor, a fresh copy of the <code>properties</code>
+ * Object should be produced for each component instance so that they
+ * don't share property values which are Arrays or Object references.
+ * The Repeater accomplishes this by calling the
+ * <code>invalidateProperties()</code> method on the descriptor.</p>
+ *
+ * @see #propertiesFactory
+ * @see #invalidateProperties()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get properties():Object
+ {
+ if (_properties)
+ return _properties;
+
+ if (propertiesFactory != null)
+ _properties = propertiesFactory.call(document);
+
+ // Propagate the 'document' property, set by the MXML compiler
+ // on the document descriptor, down to all descendant descriptors.
+ if (_properties)
+ {
+ var cd:Array = _properties.childDescriptors;
+ if (cd)
+ {
+ var n:int = cd.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ cd[i].document = document;
+ }
+ }
+ }
+ else
+ {
+ _properties = {};
+ }
+
+ return _properties;
+ }
+
+ //----------------------------------
+ // propertiesFactory
+ //----------------------------------
+
+ /**
+ * A Function that returns an Object containing name/value pairs
+ * for the component's properties, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput width="150" text="Hello">
+ * </pre>
+ *
+ * <p>then the descriptor's <code>propertiesFactory</code> property
+ * is the Function:</p>
+ *
+ * <pre>
+ * function():Object { return { width: 150, text: "Hello" }; }
+ * </pre>
+ *
+ * <p>The <code>propertiesFactory</code>property is <code>null</code>
+ * if no MXML properties were specified for the component.
+ * In this case, the component will use default property values.</p>
+ *
+ * <p>The reason that <code>propertyFactory</code> is a
+ * Function returning an Object rather than an actual Object
+ * is to allow the tree of ComponentDescriptor objects
+ * to "unfold" incrementally.
+ * If all the descriptors in the descriptor tree for the document
+ * were created at launch time, the time to launch would be greater.</p>
+ *
+ * <p>The <code>properties</code> property returns a cached Object
+ * that was produced by this factory function.</p>
+ *
+ * <p>Note: Event handlers such as <code>click="doSomething();"</code>
+ * appear in the <code>events</code> Object,
+ * not in the <code>properties</code> Object.</p>
+ *
+ * @see #properties
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var propertiesFactory:Function;
+
+ //----------------------------------
+ // type
+ //----------------------------------
+
+ /**
+ * The Class of the component, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>type</code> property
+ * the Class mx.controls.TextInput.</p>
+ *
+ * <p>The property is never <code>null</code> for the
+ * ComponentDescriptor objects created by the MXML compiler,
+ * because every MXML tag has a tag name such as mx:TextInput.</p>
+ *
+ * <p>The mapping between an MXML tag and its corresponding class
+ * is determined by the XML namespace and the "manifest" file,
+ * if any, that is associated with that namespace.
+ * For example, the standard Flex namespace
+ * <code>http://www.adobe.com/2006/mxml</code>
+ * represented by the mx: prefix is associated (in the flex-config.xml
+ * file) with the manifest file mxml-manifest.xml,
+ * and this file has the tag</p>
+ *
+ * <pre>
+ * <component id="TextInput" class="mx.controls.TextInput"/>
+ * </pre>
+ *
+ * <p>which maps the tag name mx:TextInput
+ * to the Class mx.controls.TextInput.
+ * Note that the use of a manifest file allows components in single
+ * XML namespace to map to classes in multiple ActionScript packages.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var type:Class;
+
+
//--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Invalidates the cached <code>properties</code> property.
+ * The next time you read the <code>properties</code> property,
+ * the properties are regenerated from the function specified by the
+ * value of the <code>propertiesFactory</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function invalidateProperties():void
+ {
+ _properties = null;
+ }
+
+ /**
+ * Returns the string "ComponentDescriptor_" plus the value of the
+ * <code>id</code> property.
+ *
+ * @return The string "ComponentDescriptor_" plus the value of the
+ * <code>id</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function toString():String
+ {
+ return "ComponentDescriptor_" + id;
+ }
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 2afadf7..e218708 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -112,6 +112,7 @@ import mx.styles.CSSStyleDeclaration;
import org.apache.royale.utils.ClassSelectorList;
import mx.display.NativeMenu;
+import mx.binding.BindingManager;
/**
* Set a different class for click events so that
@@ -898,8 +899,55 @@ public class UIComponent extends UIBase
public function executeBindings(recurse:Boolean = false):void
{
- recurse = false;
- trace("UIComponent.executeBindings is not implemented");
+ var bindingsHost:Object = descriptor && descriptor.document ?
descriptor.document : parentMxmlDocument;
+ BindingManager.executeBindings(bindingsHost, id, this);
+ //recurse = false;
+ //trace("UIComponent.executeBindings is not implemented");
+
+ }
+
+
+ //----------------------------------
+ // descriptor
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the descriptor property.
+ * This variable is initialized in the construct() method
+ * using the _descriptor in the initObj, which is set in
+ * createComponentFromDescriptor().
+ * If this UIComponent was not created by createComponentFromDescriptor(),
+ * its 'descriptor' property is null.
+ */
+ mx_internal var _descriptor:UIComponentDescriptor;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Reference to the UIComponentDescriptor, if any, that was used
+ * by the <code>createComponentFromDescriptor()</code> method to create
this
+ * UIComponent instance. If this UIComponent instance
+ * was not created from a descriptor, this property is null.
+ *
+ * @see mx.core.UIComponentDescriptor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get descriptor():UIComponentDescriptor
+ {
+ return _descriptor;
+ }
+
+ /**
+ * @private
+ */
+ public function set descriptor(value:UIComponentDescriptor):void
+ {
+ _descriptor = value;
}
//--------------------------------------------------------------------------
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponentDescriptor.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponentDescriptor.as
new file mode 100644
index 0000000..86e9854
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponentDescriptor.as
@@ -0,0 +1,208 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * A UIComponentDescriptor instance encapsulates the information that you
+ * specified in an MXML tag for an instance of a visual component.
+ *
+ * <p>Most of the tags in an MXML file describe a tree of UIComponent objects.
+ * For example, the <code><mx:Application></code> tag represents a
+ * UIComponent object, and its child containers and controls are all
+ * UIComponent objects.</p>
+ *
+ * <p>The MXML compiler compiles each of these MXML tags into a
+ * UIComponentDescriptor instance.
+ * To be precise, the MXML compiler autogenerates an ActionScript
+ * data structure which is a tree of UIComponentDescriptor objects.</p>
+ *
+ * <p>At runtime, the <code>createComponentsFromDescriptors()</code> method
+ * of the Container class uses the information in the UIComponentDescriptor
+ * objects in the container's <code>childDescriptors</code> array to create
+ * the actual UIComponent objects that are the container's children,
+ * plus deeper descendants as well.
+ * Depending on the value of the container's <code>creationPolicy</code>,
+ * property, the descendants might be created at application startup,
+ * when some part of the component is about to become visible,
+ * or when the application developer manually calls
+ * the <code>createComponentsFromDescriptors()</code> method.</p>
+ *
+ * <p>You do not typically create UIComponentDescriptor instances yourself;
+ * you can access the ones that the MXML compiler autogenerates via the
+ * <code>childDescriptors</code> array of the Container class.</p>
+ *
+ * @see mx.core.Container#childDescriptors
+ * @see mx.core.Container#creationPolicy
+ * @see mx.core.Container#createComponentsFromDescriptors()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class UIComponentDescriptor extends ComponentDescriptor
+{
+ //include "../core/Version.as";
+
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param descriptorProperties An Object containing name/value pairs
+ * for the properties of the UIComponentDescriptor object, such as its
+ * <code>type</code>, <code>id</code>, <code>propertiesFactory</code>,
+ * <code>events</code>, <code>stylesFactory</code>,
+ * and <code>effects</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function UIComponentDescriptor(descriptorProperties:Object)
+ {
+ super(descriptorProperties);
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // effects
+ //----------------------------------
+
+ /**
+ * An Array containing the effects for the component, as specified in
MXML.
+ *
+ * <p>For example, if you write the following code:</p>
+ *
+ * <pre>
+ * <mx:TextInput showEffect="Fade" hideEffect="Fade"/></pre>
+ *
+ * <p>The descriptor's <code>effects</code> property is the Array
+ * <code>[ "showEffect", "hideEffect" ]</code>.</p>
+ *
+ * <p>The <code>effects</code>property is <code>null</code>
+ * if no MXML effects were specified for the component.</p>
+ *
+ * <p>Note that the values of the effect attributes are not specified
+ * in this property.
+ * Instead, effects are treated like styles and therefore are include
+ * in the <code>stylesFactory</code> property.
+ * The <code>effect</code> Array simply keeps track of which styles
+ * in the <code>stylesFactory</code> are actually effects.</p>
+ *
+ * <p>This property is used by the Container method
+ * <code>createComponentsFromDescriptors()</code>
+ * to register the effects with the EffectManager.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var effects:Array;
+
+ //----------------------------------
+ // instanceIndices
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var instanceIndices:Array /* of int */;
+
+ //----------------------------------
+ // repeaterIndices
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var repeaterIndices:Array /* of int */;
+
+ //----------------------------------
+ // repeaters
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var repeaters:Array /* of Repeater */;
+
+ //----------------------------------
+ // stylesFactory
+ //----------------------------------
+
+ /**
+ * A Function that constructs an Object containing name/value pairs
+ * for the instance styles for the component, as specified in MXML.
+ *
+ * <p>For example, if you write the following code:</p>
+ *
+ * <pre>
+ * <mx:TextInput borderColor="0x888888" color="0xDDDDDD"/></pre>
+ *
+ * <p>Then the descriptors' <code>stylesFactory</code> property
+ * is the Function:</p>
+ *
+ * <pre>
+ * function():void { this.borderColor = 0x888888; this.color =
0xDDDDDD };</pre>
+ *
+ * <p>The <code>stylesFactory</code> property is <code>null</code>
+ * if no MXML styles were specified for the component instance.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var stylesFactory:Function;
+
+
//--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Returns the string "UIComponentDescriptor_" plus the value of the
+ * UIComponentDescriptor object's <code>id</code> property.
+ *
+ * @return The string "UIComponentDescriptor_" plus the value of the
+ * UIComponentDescriptor object's <code>id</code> property.
+ */
+ override public function toString():String
+ {
+ return "UIComponentDescriptor_" + id;
+ }
+}
+
+}