Packageorg.springextensions.actionscript.stage
SVN browsingFlexStageProcessorRegistry.as
FisheyeFlexStageProcessorRegistry.as
Classpublic class FlexStageProcessorRegistry
ImplementsIStageProcessorRegistry

A singleton implementation of the IStageProcessorRegistry that can be shared amongst FlexXMLApplicationContext instances that perform stage processing.



Sample project: stagewiring (source)


Public Properties
 PropertyDefined by
  enabled : Boolean
Determines if the current IStageProcessorRegistry is enabled.
FlexStageProcessorRegistry
  initialized : Boolean
[read-only] True if the current IStageProcessorRegistry has been initialized.
FlexStageProcessorRegistry
  modulePolicy : ModulePolicy
Determines how the FlexStageProcessorRegistry handles Modules that are added to the stage.
FlexStageProcessorRegistry
  numRegistrations : uint
[read-only] The number of IObjectSelector registrations.
FlexStageProcessorRegistry
Protected Properties
 PropertyDefined by
  stageProcessorRegistrations : Array
An Array of StageProcessorRegistrations instances.
FlexStageProcessorRegistry
Public Methods
 MethodDefined by
  
FlexStageProcessorRegistry(singletonToken:Object)
Creates a new FlexStageProcessorRegistry.
FlexStageProcessorRegistry
  
clear():void
Clears the all processor and context registrations in the current IStageProcessorRegistry
FlexStageProcessorRegistry
  
Retrieves a list of all the IObjectSelectors that have been registered with the current IStageProcessorRegistry.
FlexStageProcessorRegistry
  
Retrieves a list of all the IStageProcessors that have been registered with the current IStageProcessorRegistry.
FlexStageProcessorRegistry
  
[static] Returns a singleton instance for the current FlexStageProcessorRegistry.
FlexStageProcessorRegistry
  
Retrieves the IObjectSelector instance that is associated with the specified IStageProcessor instance.
FlexStageProcessorRegistry
  
getStageProcessorByName(name:String):Array
Retrieves a list of all the IStageProcessors with the specified name.
FlexStageProcessorRegistry
  
getStageProcessorsByDocument(document:Object):Array
FlexStageProcessorRegistry
  
getStageProcessorsByType(type:Class):Array
Retrieves a list of all the IStageProcessors of the specified Class.
FlexStageProcessorRegistry
  
initialize():void
Performs initialization of the IStageProcessorRegistry.
FlexStageProcessorRegistry
  
processDisplayObject(displayObject:DisplayObject):void
Detects whether an object added to the stage is a candidate for processing through the list of StageProcessorRegistration instances, if any IObjectSelector approves of the object its associated IStageProcessor's process() method is invoked.
FlexStageProcessorRegistry
  
processStage(startComponent:DisplayObject = null):void
Recursively loops through the stage displaylist and processes every object therein.
FlexStageProcessorRegistry
  
registerContext(parentDocument:Object, applicationContext:IApplicationContext):void
Registers the specified IApplicationContext with the current IStageProcessorRegistry by associating it with the specified parentDocument.
FlexStageProcessorRegistry
  
registerStageProcessor(name:String, stageProcessor:IStageProcessor, objectSelector:IObjectSelector):void
Adds the specified IStageProcessor instance to the collection.
FlexStageProcessorRegistry
  
registerWindow(window:IEventDispatcher):void
FlexStageProcessorRegistry
  
FlexStageProcessorRegistry
  
unregisterContext(parentDocument:Object, applicationContext:IApplicationContext):void
Unregisters the specified IApplicationContext with the current IStageProcessorRegistry by removing its association it with the specified parentDocument.
FlexStageProcessorRegistry
  
unregisterStageProcessor(name:String, document:Object):void
Removes the IStageProcessor with the specified name.
FlexStageProcessorRegistry
  
unregisterWindow(window:IEventDispatcher):void
FlexStageProcessorRegistry
Protected Methods
 MethodDefined by
  
added_handler(event:Event):void
If enabled is true this event handler passes the event.target to the processStageComponent() method.
FlexStageProcessorRegistry
  
