Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-33120

Please check support for ExactValue initializer

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MXML Compiler
    • Labels:

      Description

      I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example:

      Was:
      <TextField xmlns="flash.text.*" autoSize="

      {TextFieldAutoSize.CENTER}

      " />

      is generated into:
      private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField
      {
      var temp : flash.text.TextField = new flash.text.TextField();
      _MyOwnFlexFrameworkTest_TextField1 = temp;
      mx.binding.BindingManager.executeBindings(this, "_MyOwnFlexFrameworkTest_TextField1", _MyOwnFlexFrameworkTest_TextField1);
      return temp;
      }

      // binding mgmt
      private function _MyOwnFlexFrameworkTest_bindingsSetup():Array
      {
      var result:Array = [];

      result[0] = new mx.binding.Binding(this,
      function():String

      { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }

      ,
      null,
      "_MyOwnFlexFrameworkTest_TextField1.autoSize"
      );

      return result;
      }

      now:
      <TextField xmlns="flash.text.*" autoSize="${TextFieldAutoSize.CENTER}" />

      give us such result:

      private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField
      {
      var temp : flash.text.TextField = new flash.text.TextField();
      temp.autoSize = TextFieldAutoSize.CENTER;
      _MyOwnFlexFrameworkTest_TextField1 = temp;
      mx.binding.BindingManager.executeBindings(this, "_MyOwnFlexFrameworkTest_TextField1", _MyOwnFlexFrameworkTest_TextField1);
      return temp;
      }

      this implementation is similar to twoWay bindings and written in the same way.

      btw, sorry for my English, I'm Russian.
      Thanks

        Attachments

        1. exactValue.patch
          5 kB
          Sergei Egorov
        2. screenshot-1.jpg
          30 kB
          Cyrill Zadra
        3. workiingExample.jpg
          22 kB
          Cyrill Zadra
        4. patch.diff
          4 kB
          Justin Mclean

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aharui Alex Harui

              Dates

              • Created:
                Updated:

                Issue deployment