This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6f91b9a  Spark TabBar with button item renderer.
6f91b9a is described below

commit 6f91b9af09cedbec6974449df6f6f3f7b66152c6
Author: DESKTOP-RH4S838\Yishay <[email protected]>
AuthorDate: Sun Oct 27 14:33:17 2019 +0200

    Spark TabBar with button item renderer.
    
    Reference #475
---
 .../src/main/royale/mx/core/UIComponent.as         |  23 +-
 .../SparkRoyale/src/main/resources/defaults.css    |   9 +-
 .../src/main/resources/spark-royale-manifest.xml   |   1 +
 .../src/main/royale/spark/components/TabBar.as     | 316 ++++++++++-----------
 .../supportClasses/SparkTextButtonItemRenderer.as  | 285 +++++++++++++++++++
 5 files changed, 462 insertions(+), 172 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 225004d..69724fc 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -4996,21 +4996,20 @@ COMPILE::JS
     {
         COMPILE::JS
         {
-        var oldValue:Boolean = positioner.style.display !== 'none';
-        if (value !== oldValue) 
-        {
-            if (!value) 
-            {
-                displayStyleForLayout = positioner.style.display;
-                positioner.style.display = 'none';
-            } 
-            else 
+            var oldValue:Boolean = (!positioner.style.visibility) ||
+                                    positioner.style.visibility == 'visible';
+            if (Boolean(value) !== oldValue)
             {
-                if (displayStyleForLayout != null)
-                    positioner.style.display = displayStyleForLayout;
+                if (!value) 
+                {
+                    positioner.style.visibility = 'hidden';
+                } 
+                else 
+                {
+                    positioner.style.visibility = 'visible';
+                }
             }
         }
-        }
         COMPILE::SWF
         {
             super.visible = value;
diff --git a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css 
b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
index b6e512d..471e1b3 100644
--- a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
@@ -86,8 +86,8 @@ NonVirtualHDataGroup
        IBeadController: 
ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
        IBeadLayout: ClassReference("spark.layouts.HorizontalLayout");
        IItemRendererClassFactory: 
ClassReference("org.apache.royale.core.ItemRendererClassFactory");
-       IItemRenderer: 
ClassReference("mx.controls.listClasses.ListItemRenderer");
-       IViewport: 
ClassReference("org.apache.royale.html.supportClasses.HScrollViewport");
+       IItemRenderer: 
ClassReference("spark.components.supportClasses.SparkTextButtonItemRenderer");
+       IViewport: 
ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
        IViewportModel: 
ClassReference("org.apache.royale.html.beads.models.ViewportModel");
 }
 
@@ -174,6 +174,11 @@ TabBar
        IBeadController: 
ClassReference("spark.components.beads.controllers.TabBarController")
 }
 
