0 Replies Latest reply on Aug 17, 2009 11:32 AM by Paul Reilly

    [svn:fx-trunk] 9349: * Added support for using getStyle() in Mxml data binding expressions.

    Paul Reilly Level 1

      Revision: 9349

      Author:   preilly@adobe.com

      Date:     2009-08-17 11:32:37 -0700 (Mon, 17 Aug 2009)

       

      Log Message:

      ***********

      • Added support for using getStyle() in Mxml data binding expressions.

        In addition to the existing "function return watcher" data binding

        functionality, we register to listen for style related change events

        when we see a function marked with [Bindable(style="true")].

        UIComponent's and TextGraphicElement's styleChanged() will now

        dispatch events for "getStyle()" FunctionReturnWatchers to handle.

        When null or "styleName" is passed into styleChanged(), we dispatch

        an "allStylesChanged" event.

       

      QE notes: mxunit test to follow

      Doc notes:

      Bugs: SDK-20394

      Reviewer: Glenn, Pete F, Peter D

      Tests run: checkintests, mxunit databinding

      Is noteworthy for integration: only if you want to start using it.

      Code-level description of changes:

       

        modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension.java

       

          Modified generateWatcher() to do the AST equivalent of the

          WatcherSetupUtil.vm change.

       

        modules/compiler/src/java/flex2/compiler/as3/binding/FunctionReturnWatcher.java

       

          Removed unused isNew variable and added isStyleWatcher variable.

       

          Modified shouldWriteSelf() to return true if isStyleWatcher is true.

       

        modules/compiler/src/java/flex2/compiler/as3/binding/WatcherSetupUtil.vm

       

          Modified writeFunctionReturnWatcher macro to add a true arg to the

          FunctionReturnWatcher constructor call when isStyleWatcher() is

          true.

       

        modules/compiler/src/java/flex2/compiler/as3/binding/BindableFirstPassEvaluator.java

       

          Modified evaluate(Context, MetaDataNode) to skip reporting an

          error for no events when style is true.

       

        modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassEvaluator.java

       

          Replaced insideCallExpression boolean with callExpressionStack

          Stack.  The "!insideCallExpression" checks were replaced with

          callExpressionStack.isEmpty().

       

          Modified addBindables() to handle [Bindable(style="true")].

       

          Made argumentListStack and resetSet more strongly typed.

       

        frameworks/projects/framework/src/mx/core/UIComponent.as

       

          Modified styleChanged() to dispatch a "Changed" and "allStylesChanged" from the previous

          parent and add listeners to the new parent when isStyle is true.

       

          Modified eventHandler to notifyListeners() when isStyle is true.

       

        frameworks/projects/spark/src/spark/primitives/supportClasses/TextGraphicElement.as

       

          Similar changes to UIComponent.

       

      Ticket Links:

      ************

          http://bugs.adobe.com/jira/browse/SDK-20394

       

      Modified Paths:

      **************

          flex/sdk/trunk/frameworks/projects/framework/src/mx/binding/FunctionReturnWatcher.as

          flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/TextGraphicE lement.as

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/BindableFirstPassEval uator.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension. java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassE valuator.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/FunctionReturnWatcher .java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/WatcherSetupUtil.vm