Apache Flex (FlexJS) 0.7.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
ItemRendererClassFactory

Package | org.apache.flex.core
Class | public class ItemRendererClassFactory
Inheritance | ItemRendererClassFactory Strand EventDispatcher flash.events.EventDispatcher
Implements | IItemRendererClassFactory, IDocument, IBead

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The ItemRendererClassFactory class is the default implementation of IItemRendererClassFactory. This implementation checks for an itemRenderer property on the strand, then looks for a default definition in CSS, but also handles the renderer being defined in MXML in sub tags of the ItemRendererClassFactory. Other more advanced implementations could return different renderers based on the data item's type.

Default MXML Property `mxmlContent`

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | beads : Array | Strand
|  | createFunction : Function This is the method that actually does the work for createItemRenderer. | ItemRendererClassFactory
|  | id : String An id property for MXML documents. | Strand
|  | itemRendererFactory : IFactory Stores the IFactory that will be used to generate item renderer instances if createFromClass is the createFunction. | ItemRendererClassFactory
|  | model : IBeadModel An IBeadModel that serves as the data model for the component. | Strand
|  | mxmlContent : Array The default property. | ItemRendererClassFactory
|  | MXMLDescriptor : Array [read-only] An array of data that describes the MXML attributes and tags in an MXML document. | ItemRendererClassFactory
|  | strand : IStrand [write-only] The host component for this bead. | ItemRendererClassFactory

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ItemRendererClassFactory() Constructor. | ItemRendererClassFactory
|  | addBead(bead:IBead):void Add a bead to the strand. | Strand
|  | createFromClass(parent:IItemRendererParent):IItemRenderer Creates an instance of an item renderer from itemRendererFactory. | ItemRendererClassFactory
|  | createItemRenderer(parent:IItemRendererParent):IItemRenderer This method is called to generate another instance of an item renderer and attach it to the given parent. | ItemRendererClassFactory
|  | getBeadByType(classOrInterface:Class):IBead Find a bead on the strand. | Strand
|  | removeBead(value:IBead):IBead Remove a bead from the strand. | Strand
|  | setDocument(document:Object, id:String = null):void This method is called to notify an instance of what MXML document it belongs to, if any, and what its assigned id is in that document, if any. | ItemRendererClassFactory

Protected Methods

| Method | Defined By
--- | --- | ---
|  | createFromMXMLContent(parent:IItemRendererParent):IItemRenderer Creates an instance of an item renderer from child MXML tags. | ItemRendererClassFactory

Property Detail

createFunction | property

`public var createFunction:Function`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

This is the method that actually does the work for createItemRenderer. It defaults to creating an instance from child MXML tags, but if the strand has an item renderer property or style, it switches to generating instances of the item renderer specified by that property or style. And yes, since it is public, you could theoretically assign some other method that generates item renderer instances.

itemRendererFactory | property |

`public var itemRendererFactory:IFactory`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Stores the IFactory that will be used to generate item renderer instances if createFromClass is the createFunction.

mxmlContent | property |

`public var mxmlContent:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The default property. Child tags in MXML documents get assigned to this property, but are actually encoded by the compiler into the MXMLDescriptor array. Therefore, setting this property from ActionScript will have no effect at runtime.

MXMLDescriptor | property |

`MXMLDescriptor:Array` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

An array of data that describes the MXML attributes and tags in an MXML document. This data is usually decoded by an MXMLDataInterpreter

Implementation
`public function get MXMLDescriptor():Array`

strand | property |

`strand:IStrand` [write-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The host component for this bead.

Implementation
`public function set strand(value:IStrand):void`
Constructor Detail

ItemRendererClassFactory | () | Constructor

`public function ItemRendererClassFactory()`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Constructor.

Method Detail

createFromClass | () | method

`public function createFromClass(parent:IItemRendererParent):IItemRenderer`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Creates an instance of an item renderer from itemRendererFactory.

Parameters

| `parent:IItemRendererParent`

Returns

| `IItemRenderer`

createFromMXMLContent | () | method |

`protected function createFromMXMLContent(parent:IItemRendererParent):IItemRenderer`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Creates an instance of an item renderer from child MXML tags.

Parameters

| `parent:IItemRendererParent`

Returns

| `IItemRenderer`

createItemRenderer | () | method |

`public function createItemRenderer(parent:IItemRendererParent):IItemRenderer`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

This method is called to generate another instance of an item renderer and attach it to the given parent.

Parameters

| `parent:IItemRendererParent` — The parent of the item renderer.

Returns

| `IItemRenderer` — The item renderer.

setDocument | () | method |

`public function setDocument(document:Object, id:String = null):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

This method is called to notify an instance of what MXML document it belongs to, if any, and what its assigned id is in that document, if any.

Parameters

| `document:Object` — The MXML document that hosts this component.
| `id:String` (default = `null`)`` — The optional id of the component in the document.

Mon Sep 5 2016, 07:19 AM -07:00