flexStageProcessorRegistryInit(singletonToken:Object):void
FlexStageProcessorRegistry
  
getRoot(component:UIComponent):Object
Retrieves the root component of the given UIComponent.
FlexStageProcessorRegistry
  
processDisplayObjectRecursively(displayObject:DisplayObject):void
Sends the specified DisplayObject instance to the processStageComponent() method, then loops through its children and recursively sends those to the processStageComponent() method.
FlexStageProcessorRegistry
  
processDisplayObjectWithStageProcessorRegistration(displayObject:DisplayObject, stageProcessorRegistration:StageProcessorRegistration):void
First searches for all the IStageProcessors with a document property that match the specified stageComponent.parentDocument property and lets these IStageProcessors process the stageComponent.
FlexStageProcessorRegistry
Public Constants
 ConstantDefined by
  MX_WINDOW_CLASS : String = "mx.core::Window"
[static]
FlexStageProcessorRegistry
  SPARK_WINDOW_CLASS : String = "spark.components::Window"
[static]
FlexStageProcessorRegistry
Property detail
enabledproperty
enabled:Boolean  [read-write]

Determines if the current IStageProcessorRegistry is enabled.

Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
initializedproperty 
initialized:Boolean  [read-only]

True if the current IStageProcessorRegistry has been initialized.

Implementation
    public function get initialized():Boolean
modulePolicyproperty 
public var modulePolicy:ModulePolicy

Determines how the FlexStageProcessorRegistry handles Modules that are added to the stage.

numRegistrationsproperty 
numRegistrations:uint  [read-only]

The number of IObjectSelector registrations.

Implementation
    public function get numRegistrations():uint
stageProcessorRegistrationsproperty 
protected var stageProcessorRegistrations:Array

An Array of StageProcessorRegistrations instances.

See also

Constructor detail
FlexStageProcessorRegistry()constructor
public function FlexStageProcessorRegistry(singletonToken:Object)

Creates a new FlexStageProcessorRegistry. Do not call this constructor directly, invoke getInstance() instead.

Parameters
singletonToken:Object
Method detail
added_handler()method
protected function added_handler(event:Event):void

If enabled is true this event handler passes the event.target to the processStageComponent() method.

Parameters
event:Event — The Event.ADDED instance.
clear()method 
public function clear():void

Clears the all processor and context registrations in the current IStageProcessorRegistry

flexStageProcessorRegistryInit()method 
protected function flexStageProcessorRegistryInit(singletonToken:Object):voidParameters
singletonToken:Object
getAllObjectSelectors()method 
public function getAllObjectSelectors():Array

Retrieves a list of all the IObjectSelectors that have been registered with the current IStageProcessorRegistry.

Returns
Array — An Array of IObjectSelectors.
getAllStageProcessors()method 
public function getAllStageProcessors():Array

Retrieves a list of all the IStageProcessors that have been registered with the current IStageProcessorRegistry.

Returns
Array — An Array of IStageProcessors.
getInstance()method 
public static function getInstance():FlexStageProcessorRegistry

Returns a singleton instance for the current FlexStageProcessorRegistry. Use this method to receive an instance of FlexStageProcessorRegistry instead of calling the constructor directly.

Returns
FlexStageProcessorRegistry
getObjectSelectorForStageProcessor()method 
public function getObjectSelectorForStageProcessor(stageProcessor:IStageProcessor):IObjectSelector

Retrieves the IObjectSelector instance that is associated with the specified IStageProcessor instance.

Parameters
stageProcessor:IStageProcessor — The specified IStageProcessor.

Returns
IObjectSelector — The IObjectSelector instance that is associated with the specified IStageProcessor, or null if none was found.
getRoot()method 
protected function getRoot(component:UIComponent):Object

Retrieves the root component of the given UIComponent. The root will either be the Application, Module or (native) Window the component lives in.

Parameters
component:UIComponent

Returns
Object
getStageProcessorByName()method 
public function getStageProcessorByName(name:String):Array

Retrieves a list of all the IStageProcessors with the specified name.

Parameters
name:String — The specified name