+SparkTextButtonItemRenderer
+{
+       IBeadModel: 
ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
+}
+
 TextArea
 {
        border-style: solid;
diff --git 
a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml 
b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
index 63c11a3..74e7605 100644
--- 
a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
+++ 
b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
@@ -113,6 +113,7 @@
     <component id="NonVirtualHDataGroup" 
class="spark.components.NonVirtualHDataGroup"/>
     <component id="NonVirtualVDataGroup" 
class="spark.components.NonVirtualVDataGroup"/>
     <component id="MXAdvancedDataGridItemRenderer" 
class="spark.controls.advancedDataGridClasses.MXAdvancedDataGridItemRenderer"/>
+    <component id="SparkTextButtonItemRenderer" 
class="spark.components.supportClasses.SparkTextButtonItemRenderer"/>
 
        
 </componentPackage>
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TabBar.as 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TabBar.as
index ca40a6a..4148226 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TabBar.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TabBar.as
@@ -19,186 +19,186 @@
 
 package spark.components
 {
-/* import flash.events.EventPhase;
-import flash.events.FocusEvent;
-import flash.events.KeyboardEvent;
-import flash.events.MouseEvent;
-import flash.ui.Keyboard; 
+    /* import flash.events.EventPhase;
+    import flash.events.FocusEvent;
+    import flash.events.KeyboardEvent;
+    import flash.events.MouseEvent;
+    import flash.ui.Keyboard; 
 
-import mx.core.EventPriority;
-import mx.core.IFactory;
-import mx.core.ISelectableList;
-import mx.core.IVisualElement;
-import mx.core.mx_internal;
+    import mx.core.EventPriority;
+    import mx.core.IFactory;
+    import mx.core.ISelectableList;
+    import mx.core.IVisualElement;
+    import mx.core.mx_internal;
 
-import spark.components.supportClasses.ButtonBarBase;
-import spark.components.supportClasses.ItemRenderer;
-import spark.events.IndexChangeEvent;
-import spark.events.RendererExistenceEvent;
+    import spark.components.supportClasses.ButtonBarBase;
+    import spark.components.supportClasses.ItemRenderer;
+    import spark.events.IndexChangeEvent;
+    import spark.events.RendererExistenceEvent;
 
-use namespace mx_internal;  // ListBase/setCurrentCaretIndex(index);
-*/
-import mx.managers.IFocusManagerComponent;
-import spark.components.supportClasses.ListBase;
-import spark.layouts.supportClasses.LayoutBase;
-import org.apache.royale.core.ILayoutHost;
-import org.apache.royale.core.IStrand;
-import mx.core.IUIComponent;
-/**
- *  Defines the radius of the TabBar buttons' top-left and top-right corners 
for the default
- *  TabBarButton skin.
- *
- *  @default 4
- * 
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-//[Style(name="cornerRadius", type="Number", format="Length", inherit="no", 
theme="spark")]
-
-//--------------------------------------
-//  Other metadata
-//--------------------------------------
+    use namespace mx_internal;  // ListBase/setCurrentCaretIndex(index);
+    */
+    import mx.managers.IFocusManagerComponent;
+    import spark.components.supportClasses.ListBase;
+    import spark.layouts.supportClasses.LayoutBase;
+    import org.apache.royale.core.ILayoutHost;
+    import org.apache.royale.core.IStrand;
+    import mx.core.IUIComponent;
+    /**
+     *  Defines the radius of the TabBar buttons' top-left and top-right 
corners for the default
+     *  TabBarButton skin.
+     *
+     *  @default 4
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    //[Style(name="cornerRadius", type="Number", format="Length", 
inherit="no", theme="spark")]
 
-//[AccessibilityClass(implementation="spark.accessibility.TabBarAccImpl")]
+    //--------------------------------------
+    //  Other metadata
+    //--------------------------------------
 
-//[IconFile("TabBar.png")]
+    //[AccessibilityClass(implementation="spark.accessibility.TabBarAccImpl")]
 
-/**
- * Because this component does not define a skin for the mobile theme, Adobe
- * recommends that you not use it in a mobile application. Alternatively, you
- * can define your own mobile skin for the component. For more information,
- * see <a 
href="http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c698e85712b3011fe73-8000.html";>Basics
 of mobile skinning</a>.
- */
-[DiscouragedForProfile("mobileDevice")]
+    //[IconFile("TabBar.png")]
 
-/**
- *  The TabBar class displays a set of identical tabs.  
- *  One tab can be selected at a time, and the first tab is selected by 
default.
- *  The TabBarSkin class arranges the tabs in a single row.  
- *  Use the TabBar <code>cornerRadius</code> style to configure the corner 
radius 
- *  of the tabs.
- * 
- *  <p>The set of tabs is defined by the <code>dataProvider</code> property.
- *  The appearance of the TabBar is defined by the TabBarSkin class.
- *  The appearance of each tab is defined by the TabBarButtonSkin class.</p>
- *
- *  <p>You can use the TabBar control to set the active child of a ViewStack 
container, 
- *  as the following example shows:</p>
- *
- *  <p><b>Note: </b>The Spark list-based controls (the Spark ListBase class 
and its subclasses
- *  such as ButtonBar, ComboBox, DropDownList, List, and TabBar) do not 
support the BasicLayout class
- *  as the value of the <code>layout</code> property. 
- *  Do not use BasicLayout with the Spark list-based controls.</p>
- *  
- *  <pre>
- *  &lt;s:TabBar dataProvider="{myViewStack}"/&gt; 
- *  
- *  &lt;mx:ViewStack id="myViewStack" 
- *      borderStyle="solid"&gt; 
- *  
- *      &lt;s:NavigatorContent id="search" label="Search"&gt; 
- *          &lt;s:Label text="Search Screen"/&gt; 
- *          &lt;/s:NavigatorContent&gt; 
- *  
- *      &lt;s:NavigatorContent id="custInfo" label="Customer Info"&gt; 
- *          &lt;s:Label text="Customer Info"/&gt; 
- *          &lt;/s:NavigatorContent&gt; 
- *  
- *      &lt;s:NavigatorContent id="accountInfo" label="Account Info"&gt; 
- *          &lt;s:Label text="Account Info"/&gt; 
- *          &lt;/s:NavigatorContent&gt; 
- *      &lt;/mx:ViewStack&gt; </pre>
- *
- *  <p>The TabBar container has the following default characteristics:</p>
- *  <table class="innertable">
- *     <tr><th>Characteristic</th><th>Description</th></tr>
- *     <tr><td>Default size</td><td>Large enough to display the tabs</td></tr>
- *     <tr><td>Minimum size</td><td>0 pixels</td></tr>
- *     <tr><td>Maximum size</td><td>10000 pixels wide and 10000 pixels 
high</td></tr>
- *  </table>
- *  
- *  @mxml <p>The <code>&lt;s:TabBar&gt;</code> tag inherits all of the tag 
- *  attributes of its superclass and adds the following tag attributes:</p>
- *
- *  <pre>
- *  &lt;s:TabBar
- *    <b>Styles</b>
- *    cornerRadius="4"
- *  /&gt;
- *  </pre>
- *
- *  @see mx.containers.ViewStack
- *  @see spark.skins.spark.TabBarSkin
- *  @see spark.skins.spark.TabBarButtonSkin
- * 
- *  @includeExample examples/TabBarExample.mxml
- *  
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-public class TabBar extends ListBase implements IFocusManagerComponent
-{ //extends ButtonBarBase implements IFocusManagerComponent
-    //include "../core/Version.as";
-    
-    
//--------------------------------------------------------------------------
-    //
-    //  Class mixins
-    //
-    
//--------------------------------------------------------------------------
-    
     /**
-     *  @private
-     *  Placeholder for mixin by TabBarAccImpl.
+     * Because this component does not define a skin for the mobile theme, 
Adobe
+     * recommends that you not use it in a mobile application. Alternatively, 
you
+     * can define your own mobile skin for the component. For more information,
+     * see <a 
href="http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c698e85712b3011fe73-8000.html";>Basics
 of mobile skinning</a>.
      */
-    //mx_internal static var createAccessibilityImplementation:Function;
+    [DiscouragedForProfile("mobileDevice")]
 
-    
     /**
-     *  Constructor.
+     *  The TabBar class displays a set of identical tabs.  
+     *  One tab can be selected at a time, and the first tab is selected by 
default.
+     *  The TabBarSkin class arranges the tabs in a single row.  
+     *  Use the TabBar <code>cornerRadius</code> style to configure the corner 
radius 
+     *  of the tabs.
+     * 
+     *  <p>The set of tabs is defined by the <code>dataProvider</code> 
property.
+     *  The appearance of the TabBar is defined by the TabBarSkin class.
+     *  The appearance of each tab is defined by the TabBarButtonSkin 
class.</p>
+     *
+     *  <p>You can use the TabBar control to set the active child of a 
ViewStack container, 
+     *  as the following example shows:</p>
+     *
+     *  <p><b>Note: </b>The Spark list-based controls (the Spark ListBase 
class and its subclasses
+     *  such as ButtonBar, ComboBox, DropDownList, List, and TabBar) do not 
support the BasicLayout class
+     *  as the value of the <code>layout</code> property. 
+     *  Do not use BasicLayout with the Spark list-based controls.</p>
+     *  
+     *  <pre>
+     *  &lt;s:TabBar dataProvider="{myViewStack}"/&gt; 
+     *  
+     *  &lt;mx:ViewStack id="myViewStack" 
+     *      borderStyle="solid"&gt; 
+     *  
+     *      &lt;s:NavigatorContent id="search" label="Search"&gt; 
+     *          &lt;s:Label text="Search Screen"/&gt; 
+     *          &lt;/s:NavigatorContent&gt; 
+     *  
+     *      &lt;s:NavigatorContent id="custInfo" label="Customer Info"&gt; 
+     *          &lt;s:Label text="Customer Info"/&gt; 
+     *          &lt;/s:NavigatorContent&gt; 
+     *  
+     *      &lt;s:NavigatorContent id="accountInfo" label="Account Info"&gt; 
+     *          &lt;s:Label text="Account Info"/&gt; 
+     *          &lt;/s:NavigatorContent&gt; 
+     *      &lt;/mx:ViewStack&gt; </pre>
+     *
+     *  <p>The TabBar container has the following default characteristics:</p>
+     *  <table class="innertable">
+     *     <tr><th>Characteristic</th><th>Description</th></tr>
+     *     <tr><td>Default size</td><td>Large enough to display the 
tabs</td></tr>
+     *     <tr><td>Minimum size</td><td>0 pixels</td></tr>
+     *     <tr><td>Maximum size</td><td>10000 pixels wide and 10000 pixels 
high</td></tr>
+     *  </table>
+     *  
+     *  @mxml <p>The <code>&lt;s:TabBar&gt;</code> tag inherits all of the tag 
+     *  attributes of its superclass and adds the following tag attributes:</p>
+     *
+     *  <pre>
+     *  &lt;s:TabBar
+     *    <b>Styles</b>
+     *    cornerRadius="4"
+     *  /&gt;
+     *  </pre>
+     *
+     *  @see mx.containers.ViewStack
+     *  @see spark.skins.spark.TabBarSkin
+     *  @see spark.skins.spark.TabBarButtonSkin
+     * 
+     *  @includeExample examples/TabBarExample.mxml
      *  
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function TabBar()
-    {
-        super();
+    public class TabBar extends ListBase implements IFocusManagerComponent
+    { //extends ButtonBarBase implements IFocusManagerComponent
+        //include "../core/Version.as";
         
-        typeNames += " TabBar";
+        
//--------------------------------------------------------------------------
+        //
+        //  Class mixins
+        //
+        
//--------------------------------------------------------------------------
         
-       // requireSelection = true;
-       // mouseFocusEnabled = false;        
-    }
+        /**
+         *  @private
+         *  Placeholder for mixin by TabBarAccImpl.
+         */
+        //mx_internal static var createAccessibilityImplementation:Function;
 
-    
//--------------------------------------------------------------------------
-    //
-    //  Overridden methods
-    //
-    
//--------------------------------------------------------------------------
-    
-    /**
-     *  @private
-     */
-    /* override protected function initializeAccessibility():void
-    {
-        if (TabBar.createAccessibilityImplementation != null)
-            TabBar.createAccessibilityImplementation(this);
-    } */
+        
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function TabBar()
+        {
+            super();
+            
+            typeNames += " TabBar";
+            
+        // requireSelection = true;
+        // mouseFocusEnabled = false;        
+        }
+
+        
//--------------------------------------------------------------------------
+        //
+        //  Overridden methods
+        //
+        
//--------------------------------------------------------------------------
+        
+        /**
+         *  @private
+         */
+        /* override protected function initializeAccessibility():void
+        {
+            if (TabBar.createAccessibilityImplementation != null)
+                TabBar.createAccessibilityImplementation(this);
+        } */
 
-    override public function get measuredWidth():Number
-    {
-        var contentView:IUIComponent = (this.view as ILayoutHost).contentView 
as IUIComponent;
-        if (contentView)
+        override public function get measuredWidth():Number
         {
-            (contentView.getBeadByType(LayoutBase) as LayoutBase).measure();
-            measuredWidth = contentView.measuredWidth;
+            var contentView:IUIComponent = (this.view as 
ILayoutHost).contentView as IUIComponent;
+            if (contentView)
+            {
+                (contentView.getBeadByType(LayoutBase) as 
LayoutBase).measure();
+                measuredWidth = contentView.measuredWidth;
+            }
+            return super.measuredWidth;
         }
-        return super.measuredWidth;
     }
-}
 }
