incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1370009 [4/34] - in /incubator/flex/trunk/mustella/tests/apollo: ./ DragManager/ DragManager/SWFs/ DragManager/SWFs/assets/ DragManager/SWFs/comps/ DragManager/Spark/ DragManager/Spark/baselines/ FileComboBox/ FileComboBox/SWFs/ FileComboB...
Date Mon, 06 Aug 2012 20:51:43 GMT
Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FNM_MnemonicsKeys_Tester.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FNM_MnemonicsKeys_Tester.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FNM_MnemonicsKeys_Tester.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FNM_MnemonicsKeys_Tester.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,634 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+
+<UnitTester testDir="apollo/FlexNativeMenu/Properties/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="FNM_MnemonicsKeys_Main.mxml">
+
+<!-- this set of lines form a template that must be in each unit test -->
+
+
+
+    <mx:Script>
+
+        <![CDATA[
+
+        public static function init(o:DisplayObject):void
+
+        {
+
+        }           
+
+        ]]>
+
+    </mx:Script>
+
+    
+
+    <mx:Metadata>
+
+        <![CDATA[
+
+            [Mixin]
+
+        ]]>
+
+    </mx:Metadata>  
+
+    
+
+    <!-- end of set of lines that must be in each unit test -->
+
+    
+
+    <mx:Script>
+
+        <![CDATA[
+
+        
+
+        import flash.ui.Keyboard;
+
+        
+
+        public function checkMenu():Boolean
+
+        {
+
+            var matches:Boolean = false;
+
+            if(NativeApplication.supportsDockIcon){
+
+                var dock:DockIcon = NativeApplication.nativeApplication.icon as DockIcon;
+
+                matches = (dock.menu == application.compContext.nativeMenu);
+
+            }
+
+            else if(NativeApplication.supportsSystemTrayIcon){
+
+                var sys:SystemTrayIcon = NativeApplication.nativeApplication.icon as SystemTrayIcon;
+
+                matches = (sys.menu == application.compContext.nativeMenu)
+
+            }
+
+            return matches;
+
+        }   
+
+        public function getOSAndModifiers(): Number
+        {
+             var myOS:String = Capabilities.os;
+             trace('Keyboard.CONTROL: ' + Keyboard.CONTROL);
+trace('Keyboard.COMMAND: ' + Keyboard.COMMAND);
+trace('Keyboard.ALTERNATE: ' + Keyboard.ALTERNATE);
+trace('Keyboard.SHIFT: ' + Keyboard.SHIFT);
+             if(myOS.indexOf('Windows', 0) != -1)
+             {
+                 return Keyboard.CONTROL;
+             }
+             else
+             {
+                 return Keyboard.COMMAND;
+             }
+        }
+        
+
+        ]]>
+
+    </mx:Script>
+
+    
+
+    <testCases>
+
+        
+
+        <!--Mnemonic tests-->
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicIndexFunction_properties" keywords="[FlexNativeMenu, mnemonicIndexFunction, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.fnm_1.nativeMenu.getItemAt(0).mnemonicIndex" value="4"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicIndexFunction_submenu_properties" keywords="[FlexNativeMenu, mnemonicIndexFunction, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.fnm_1.nativeMenu.getItemAt(0).submenu.getItemAt(0).mnemonicIndex" value="9"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_labelFunction_properties" keywords="[FlexNativeMenu, labelFunction, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.fnm_1.nativeMenu.getItemAt(0).label" value="Fruit1"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_labelFunction_submenu_properties" keywords="[FlexNativeMenu, labelFunction, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.fnm_1.nativeMenu.getItemAt(0).submenu.getItemAt(0).label" value="Strawberry1"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_labelFunction_separator" keywords="[FlexNativeMenu, labelFunction, separator]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.fnm_1.nativeMenu.getItemAt(0).submenu.getItemAt(2).label" value=""/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicIndexField_properties" keywords="[FlexNativeMenu, mnemonicIndexField, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).mnemonicIndex" value="0"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicIndexField_separator_properties" keywords="[FlexNativeMenu, mnemonicIndexField, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(1).mnemonicIndex" value="-1"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicIndexField_submenu_properties" keywords="[FlexNativeMenu, mnemonicIndexField, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).mnemonicIndex" value="2"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_mnemonicUnderscores_firstLetter_properties" keywords="[FlexNativeMenu, mnemonics, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.anotherVBox.flexContextMenu.nativeMenu.getItemAt(0).mnemonicIndex" value="1"/>
+
+            </body>
+
+        </TestCase>
+
+
+        <TestCase testID="FlexNativeMenu_mnemonicNumbers_short_properties" keywords="[FlexNativeMenu, mnemonicIndex, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.anotherVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(1).mnemonicIndex" value="4"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <!--dockIconMenu, systemTrayIconMenu tests-->
+
+        
+
+        <TestCase testID="FlexNativeMenu_dockIconMenu_properties" keywords="[FlexNativeMenu, dockIconMenu, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=checkMenu()" value="true"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_systemTrayIconMenu_properties" keywords="[FlexNativeMenu, systemTrayIconMenu, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=checkMenu()" value="true"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <!--key Equivalents tests-->
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_letter_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="M"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_number_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(0).keyEquivalent" value="1"/>
+
+            </body>
+
+        </TestCase>
+
+        
+        <TestCase testID="FlexNativeMenu_keyEquivalent_doubleByte_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.jpMenus.nativeMenu.getItemAt(0).keyEquivalent" value="ト"/>
+
+                <AssertMethodValue method="value=application.jpMenus.nativeMenu.getItemAt(0).submenu.getItemAt(1).keyEquivalent" value="保"/>
+
+            </body>
+
+        </TestCase>
+
+        <TestCase testID="FlexContextMenu_keyEquivalent_doubleByte_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.jpVBox.flexContextMenu.nativeMenu.getItemAt(0).keyEquivalent" value="ト"/>
+
+                <AssertMethodValue method="value=application.jpVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(1).keyEquivalent" value="保"/>
+
+            </body>
+
+        </TestCase>
+
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_ctrlKey_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).submenu.getItemAt(2).keyEquivalentModifiers" value="[17]"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_cmdKey_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).submenu.getItemAt(0).keyEquivalentModifiers" value="[15]"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_shiftKey_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(2).keyEquivalent" value="R"/>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(2).keyEquivalentModifiers" value="[16]"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_altKey_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).submenu.getItemAt(1).keyEquivalent" value=""/>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).submenu.getItemAt(1).keyEquivalentModifiers" value="[18]"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalent_ctrlKey_cmdKey_properties" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).keyEquivalent" value="BACKSPACE"/>
+
+                <AssertMethodValue method="value=application.myVBox.flexContextMenu.nativeMenu.getItemAt(2).keyEquivalentModifiers" value="[15, 16, 17]"/>
+
+            </body>
+
+        </TestCase>
+
+        
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentFunction_MXML_XMLData" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="W"/>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(1).submenu.getItemAt(3).keyEquivalent" value="R"/>
+
+            </body>
+
+        </TestCase>             
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentFunction_AS_XMLData" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <SetProperty propertyName="labelField" value="@label" target="emptyFNM" />
+
+                <RunCode code="application.setKeyFunction(application.emptyFNM, 0)" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeData" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="W"/>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(1).submenu.getItemAt(3).keyEquivalent" value="R"/>
+
+            </body>
+
+        </TestCase>             
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentFunction_AS_ArrayData" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <RunCode code="application.setKeyFunction(application.emptyFNM, 1)" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeDataArray" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="W"/>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(1).submenu.getItemAt(3).keyEquivalent" value="1"/>
+
+            </body>
+
+        </TestCase>              
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentFunction_precedence" keywords="[FlexNativeMenu, keyEquivalents, properties]"
+
+            description="Test that keyEquivalentFunction takes precedence over keyEquivalentField">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <RunCode code="application.setKeyFunction(application.emptyFNM, 0)" />
+
+                <SetProperty propertyName="keyEquivalentField" value="@keys" target="emptyFNM" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeData" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(0).submenu.getItemAt(2).keyEquivalent" value="E"/>
+
+                <AssertMethodValue method="value=application.emptyFNM.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalent" value="P"/>
+
+            </body>
+
+        </TestCase> 
+
+        <TestCase testID="ContextMenu_keyEquivalentFunction_MXML_XMLData" keywords="[flexContextMenu, FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="W"/>
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(3).keyEquivalent" value="R"/>
+
+            </body>
+
+        </TestCase>   
+
+        <TestCase testID="ContextMenu_keyEquivalentFunction_AS_XMLData" keywords="[flexContextMenu, FlexNativeMenu, keyEquivalents, properties]">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <SetProperty propertyName="labelField" value="@label" target="emptyFNM" />
+
+                <RunCode code="application.setKeyFunction(application.emptyFNM, 0)" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeData" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+                <SetProperty target="VBox4" propertyName="flexContextMenu" valueExpression="value=application.emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalent" value="W"/>
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(3).keyEquivalent" value="R"/>
+
+            </body>
+
+        </TestCase> 
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentModifiersFunction_MXML_XMLData" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers.length" value="3"/>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers[1]" 
+
+                    valueExpression="value=getOSAndModifiers()"/>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers.length" value="1" />
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers[0]" 
+
+                    valueExpression="value=Keyboard.SHIFT"/>
+
+            </body>
+
+        </TestCase>    
+
+        <TestCase testID="FlexNativeMenu_keyEquivalentModifiersFunction_AS_XMLData" keywords="[FlexNativeMenu, keyEquivalents, properties]">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <SetProperty propertyName="labelField" value="@label" target="emptyFNM" />
+
+                <RunCode code="application.setModifierFunction(application.emptyFNM)" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeData" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers.length" value="3"/>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers[1]" 
+
+                    valueExpression="value=getOSAndModifiers()"/>
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers.length" value="1" />
+
+                <AssertMethodValue method="value=application.keyfunctions.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers[0]" 
+
+                    valueExpression="value=Keyboard.SHIFT"/>
+
+            </body>
+
+        </TestCase> 
+
+        <TestCase testID="flexContextMenu_keyEquivalentModifiersFunction_MXML_XMLData" keywords="[flexContextMenu,FlexNativeMenu, keyEquivalents, properties]">
+
+            <body>
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers.length" value="3"/>
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers[1]" 
+
+                    valueExpression="value=getOSAndModifiers()"/>
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers.length" value="1" />
+
+                <AssertMethodValue method="value=application.VBox3.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers[0]" 
+
+                    valueExpression="value=Keyboard.SHIFT"/>
+
+            </body>
+
+        </TestCase>    
+
+        <TestCase testID="flexContextMenu_keyEquivalentModifiersFunction_AS_XMLData" keywords="[flexContextMenu,FlexNativeMenu, keyEquivalents, properties]">
+
+            <setup>
+
+                <ResetComponent target="emptyFNM" className="mx.controls.FlexNativeMenu" />
+
+                <SetProperty propertyName="labelField" value="@label" target="emptyFNM" />
+
+                <RunCode code="application.setModifierFunction(application.emptyFNM)" />
+
+                <SetProperty propertyName="dataProvider" valueExpression="value=application.cakeData" target="emptyFNM"
+
+                    waitEvent="updateComplete" waitTarget="emptyFNM" />
+
+                <SetProperty target="VBox4" propertyName="flexContextMenu" valueExpression="value=application.emptyFNM" />
+
+            </setup>
+
+            <body>
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers.length" value="3"/>
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(0).submenu.getItemAt(0).keyEquivalentModifiers[1]" 
+
+                    valueExpression="value=getOSAndModifiers()"/>
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers.length" value="1" />
+
+                <AssertMethodValue method="value=application.VBox4.flexContextMenu.nativeMenu.getItemAt(1).submenu.getItemAt(4).keyEquivalentModifiers[0]" 
+
+                    valueExpression="value=Keyboard.SHIFT"/>
+
+            </body>
+
+        </TestCase> 
+
+    </testCases>
+
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FlexNativeMenu_DataProvider.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FlexNativeMenu_DataProvider.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FlexNativeMenu_DataProvider.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/Properties/FlexNativeMenu_DataProvider.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+<UnitTester testDir="apollo/FlexNativeMenu/Properties/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="FlexNativeMenu_Properties_Main.mxml">
+
+    <!-- this set of lines form a template that must be in each unit test -->
+    <mx:Script>
+    <![CDATA[
+    
+        import mx.managers.SystemManager;
+        import mx.events.MenuEvent;
+        import mx.controls.FlexNativeMenu;
+        import mx.collections.*;
+
+        public static function init(o:DisplayObject):void
+        {
+
+        }
+
+        [Bindable]
+        public var myDP:Object = {label: "top", children: [
+            {label: "file", name: "FILE", children: [
+                {label:"I am a Menu", name:"MENU"},
+                {label:"here goes Nothing", name:"NOTHING", children: [
+                    {label:"aw, don't sell yourself short", name:"AW"},
+                    {type:"check", label:"can you check me?", name:"CHECK ME"}
+                ]}
+            ]}
+        ]};
+
+        [Bindable]
+        public var xmlObjE4X2:XML;
+
+        public function createXML(): void
+        {
+            xmlObjE4X2 = new XML("<topnode><node label='Mail'><node label='Inbox'><node label='Old' data='old' /></node><node label='Personal' data='personal'><node label='Old' data='old' /></node></node></topnode>");
+        }
+
+        [Bindable]
+        public var myCol:ArrayCollection;
+        
+        public var myDPArray:Array = 
+        [{label: "menu 2", children: [
+                {label: "mail", name: "MAIL", children: [
+                    {label:"inbox", name:"INBOX"},
+                    {label:"outbox", name:"OUTBOX", children: [
+                        {label:"you are a draft", name:"DRAFT"},
+                        {type:"check", label:"check me", name:"CHECK"}
+                    ]}
+                ]}
+          ]},
+          {label: "menu 1", children: [
+                {label: "file", name: "FILE", children: [
+                    {label:"I am a Menu", name:"MENU"},
+                    {label:"here goes Nothing", name:"NOTHING", children: [
+                        {label:"aw, don't sell yourself short", name:"AW"},
+                        {type:"check", label:"can you check me?", name:"CHECK ME"}
+                    ]}
+                ]}
+           ]}
+          ];
+        
+        public function setArrayCollectionDP() : void
+        {
+            myCol = new ArrayCollection(myDPArray);
+        }
+       
+
+    ]]>
+    </mx:Script>
+    <mx:Metadata>
+    
+    <![CDATA[
+        [Mixin]
+    ]]>
+    </mx:Metadata>
+    <!-- end of set of lines that must be in each unit test -->
+
+<mx:XML id="testXMLDP" format="e4x">
+   <topnode>
+        <node label="blue" name="BLUE">
+            <node label="I am a Menu" name="MENU"/>
+            <node label="here goes Nothing" name="NOTHING" >
+                <node label="aw, don't sell yourself short" name="AW"/>
+                <node type="check" label="can you check me?" name="CHECK ME"/>
+            </node>
+        </node>
+   </topnode>
+</mx:XML>
+
+<!-- note, these tests seem to fail without the short Pauses that I've added. -->
+
+    <testCases>
+        <TestCase testID="flexNativeMenu_dataProvider_null" description="Set an AS object as a dataProvider for FlexNativeMenu in AS" keywords="[FlexNativeMenu, dataProvider]">
+            <setup>
+                <SetProperty target="fnm" propertyName="dataProvider" value="null" />
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="0" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_dataProvider_oneItem" description="Set an AS object as a dataProvider for FlexNativeMenu in AS" keywords="[FlexNativeMenu, dataProvider]">
+            <setup>
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=myDP" waitTarget="fnm" waitEvent="updateComplete"/>
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="1" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="file" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(1).label" value="here goes Nothing" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(1).submenu.getItemAt(0).label" value="aw, don't sell yourself short" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_XMLsetWithBinding" description="Set XML as a dataProvider for FlexNativeMenu With Binding" keywords="[FlexNativeMenu, dataProvider]">
+            <body>
+                <AssertPropertyValue target="fnmBinding.nativeMenu" propertyName="numItems" value="3" />
+                <AssertMethodValue target="" method="value=application.fnmBinding.nativeMenu.getItemAt(0).label" value="Drinks" />
+                <AssertMethodValue target="" method="value=application.fnmBinding.nativeMenu.getItemAt(1).label" value="Sides" />
+                <AssertMethodValue target="" method="value=application.fnmBinding.nativeMenu.getItemAt(2).label" value="Main" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_ASsetWithBinding" description="Set an AS Object as the dataProvider for FlexNativeMenu With Binding" keywords="[FlexNativeMenu, dataProvider]">
+            <body>
+                <AssertPropertyValue target="fnmBinding2.nativeMenu" propertyName="numItems" value="1" />
+                <AssertMethodValue target="" method="value=application.fnmBinding2.nativeMenu.getItemAt(0).label" value="FILE" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_XMLObject_setInAS" description="Set an XML object as a dataProvider for MenuBar in AS" keywords="[MenuBar, dataProvider, XML]">
+             <setup>
+                 <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                 <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=testXMLDP" />
+                 <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                 <SetProperty target="fnm" propertyName="labelField" value="@label" waitEvent="updateComplete" waitTarget="fnm"/>
+             </setup>
+             <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="1" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="blue" />
+             </body>
+        </TestCase>       
+        <TestCase testID="flexNativeMenu_XMLBuiltAS_setWithBinding" description="Set an XML object (built in AS) as a dataProvider for FlexNativeMenu with Binding" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <body>
+                <AssertPropertyValue target="MenuDP3.nativeMenu" propertyName="numItems" value="1" />
+                <AssertMethodValue target="" method="value=application.MenuDP3.nativeMenu.getItemAt(0).label" value="Mailbox" />
+             </body>
+        </TestCase>       
+        <TestCase testID="flexNativeMenu_XMLBuiltAS_setWithAS" description="Set an XML object as a dataProvider for FlexNativeMenu with AS" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <RunCode code="createXML()" />
+                <SetProperty propertyName="showRoot" value="false" target="fnm" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=xmlObjE4X2" waitEvent="updateComplete" waitTarget="fnm" />
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="1" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="Mail" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_Model_setWithBinding" description="Set a Model as a dataProvider for FlexNativeMenu with Binding" keywords="[FlexNativeMenu, dataProvider, Model]">
+            <body>
+                <AssertPropertyValue target="MenuDP3B.nativeMenu" propertyName="numItems" value="4" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(0).label" value="Toys" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(1).label" value="Cookware" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(2).label" value="Clothing" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(3).label" value="Furniture" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_Model_setWithAS" description="Set Model as a dataProvider for FlexNativeMenu with AS" keywords="[FlexNativeMenu, dataProvider, Model]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.model1.Product" />
+            </setup>
+            <body>
+                <AssertPropertyValue target="MenuDP3B.nativeMenu" propertyName="numItems" value="4" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(0).label" value="Toys" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(1).label" value="Cookware" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(2).label" value="Clothing" />
+                <AssertMethodValue target="" method="value=application.MenuDP3B.nativeMenu.getItemAt(3).label" value="Furniture" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_ArrayCollection_setWithAS" description="Set ArrayCollection as a dataProvider for FlexNativeMenu with AS" keywords="[FlexNativeMenu, dataProvider, ArrayCollection]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <RunCode code="setArrayCollectionDP()" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=myCol"  waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="2" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="menu 2" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(1).label" value="menu 1" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_dataProviderHTTPService" description="Set the result of an HTTPService as a dataProvider for FlexNativeMenu with AS" keywords="[FlexNativeMenu, dataProvider, XML, HTTPServic]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <RunCode code="application.menuXML.send()" waitEvent="result" waitTarget="menuXML" />
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="3" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="Drinks" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(2).label" value="Beer" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(2).label" value="Baked" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(2).submenu.getItemAt(1).label" value="Lasagna" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_LargeXML" description="Set the dataProvider for FlexNativeMenu giving lots of top level items" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.bigModel.Food"  waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertPropertyValue target="fnm.nativeMenu" propertyName="numItems" value="54" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).label" value="Drinks" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(2).label" value="Beer" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(20).label" value="Baked" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(32).submenu.getItemAt(1).label" value="Lasagna" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_mainMenuItemDisabled" description="Set a main menu item to be disabled for FlexNativeMenu " keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label"  waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[1], false)" waitEvent="updateComplete" waitTarget="fnm" />
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(1).enabled" value="false" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_mainMenuItemDisabledToEnabled" description="Set a main menu item to be disabled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty propertyName="updateCompletePendingFlag" target="fnm" value="false" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" waitTarget="fnm"
+                   waitEvent="updateComplete" />
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[0], false)" waitTarget="fnm"
+                   waitEvent="updateComplete" />
+            </setup>
+            <body>
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[0], true)" waitTarget="fnm"
+                   waitEvent="updateComplete" />
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).enabled" value="true" />
+            </body>
+        </TestCase>
+        <!--TestCase testID="flexNativeMenu_mainMenuItemDisabled_AS" description="Set a main menu item to be disabled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.myDP2" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="label" />
+                <Pause timeout="10" />
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.myDP2[0][0][0], false)" waitEvent="updateComplete"
+                   waitTarget="fnm" />
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(1).enabled" value="false" />
+            </body>
+        </TestCase-->
+        <TestCase testID="flexNativeMenu_subMenuItemDisabled" description="Set a main menu item to be disabled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label"  waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[0].subitem[1], false)"  waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(1).enabled" value="false" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_subMenuItemDisabledToEnabled" description="Set a main menu item to be disabled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label"  waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[0].subitem[1], false)"  waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setEnabled(application.nativeMenuDP.item[0].subitem[1], true)"  waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(1).enabled" value="true" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_menuItemToggled" description="Set a main menu item to be toggled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label" waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setToggled(application.nativeMenuDP.item[1].subitem[0], true)" waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(1).submenu.getItemAt(0).checked" value="true" />
+            </body>
+        </TestCase>
+        <TestCase testID="flexNativeMenu_menuItemToggledThenUnToggled" description="Set a main menu item to be un-toggled for FlexNativeMenu" keywords="[FlexNativeMenu, dataProvider, XML]">
+            <setup>
+                <ResetComponent target="fnm" className="mx.controls.FlexNativeMenu" />
+                <SetProperty target="fnm" propertyName="dataProvider" valueExpression="value=application.nativeMenuDP" />
+                <SetProperty target="fnm" propertyName="showRoot" value="false" />
+                <SetProperty target="fnm" propertyName="labelField" value="@label" waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setToggled(application.nativeMenuDP.item[0].subitem[1], true)" waitEvent="updateComplete" waitTarget="fnm"/>
+                <RunCode code="application.fnm.dataDescriptor.setToggled(application.nativeMenuDP.item[0].subitem[1], false)" waitEvent="updateComplete" waitTarget="fnm"/>
+            </setup>
+            <body>
+                <AssertMethodValue target="" method="value=application.fnm.nativeMenu.getItemAt(0).submenu.getItemAt(1).checked" value="false" />
+            </body>
+        </TestCase>
+    </testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/BigXML.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/BigXML.xml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/BigXML.xml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/BigXML.xml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,327 @@
+<?xml version="1.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.
+
+-->
+<AllStuff>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+</AllStuff>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomChildData.as
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomChildData.as?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomChildData.as (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomChildData.as Mon Aug  6 20:51:08 2012
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 Assets
+{
+	import flash.text.TextField;
+	
+	import mx.controls.treeClasses.DefaultDataDescriptor;
+	import flash.utils.Dictionary;
+	import mx.collections.ArrayCollection;
+	import mx.collections.CursorBookmark;
+	import mx.collections.ICollectionView;
+	import mx.collections.IList;
+	import mx.collections.IViewCursor;
+	import mx.collections.XMLListCollection;
+	import mx.controls.menuClasses.IMenuDataDescriptor;
+	import mx.utils.UIDUtil;
+
+	public class CustomChildData extends DefaultDataDescriptor
+	{
+		public function CustomChildData()
+		{
+		}
+	
+		/**
+		     *  Provides access to a node's children. Returns a collection
+		     *  of children if they exist. If the node is an Object, the method
+		     *  returns the contents of the object's <code>children</code> field as
+		     *  an ArrayCollection.
+		     *  If the node is XML, the method returns an XMLListCollection containing
+		     *  the child elements.
+		     *
+		     *  @param node The node object currently being evaluated.
+		     *  @param model The collection that contains the node; ignored by this class.
+		     *  @return An object containing the children nodes.
+		     */
+		override public function getChildren(node:Object, model:Object = null):ICollectionView
+		    {
+		    	var childrenCollection:XMLListCollection;
+		        
+		        childrenCollection =  new XMLListCollection(node.mymenuette.*);
+		        return childrenCollection;
+		    }
+
+		override public function isBranch(node:Object, model:Object = null):Boolean
+		    {
+		    	return hasChildren(node, model); 
+  		    }
+	}
+}
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomData.as
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomData.as?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomData.as (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/CustomData.as Mon Aug  6 20:51:08 2012
@@ -0,0 +1,188 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 Assets
+{
+	import flash.text.TextField;
+	
+	import mx.controls.treeClasses.DefaultDataDescriptor;
+	import flash.utils.Dictionary;
+	import mx.collections.ArrayCollection;
+	import mx.collections.CursorBookmark;
+	import mx.collections.ICollectionView;
+	import mx.collections.IList;
+	import mx.collections.IViewCursor;
+	import mx.collections.XMLListCollection;
+	import mx.controls.menuClasses.IMenuDataDescriptor;
+	import mx.utils.UIDUtil;
+
+	public class CustomData extends DefaultDataDescriptor
+	{
+		
+		
+		public function CustomData()
+		{
+		}
+
+    /**
+     *  Returns whether the node is toggled.
+     *  This method is used by menu-based controls.
+     *
+     *  @param node The node for which to get the status.
+     *  @return The value of the node's <code>toggled</code>
+     *  attribute or field, or <code>false</code> if there is no such
+     *  entry.
+     */
+    override public function isToggled(node:Object):Boolean
+    {
+        if (node is XML)
+        {
+            var toggled:* = node.@myToggled;
+            if (toggled[0] == true)
+                return true;
+        }
+        else if (node is Object)
+        {
+            try
+            {
+                return Boolean(node.toggled);
+            }
+            catch(e:Error)
+            {
+            }
+        }
+        return false;
+    }
+    
+    override public function setToggled(node:Object, value:Boolean):void
+        {
+            if (node is XML)
+            {
+                node.@myToggled = value;
+            }
+            else if (node is Object)
+            {
+                try
+                {
+                    node.toggled = value;
+                }
+                catch(e:Error)
+                {
+                }
+            }
+    }
+    
+    /**
+     *  Returns whether the node is enabled.
+     *  This method is used by menu-based controls.
+     *  @param node The node for which to get the status.
+     *  @return the value of the node's <code>enabled</code>
+     *  attribute or field, or <code>true</code> if there is no such
+     *  entry or the value is not false.
+     */
+     override public function isEnabled(node:Object):Boolean
+        {
+            var enabled:*;
+            if (node is XML)
+            {
+                enabled = node.@myEnabled;
+                if (enabled[0] == false)
+                    return false;
+            }
+            else if (node is Object)
+            {
+                try
+                {
+                    return !("false" == String(node.enabled))
+                }
+                catch(e:Error)
+                {
+                }
+            }
+            return true;
+        }
+   
+   /**
+        *  Sets the value of the field or attribute in the data provider
+        *  that identifies whether the node is enabled.
+        *  This method sets the value of the node's <code>enabled</code>
+        *  attribute or field.
+        *  This method is used by menu-based controls.
+        *
+        *  @param node The node for which to set the status.
+        *  @param value Whether the node is enabled.
+        */
+       override public function setEnabled(node:Object, value:Boolean):void
+       {
+           if (node is XML)
+           {
+               node.@myEnabled = value;
+           }
+           else if (node is Object)
+           {
+               try
+               {
+                   node.enabled = value;
+               }
+               catch(e:Error)
+               {
+               }
+           }
+        }
+
+	override public function getData(node:Object, model:Object = null):Object
+	{
+		if (model == null)
+			return null;
+		return (Object(node.@changeMe));
+   	 }
+    
+    /**
+         *  Returns the type identifier of a node.
+         *  This method is used by menu-based controls to determine if the
+         *  node represents a separator, radio button,
+         *  a check box, or normal item.
+         *
+         *  @param node The node object for which to get the type.
+         *  @return  the value of the <code>type</code> attribute or field,
+         *  or the empty string if there is no such field.
+         */
+        override public function getType(node:Object):String
+        {
+            if (node is XML)
+            {
+                return String(node.@myType);
+            }
+            else if (node is Object)
+            {
+                try
+                {
+                    return String(node.type);
+                }
+                catch(e:Error)
+                {
+                }
+            }
+            return "";
+  	}
+      
+  }
+
+}
+
+

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile.xml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile.xml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile.xml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,43 @@
+<?xml version="1.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.
+
+-->
+<AllStuff>
+<Product label="Toys">
+  <children label="Toy Bear"/>
+  <children label="Action Figure" />
+  <children label="Creepy Creatures" />
+</Product>
+<Product label="Cookware">
+  <children label="Grill Pan"/>
+  <children label="Slow Cooker" />
+  <children label="Whisk" />
+  <children label="Mixing Bowls" />
+  <children label="Dishes" />
+</Product>
+<Product label="Clothing">
+  <children label="Sweaters"/>
+  <children label="Shoes" />
+  <children label="Jackets" />
+</Product>
+<Product label="Furniture">
+  <children label="Couch"/>
+  <children label="Lamps" />
+  <children label="Beds" />
+</Product>
+</AllStuff>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile2.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile2.xml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile2.xml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/Assets/myXMLFile2.xml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,38 @@
+<?xml version="1.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.
+
+-->
+<AllStuff>
+<Food label="Drinks">
+  <children label="Pop"/>
+  <children label="Bottled Water" />
+  <children label="Beer" />
+</Food>
+<Food label="Sanwiches">
+  <children label="Grilled Cheese"/>
+  <children label="Ham and Cheese" />
+  <children label="Hamburger" />
+  <children label="Veggie Burger" />
+  <children label="Pita" />
+</Food>
+<Food label="Baked">
+  <children label="Ziti"/>
+  <children label="Lasagna" />
+  <children label="Tuna Casarole" />
+</Food>
+</AllStuff>
\ No newline at end of file

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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.
+
+-->
+
+<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="400" height="300" >
+	<mx:Script>
+		<![CDATA[
+		import mx.events.FlexNativeMenuEvent;
+		import Assets.CustomData;
+		import Assets.CustomChildData;
+		
+		[Bindable]
+		private var colorData:XMLList = 
+			<>
+				<mymenu label="colors">
+					<mymenuette label="warm">
+						<mymenu label="two">
+							<mymenuette label="orange" toggled="true" enabled="false"/>
+							<mymenuette label="red" toggled="false" enabled="true"/>
+							<mymenuette label="yellow"/>
+						</mymenu>
+					</mymenuette>
+					<mymenuette label="cold">
+						<mymenu label="one">
+							<mymenuette label="blue"/>
+							<mymenuette label="green" toggled="true" enabled="true"/>
+							<mymenuette label="purple"/>
+						</mymenu>
+					</mymenuette>
+				</mymenu>
+			</>;
+		[Bindable]
+		private var foodData:XMLList = 
+			<>
+			<menuitem myLabel="Fruit" myEnabled="true">
+				<menuitem myLabel="Strawberry" myToggled="true" myEnabled="false"/>
+				<menuitem myLabel="Banana" myType="fruit"/>
+				<menuitem myType="separator"/>
+				<menuitem myLabel="Citrus"/>
+				<menuitem myLabel="Orange">
+					<menuitem myLabel="Blood" myToggled="false"/>
+					<menuitem myLabel="Navel" myToggled="true"/>
+					<menuitem myLabel="Valencia" myToggled="false"/>
+				</menuitem>
+				<menuitem myLabel="Grapefruit">
+					<menuitem myLabel="Ruby Red" myType="check" myToggled="true"/>
+				</menuitem>
+				<menuitem myLabel="Peach" changeMe="one"/>
+			</menuitem>
+			<menuitem myLabel="Meat">
+				<menuitem myLabel="Chicken"/>
+				<menuitem myLabel="Beef"/>
+				<menuitem myLabel="Lamb"/>
+				<menuitem myLabel="Pork"/>
+			</menuitem>
+			</>;
+			
+		[Bindable]
+        public var dbData:XMLList = 
+        	<>
+        		<menuitem label="ありがと"/>
+        		<menuitem label="二はお馬"/>
+        	</>;
+        	
+		[Bindable]
+		public var childData:CustomChildData = new CustomChildData();
+		
+		[Bindable]
+		public var cdd:CustomData = new CustomData();
+	]]>
+	</mx:Script>
+	<mx:menu>
+		<mx:FlexNativeMenu id="fnm_1" dataProvider="{colorData}" labelField="@label" dataDescriptor="{childData}"/>
+	</mx:menu>
+	<mx:flexContextMenu>
+		<mx:FlexNativeMenu id="fnm_2" dataProvider="{foodData}" labelField="@myLabel" dataDescriptor="{cdd}"/>
+	</mx:flexContextMenu>
+	
+	<mx:FlexNativeMenu id="dbMenu" dataProvider="{dbData}" labelField="@label"/>
+    
+	<mx:VBox id="doubleByteBox" borderStyle="solid" flexContextMenu="{dbMenu}">
+    	<mx:Label text="My double byte menu"/>
+    </mx:VBox>
+    
+</mx:WindowedApplication>

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.xml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.xml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_DataDescriptor_Main.xml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+
+  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.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/3.1">
+    <id>WindowInteractiveApiTest1</id>
+    <version>0.6.7</version>
+    <filename>WindowInteractiveApiTest</filename>
+    <copyright>Copyright 2012 The Apache Software Foundation/copyright>
+    
+    <versionNumber>1</versionNumber>
+
+    <initialWindow>
+        <content>FNM_DataDescriptor_Main.swf</content>   
+        <title>0.6.7</title>
+        <systemChrome>standard</systemChrome>
+        <transparent>false</transparent>
+        <visible>true</visible>
+    </initialWindow>
+    
+    
+    <allowBrowserInvocation>true</allowBrowserInvocation>
+    <icon>
+    </icon>
+    
+    <fileTypes>
+    </fileTypes>
+</application>

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="400" height="300" dockIconMenu="{compContext}" systemTrayIconMenu="{compContext}" windowComplete="create()">
+    <mx:Script>
+        <![CDATA[
+        import mx.events.FlexNativeMenuEvent;
+        import flash.ui.Keyboard;
+        
+        public function create():void{
+             var icon:BitmapData = new BitmapData(16,16,true,0x00FF0000);
+             NativeApplication.nativeApplication.icon.bitmaps = [icon];
+        }
+        
+        [Bindable]
+        private var foodData:XMLList = 
+            <>
+            <menuitem myLabel="Fruit" myEnabled="true">
+                <menuitem myLabel="Strawberry" myToggled="true" myEnabled="false"/>
+                <menuitem myLabel="Banana" type="fruit"/>
+                <menuitem type="separator" myEnabled="false"/>
+                <menuitem myLabel="Citrus"/>
+                <menuitem myLabel="Orange">
+                    <menuitem myLabel="Blood" myToggled="false"/>
+                    <menuitem myLabel="Navel" myToggled="true"/>
+                    <menuitem myLabel="Valencia" myToggled="false"/>
+                </menuitem>
+                <menuitem myLabel="Grapefruit">
+                    <menuitem myLabel="Ruby Red" type="check" myToggled="true"/>
+                </menuitem>
+                <menuitem myLabel="Peach" changeMe="one"/>
+            </menuitem>
+            <menuitem myLabel="Meat">
+                <menuitem myLabel="Chicken"/>
+                <menuitem myLabel="Beef"/>
+                <menuitem myLabel="Lamb"/>
+                <menuitem myLabel="Pork"/>
+            </menuitem>
+            </>;
+        
+        [Bindable]
+        private var pastaData:XMLList = 
+            <>
+            <menuitem label="Pasta" keys="1">
+                <menuitem label="elbow macaroni" underscore="2" keys="M" />
+                <menuitem label="cavatappi" underscore="1" keys="C"/>
+                <menuitem label="rotini" keys="R" shiftKey="true"/>
+                <menuitem label="spaghetti" keys="COMMA"/>
+            </menuitem>
+            <menuitem type="separator" underscore="3" keys="DELETE"/>
+            <menuitem label="Candy" underscore="0" keys="BACKSPACE" cmdKey="true" ctrlKey="true">
+                <menuitem label="Rock" cmdKey="true"/>
+                <menuitem label="Caramel" altKey="true"/>
+                <menuitem label="Taffy" underscore="3" ctrlKey="true"/>
+            </menuitem>
+            </>;
+        
+        [Bindable]
+        private var mnemonicData:XMLList = 
+            <>
+            <menuitem label="G_eneric">
+                <menuitem label="hone_y"/>
+                <menuitem label="1234_567"/>
+                <menuitem label="strawberryjamandpeanutbuttersandwic_h"/>
+                <menuitem label="012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678_9"/>
+                <menuitem label="thequickbrownfoxjumpsoverthelazydogthequickbrownf_oxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog"/>
+                <menuitem label="!@#$%^&*(()_+="/>
+            </menuitem>
+            <menuitem label="G_eneric">
+                <menuitem label="te_a"/>
+                <menuitem label="glas_s"/>
+                <menuitem label="bees__wax"/>
+                <menuitem label="honey_s"/>
+                <menuitem label="roses"/>
+                <menuitem label="_water"/>
+            </menuitem>
+            </>;
+        
+        [Bindable]
+        public var japaneseData:XMLList = 
+            <>
+            <menuitem label="_コンテンツストア" 忘年会向けの="ト">
+                <menuitem label="グルメ" data="10" 忘年会向けの="グ" スポーツ="ル"/>
+                <menuitem label="保_険" data="10" 忘年会向けの="保" スポーツ="険"/>
+                <menuitem label="求人" data="0" 忘年会向けの="求" スポーツ="人"/>
+            </menuitem>
+            <menuitem label="ボランティア" >
+                <menuitem label="政治" data="10" 忘年会向けの="政" スポーツ="治"/>
+                <menuitem label="旅行" data="5" 忘年会向けの="行" スポーツ="政"/>
+                <menuitem type="separator" />
+                <menuitem label="翻訳" data="0" 忘年会向けの="翻" スポーツ="訳"/>
+                <menuitem label="ブログ" data="0" 忘年会向けの="ブ" スポーツ="P"/>
+            </menuitem>
+            </>;
+
+        [Bindable]
+        public var cakeData:XMLList =
+           <>
+            <menuitem label="Frosting" keys="1">
+                <menuitem label="Whipped Creme" data="10" keys="W" aKey="C"/>
+                <menuitem label="Fondant" data="10" keys="O" aKey="D"/>
+                <menuitem label="None" data="0" keys="N" aKey="E"/>
+            </menuitem>
+            <menuitem label="Decorations" >
+                <menuitem label="Flowers" data="10" keys="F" aKey="W"/>
+                <menuitem label="Candy" data="5" keys="C" aKey="Y"/>
+                <menuitem type="separator" />
+                <menuitem label="Ribbon" data="0" keys="B" aKey="R"/>
+                <menuitem label="Topper" data="0" keys="T" aKey="P"/>
+            </menuitem>
+            </>;
+
+        [Bindable]
+        public var cakeDataArray:Array = 
+            [{label:"Frosting", keys:"1", children: [
+                {label:"Whipped Creme", data:"10", keys:"W", aKey:"C"},
+                {label:"Fondant", data:"10", keys:"O", aKey:"D"},
+                {label:"None", data:"0", keys:"N", aKey:"E"}
+             ]},
+            {label:"Decorations", children: [
+                {label:"Flowers", data:"10", keys:"F", aKey:"W"},
+                {label:"Candy", data:"10", keys:"C", aKey:"Y"},
+                {type:"separator"},
+                {label:"Ribbon", data:"0", keys:"B", aKey:"1"},
+                {label:"Topper", data:"0", keys:"T", aKey:"2"}
+            ]}
+            ];
+            
+        private function myMnemonicFn(item:Object):int
+        {
+            var key:int = -1;
+            key = (item.@myLabel.toString().length - 1);
+            trace("Key: " + key);
+            trace("item: " + item.@myLabel.toString().length, item);
+            return key; 
+        }
+        
+        private function myLabelFn(item:Object):String
+        {
+            var newLabel:String;
+            newLabel = item.@myLabel.toString() + "_1";
+            return newLabel;
+        }
+        
+        private function getKeyEquivalentField(item:Object):String
+        {
+            if(item.@data > 5) 
+            {  
+               return item.@keys;
+            }
+            else 
+            {
+               return item.@aKey;
+            } 
+        }
+        
+        private function getKeyEquivalentField2(item:Object):String
+        {
+            if(item.data > 5) 
+            {  
+                 return item.keys;
+            }
+            else 
+            {
+                 return item.aKey;
+            } 
+        }
+        
+        public function setKeyFunction(fnm:FlexNativeMenu, i:int): void
+        {
+            if(i==0)
+            { 
+                fnm.keyEquivalentFunction = getKeyEquivalentField;
+            }
+            else
+            {
+                fnm.keyEquivalentFunction = getKeyEquivalentField2;
+            }
+        }
+        
+        private function getModifiers(item:Object):Array
+        {
+            var myOS:String = Capabilities.os;
+            var newArray:Array = [];
+            if(item.@data == "0")
+            {
+                newArray.push(Keyboard.SHIFT);
+            }
+            else
+            {
+                newArray.push(Keyboard.SHIFT);
+                if(myOS.indexOf('Windows', 0) != -1)
+                {
+                    newArray.push(Keyboard.CONTROL);
+                }
+                else if(myOS.indexOf('Mac', 0) != -1)
+                {
+                    newArray.push(Keyboard.COMMAND);
+                }
+                
+                newArray.push(Keyboard.ALTERNATE);
+            }
+            
+            return newArray;
+        }
+        
+        public function setModifierFunction(fnm:FlexNativeMenu):void
+        {
+            fnm.keyEquivalentModifiersFunction = getModifiers;
+        }
+        
+    ]]>
+    </mx:Script>
+            
+    <mx:menu>
+        <mx:FlexNativeMenu id="fnm_1" dataProvider="{foodData}" labelField="@myLabel" labelFunction="myLabelFn" mnemonicIndexFunction="myMnemonicFn"/>
+    </mx:menu>
+    
+    <mx:flexContextMenu>
+        <mx:FlexNativeMenu id="mainContext" dataProvider="{foodData}" labelFunction="myLabelFn"/>
+    </mx:flexContextMenu>
+    
+    <mx:MenuBar dataProvider="{foodData}" labelField="@myLabel" />
+    
+    <mx:FlexNativeMenu id="compContext" dataProvider="{pastaData}" labelField="@label" mnemonicIndexField="@underscore" keyEquivalentField="@keys"/>
+    <mx:FlexNativeMenu id="underlineContext" dataProvider="{mnemonicData}" labelField="@label"/>
+    <mx:FlexNativeMenu id="keyfunctions" dataProvider="{cakeData}"  labelField="@label" keyEquivalentFunction="getKeyEquivalentField" 
+        keyEquivalentModifiersFunction="getModifiers" />
+    <mx:FlexNativeMenu id="jpMenus" dataProvider="{japaneseData}"  labelField="@label" keyEquivalentField="@忘年会向けの"/>
+    <mx:FlexNativeMenu id="emptyFNM" />
+    
+    <mx:VBox id="myVBox" borderStyle="solid" flexContextMenu="{compContext}">
+        <mx:Label text="My VBox"/>
+    </mx:VBox>
+    
+    <mx:VBox id="anotherVBox" borderStyle="solid" flexContextMenu="{underlineContext}">
+        <mx:Label text="My VBox"/>
+    </mx:VBox>
+    
+    <mx:VBox id="VBox3" borderStyle="solid" flexContextMenu="{keyfunctions}">
+        <mx:Label text="My VBox"/>
+    </mx:VBox>  
+    
+    <mx:VBox id="jpVBox" borderStyle="solid" flexContextMenu="{jpMenus}">
+        <mx:Label text="My VBox"/>
+    </mx:VBox> 
+
+    <mx:VBox id="VBox4" borderStyle="solid" >
+        <mx:Label text="My VBox"/>
+    </mx:VBox>  
+    
+</mx:WindowedApplication>

Added: incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.xml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.xml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/FlexNativeMenu/SWFs/FNM_MnemonicsKeys_Main.xml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+
+  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.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/3.1">
+    <id>Mnemonics</id>
+    <version>0.6.7</version>
+    <filename>MnemonicsKeys</filename>
+    <copyright>Copyright 2012 The Apache Software Foundation</copyright>
+    
+<versionNumber>1</versionNumber>
+    <initialWindow>
+        <content>FNM_MnemonicsKeys_Main.swf</content>   
+        <title>Mnemonics and Keys</title>
+        <systemChrome>standard</systemChrome>
+        <transparent>false</transparent>
+        <visible>true</visible>
+    </initialWindow>
+    
+    
+    <allowBrowserInvocation>true</allowBrowserInvocation>
+    <icon>
+    </icon>
+    
+    <fileTypes>
+    </fileTypes>
+</application>



Mime
View raw message