This is an automated email from the ASF dual-hosted git repository. yishayw pushed a commit to branch SparkTextButtonItemRenderer in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit b0b287d52e8e1df0751c5231c430f22dccdf0709 Author: DESKTOP-RH4S838\Yishay <[email protected]> AuthorDate: Thu Oct 24 22:31:28 2019 +0300 Some fixes for TabBar and ViewStack, but mainly to demonstrated bug --- .../HelloWorld/src/main/royale/HelloWorld.mxml | 53 +++- .../src/main/royale/mx/core/UIComponent.as | 6 +- .../SparkRoyale/src/main/resources/defaults.css | 13 +- .../src/main/royale/SparkRoyaleClasses.as | 1 + .../src/main/royale/spark/components/TabBar.as | 316 ++++++++++----------- .../supportClasses/SparkTextButtonItemRenderer.as | 297 +++++++++++++++++++ 6 files changed, 513 insertions(+), 173 deletions(-) diff --git a/examples/mxroyale/HelloWorld/src/main/royale/HelloWorld.mxml b/examples/mxroyale/HelloWorld/src/main/royale/HelloWorld.mxml index 2a75c9b..8c08b8f 100644 --- a/examples/mxroyale/HelloWorld/src/main/royale/HelloWorld.mxml +++ b/examples/mxroyale/HelloWorld/src/main/royale/HelloWorld.mxml @@ -19,18 +19,51 @@ limitations under the License. --> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.apache.org/royale/mx" + xmlns:s="library://ns.apache.org/royale/spark" width="600" height="400" > - <!-- to do: layout="absolute" minWidth="955" minHeight="600" --> - <fx:Style> - @namespace mx "library://ns.apache.org/royale/mx"; + + <s:TabBar x="1.7" y="-24" dataProvider="{VS}" /> + + <mx:ViewStack x="10" width="100%" height="100%" id="VS" creationPolicy="all" top="22" bottom="0"> - /* set position:absolute to make the (x,y) properties work */ - mx|Label { - position: absolute; - } + <s:NavigatorContent label="General" width="100%" height="100%"> + + <s:Label id="lblCr4" text="Cr" textAlign="right" width="19"/> + + <s:TextInput id="ci_Gainloss_Cr5_Desc" editable="false" width="243" height="20"/> + + </s:NavigatorContent> - </fx:Style> + <s:NavigatorContent label="Delivery Location" width="100%" height="100%"> + + <mx:AdvancedDataGrid id="edgEntry" sortExpertMode="true" styleName="advancedDataGrid" + rowHeight="24" verticalAlign="middle"> + <mx:columns> + <mx:AdvancedDataGridColumn dataField="cdl_Loc_Code" headerText="Code" width=".15"/> + <mx:AdvancedDataGridColumn dataField="cdl_Address" headerText="Address" width=".45"/> + <mx:AdvancedDataGridColumn dataField="cdl_City_Code" headerText="City Code" + width=".45" visible="false"/> + <mx:AdvancedDataGridColumn dataField="cdl_City_Desc" headerText="City" width=".45"/> + </mx:columns> + </mx:AdvancedDataGrid> + + <mx:Button + buttonMode="true" label="Add" id="addBtn" + height="19" width="65"/> + + <mx:Button buttonMode="true" label="Edit" id="editBtn" + width="65" height="19"/> + + </s:NavigatorContent> + + <s:NavigatorContent label="Others" width="100%" height="100%"> + + + <s:Label text="Designation" textAlign="right" height="19" width="90" verticalAlign="middle"/> + <s:TextInput id="ci_Cont_Desig" width="190" fontFamily="Arial" height="19"/> + + </s:NavigatorContent> + + </mx:ViewStack> - <mx:Label text="Hello World" x="20" y="20" /> - </mx:Application> \ No newline at end of file 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 98c7add..5a43c37 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as @@ -4996,13 +4996,13 @@ COMPILE::JS { COMPILE::JS { - var oldValue:Boolean = positioner.style.display !== 'none'; + var oldValue:Boolean = positioner.style.visibility !== "hidden"; if (value !== oldValue) { if (!value) { - displayStyleForLayout = positioner.style.display; - positioner.style.display = 'none'; + displayStyleForLayout = positioner.style.visibility; + positioner.style.visibility = 'hidden'; } else { diff --git a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css index b6e512d..7a93438 100644 --- a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css +++ b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css @@ -40,10 +40,13 @@ Button { IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel"); } + CheckBox { IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel"); } + + ComboBox { IBeadModel: ClassReference("org.apache.royale.html.beads.models.ComboBoxModel"); @@ -86,8 +89,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 +177,11 @@ TabBar IBeadController: ClassReference("spark.components.beads.controllers.TabBarController") } +SparkTextButtonItemRenderer +{ + IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel"); +} + TextArea { border-style: solid; @@ -268,4 +276,5 @@ TextArea font-size: 11px; font-family: Arial; } + } diff --git a/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as b/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as index c80e561..4d39104 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/SparkRoyaleClasses.as @@ -81,6 +81,7 @@ internal class SparkRoyaleClasses import spark.components.beads.controllers.DropDownListController; DropDownListController; import spark.components.beads.controllers.TabBarController; TabBarController; import spark.controls.advancedDataGridClasses.MXAdvancedDataGridItemRenderer; MXAdvancedDataGridItemRenderer; + import spark.components.supportClasses.SparkTextButtonItemRenderer; SparkTextButtonItemRenderer; } 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> - * <s:TabBar dataProvider="{myViewStack}"/> - * - * <mx:ViewStack id="myViewStack" - * borderStyle="solid"> - * - * <s:NavigatorContent id="search" label="Search"> - * <s:Label text="Search Screen"/> - * </s:NavigatorContent> - * - * <s:NavigatorContent id="custInfo" label="Customer Info"> - * <s:Label text="Customer Info"/> - * </s:NavigatorContent> - * - * <s:NavigatorContent id="accountInfo" label="Account Info"> - * <s:Label text="Account Info"/> - * </s:NavigatorContent> - * </mx:ViewStack> </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><s:TabBar></code> tag inherits all of the tag - * attributes of its superclass and adds the following tag attributes:</p> - * - * <pre> - * <s:TabBar - * <b>Styles</b> - * cornerRadius="4" - * /> - * </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> + * <s:TabBar dataProvider="{myViewStack}"/> + * + * <mx:ViewStack id="myViewStack" + * borderStyle="solid"> + * + * <s:NavigatorContent id="search" label="Search"> + * <s:Label text="Search Screen"/> + * </s:NavigatorContent> + * + * <s:NavigatorContent id="custInfo" label="Customer Info"> + * <s:Label text="Customer Info"/> + * </s:NavigatorContent> + * + * <s:NavigatorContent id="accountInfo" label="Account Info"> + * <s:Label text="Account Info"/> + * </s:NavigatorContent> + * </mx:ViewStack> </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><s:TabBar></code> tag inherits all of the tag + * attributes of its superclass and adds the following tag attributes:</p> + * + * <pre> + * <s:TabBar + * <b>Styles</b> + * cornerRadius="4" + * /> + * </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..6dc86cf --- /dev/null +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SparkTextButtonItemRenderer.as @@ -0,0 +1,297 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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; + import org.apache.royale.html.beads.models.ToggleButtonModel; + + /** + * 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; + } + + private var _model:Object; + + override public function get model():Object + { + if (!_model) + { + _model = new ToggleButtonModel(); + } + return _model; + } + + 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."); + } + } + +}