\ No newline at end of file
diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
new file mode 100644
index 0000000..6890427
--- /dev/null
+++ 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as
@@ -0,0 +1,285 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+
+    import org.apache.royale.core.IBead;
+    import org.apache.royale.core.IBeadView;
+    import org.apache.royale.core.IChild;
+    import org.apache.royale.core.IParent;
+    import org.apache.royale.core.IStrand;
+    import org.apache.royale.events.IEventDispatcher;
+    import org.apache.royale.events.MouseEvent;
+    import org.apache.royale.html.util.getLabelFromData;
+    import spark.components.supportClasses.ToggleButtonBase;
+    import mx.controls.listClasses.IListItemRenderer;
+    import mx.events.ListEvent;
+    import org.apache.royale.core.IBeadModel;
+
+    /**
+     *  The TextButtonItemRenderer is the default renderer for TabBar
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+
+    public class SparkTextButtonItemRenderer extends ToggleButtonBase 
implements IListItemRenderer
+    {
+        public function SparkTextButtonItemRenderer()
+        {
+            super();
+            addEventListener("click", clickHandler);    
+            typeNames += " SparkTextButtonItemRenderer";
+        }
+            
+        override public function set selected(value:Boolean):void
+        {
+            super.selected = value;
+            updateRenderer();
+        }
+        /**
+         * @private
+         */
+        public function updateRenderer():void
+        {
+            COMPILE::SWF
+            {
+                // super.updateRenderer();
+                graphics.clear();
+                graphics.beginFill(0xFFFFFF, (down||selected||hovered)?1:0);
+                graphics.drawRect(0, 0, width, height);
+                graphics.endFill();
+            }
+            COMPILE::JS
+            {
+                if (selected)
+                    element.style.backgroundColor = '#9C9C9C';
+                else if (hovered)
+                    element.style.backgroundColor = '#ECECEC';
+                else
+                    element.style.backgroundColor = 'transparent';
+            }
+        }
+
+        private var _down:Boolean;
+        
+        /**
+                *  Whether or not the itemRenderer is in a down (or 
pre-selected) state.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.7
+                */
+               public function get down():Boolean
+               {
+                       return _down;
+               }
+               public function set down(value:Boolean):void
+               {
+                       _down = value;
+                       updateRenderer();
+               }
+
+               private var _hovered:Boolean;
+               
+               /**
+                *  Whether or not the itemRenderer is in a hovered state.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.7
+                */
+               public function get hovered():Boolean
+               {
+                       return _hovered;
+               }
+
+               public function set hovered(value:Boolean):void
+               {
+                       _hovered = value;
+                       updateRenderer();
+               }
+               
+        private var _rowIndex:int;
+        /**
+         *  Whether or not the itemRenderer is in a down (or pre-selected) 
state.
+         *
+         *  @langversion 3.0
+         */
+        public function get rowIndex():int
+        {
+            return _rowIndex;
+        }
+        public function set rowIndex(value:int):void
+        {
+            _rowIndex = value;
+        }
+
+        /**
+         * @royaleignorecoercion mx.core.UIComponent
+         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+         */
+        private function clickHandler(event:MouseEvent):void
+        {
+            var le:ListEvent = new ListEvent("itemClick");
+            le.rowIndex = rowIndex;
+            le.columnIndex = 0;
+            le.itemRenderer = this;
+            getComponentDispatcher().dispatchEvent(le);
+        }
+
+        private var _itemRendererParent:Object;
+        
+        /**
+         * The parent container for the itemRenderer instance.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public function get itemRendererParent():Object
+        {
+            return _itemRendererParent;
+        }
+        public function set itemRendererParent(value:Object):void
+        {
+            _itemRendererParent = value;
+        }
+                
+        private var _labelField:String = "label";
+        
+        /**
+         * The name of the field within the data to use as a label. Some 
itemRenderers use this field to
+            * identify the value they should show while other itemRenderers 
ignore this if they are showing
+            * complex information.
+            */
+        public function get labelField():String
+        {
+            return _labelField;
+        }
+        public function set labelField(value:String):void
+        {
+            _labelField = value;
+        }      
+
+        protected function getComponentDispatcher():IEventDispatcher
+        {
+            var irp:Object = itemRendererParent;
+            var p:IParent = parent;
+            while (p)
+            {
+                if (p is IStrand)
+                {
+                    var b:IBead = (p as IStrand).getBeadByType(IBeadView);
+                    if (b == irp) return p as IEventDispatcher;
+                }
+                p = (p as IChild).parent;
+            }
+            return null;
+        }
+        
+        /**
+         *  The text currently displayed by the itemRenderer instance.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public function get text():String
+        {
+            return label;
+        }
+
+        public function set text(value:String):void
+        {
+            label = value;
+        }
+
+        protected function dataToString(value:Object):String
+        {
+            if (value is XML)
+            {
+                var xml:XML = value as XML;
+                return xml[labelField];
+            }
+            return getLabelFromData(this,value);
+        }
+
+        private var _data:Object;
+        
+        [Bindable("__NoChangeEvent__")]
+        /**
+         *  The data being represented by this itemRenderer. This can be 
something simple like a String or
+         *  a Number or something very complex.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public function get data():Object
+        {
+            return _data;
+        }
+
+        public function set data(value:Object):void
+        {
+            _data = value;
+            text = dataToString(value);
+        }
+
+        public function get nestLevel():int
+        {
+            throw new Error("Method not implemented.");
+        }
+
+        public function set nestLevel(value:int):void
+        {
+            throw new Error("Method not implemented.");
+        }
+
+        public function get processedDescriptors():Boolean
+        {
+            throw new Error("Method not implemented.");
+        }
+
+        public function set processedDescriptors(value:Boolean):void
+        {
+            throw new Error("Method not implemented.");
+        }
+
+        public function get updateCompletePendingFlag():Boolean
+        {
+            throw new Error("Method not implemented.");
+        }
+
+        public function set updateCompletePendingFlag(value:Boolean):void
+        {
+            throw new Error("Method not implemented.");
+        }
+    }
+
+}

Reply via email to