Returns
Array — An Array of IStageProcessors, or null if none was found.
getStageProcessorsByDocument()method 
public function getStageProcessorsByDocument(document:Object):ArrayParameters
document:Object

Returns
Array
getStageProcessorsByType()method 
public function getStageProcessorsByType(type:Class):Array

Retrieves a list of all the IStageProcessors of the specified Class.

Parameters
type:Class — the specified Class.

Returns
Array — An Array of IStageProcessors.
initialize()method 
public function initialize():void

Performs initialization of the IStageProcessorRegistry.

processDisplayObject()method 
public function processDisplayObject(displayObject:DisplayObject):void

Detects whether an object added to the stage is a candidate for processing through the list of StageProcessorRegistration instances, if any IObjectSelector approves of the object its associated IStageProcessor's process() method is invoked.

Parameters
displayObject:DisplayObject — a reference to the object that was added to the stage

See also

processDisplayObjectRecursively()method 
protected function processDisplayObjectRecursively(displayObject:DisplayObject):void

Sends the specified DisplayObject instance to the processStageComponent() method, then loops through its children and recursively sends those to the processStageComponent() method.

Parameters
displayObject:DisplayObject — The specified DisplayObject instance
processDisplayObjectWithStageProcessorRegistration()method 
protected function processDisplayObjectWithStageProcessorRegistration(displayObject:DisplayObject, stageProcessorRegistration:StageProcessorRegistration):void

First searches for all the IStageProcessors with a document property that match the specified stageComponent.parentDocument property and lets these IStageProcessors process the stageComponent. If no matching IStageProcessors are found a list of IStageProcessors is retrieved that have a document property whose value matches the current Application.

Parameters
displayObject:DisplayObject — The UIComponent instance that needs to be processed.
 
stageProcessorRegistration:StageProcessorRegistration — The StageProcessorRegistration instance that is searched for appropriate IStageProcessor instances.
processStage()method 
public function processStage(startComponent:DisplayObject = null):void

Recursively loops through the stage displaylist and processes every object therein.

Parameters
startComponent:DisplayObject (default = null) — Optionally a start component can be specified that will be used as the root for recursion.
registerContext()method 
public function registerContext(parentDocument:Object, applicationContext:IApplicationContext):void

Registers the specified IApplicationContext with the current IStageProcessorRegistry by associating it with the specified parentDocument.

Parameters
parentDocument:Object — The specified parentDocument, if this is not a Module the specified IApplicationContext will be associated with the current Application.
 
applicationContext:IApplicationContext — The specified IApplicationContext.
registerStageProcessor()method 
public function registerStageProcessor(name:String, stageProcessor:IStageProcessor, objectSelector:IObjectSelector):void

Adds the specified IStageProcessor instance to the collection.

Parameters
name:String — The name of the IStageProcessor, if an instance by that name and with the same document property already exists in the collection it will be replaced.
 
stageProcessor:IStageProcessor — The specified IStageProcessor instance.
 
objectSelector:IObjectSelector
registerWindow()method 
public function registerWindow(window:IEventDispatcher):voidParameters
window:IEventDispatcher
removeStageProcesser()method 
public function removeStageProcesser(processor:IStageProcessor):voidParameters
processor:IStageProcessor
unregisterContext()method 
public function unregisterContext(parentDocument:Object, applicationContext:IApplicationContext):void

Unregisters the specified IApplicationContext with the current IStageProcessorRegistry by removing its association it with the specified parentDocument.

Parameters
parentDocument:Object — The specified parentDocument.
 
applicationContext:IApplicationContext — The specified IApplicationContext.
unregisterStageProcessor()method 
public function unregisterStageProcessor(name:String, document:Object):void

Removes the IStageProcessor with the specified name.

Parameters
name:String — The name of the IStageProcessor that will be removed
 
document:Object
unregisterWindow()method 
public function unregisterWindow(window:IEventDispatcher):voidParameters
window:IEventDispatcher
Constant detail
MX_WINDOW_CLASSconstant
public static const MX_WINDOW_CLASS:String = "mx.core::Window"
SPARK_WINDOW_CLASSconstant 
public static const SPARK_WINDOW_CLASS:String = "spark.components::Window"