Packageorg.springextensions.actionscript.localization
Classpublic class LocalizationStageProcessor
InheritanceLocalizationStageProcessor Inheritance org.as3commons.stageprocessing.impl.AbstractStageObjectProcessor

IStageProcessor that can assign resource values based on the value of specified property on a stage component.



Public Properties
 PropertyDefined By
  bundleName : String
The name of the resource bundle that contains all te resource values.
LocalizationStageProcessor
  propertyName : String
LocalizationStageProcessor
  resourceManager : IResourceManager
The IResourceManager instance used to retrieve resource values from.
LocalizationStageProcessor
  resourceSuffixes : Vector.<String>
An Vector.<String> of suffixes that correspond to property names on the stage component. For example, a button with id 'myButton': <Button id="myButton"/> Can have its label property assigned automatically if a resourceName exists with this name: myButton_label=Click this button
LocalizationStageProcessor
Protected Properties
 PropertyDefined By
  componentCache : Dictionary
A Dictionary instance used to keep track of the stage components that have already been processed by the current LocalizationStageProcessor.
LocalizationStageProcessor
Public Methods
 MethodDefined By
  
Creates a new LocalizationStageProcessor instance.
LocalizationStageProcessor
  
dispose():void
[override]
LocalizationStageProcessor
  
process(object:DisplayObject):DisplayObject
[override]
LocalizationStageProcessor
Protected Methods
 MethodDefined By
  
assignResourceString(object:Object, propertyName:String, resourceSuffix:String):void
Combines the propertyName and resourceSuffix into a resource name with the form propertyName + _ + resourceSuffix. If the specified object has a property with the name specified by the resourceSuffix value, if a necessary resource value exists it is assigned to the property
LocalizationStageProcessor
  
assignResourceStrings(object:Object, propertyName:String):void
LocalizationStageProcessor
  
Adds the reassignResourceStrings method as an Event.CHANGE listener.
LocalizationStageProcessor
  
Removes the reassignResourceStrings method as an Event.CHANGE listener.
LocalizationStageProcessor
  
LocalizationStageProcessor
  
Handles the Event.CHANGE on the resourceManager, when invoked it re-assigns all the resource values to each stage component that has been processed.
LocalizationStageProcessor
Property Detail
bundleNameproperty
bundleName:String

The name of the resource bundle that contains all te resource values.


Implementation
    public function get bundleName():String
    public function set bundleName(value:String):void
componentCacheproperty 
protected var componentCache:Dictionary

A Dictionary instance used to keep track of the stage components that have already been processed by the current LocalizationStageProcessor. This Dictionary instance is created with the weakKeys constructor argument set to true and will therefore not cause any memory leaks should any of the components be removed from the stage permanently.

propertyNameproperty 
propertyName:String


Implementation
    public function get propertyName():String
    public function set propertyName(value:String):void
resourceManagerproperty 
resourceManager:IResourceManager

The IResourceManager instance used to retrieve resource values from.


Implementation
    public function get resourceManager():IResourceManager
    public function set resourceManager(value:IResourceManager):void
resourceSuffixesproperty 
resourceSuffixes:Vector.<String>

An Vector.<String> of suffixes that correspond to property names on the stage component.

For example, a button with id 'myButton': <Button id="myButton"/> Can have its label property assigned automatically if a resourceName exists with this name: myButton_label=Click this button

The default value is ['text','label','toolTip','prompt','dataProvider','title','headerText'].


Implementation
    public function get resourceSuffixes():Vector.<String>
    public function set resourceSuffixes(value:Vector.<String>):void
Constructor Detail
LocalizationStageProcessor()Constructor
public function LocalizationStageProcessor()

Creates a new LocalizationStageProcessor instance.

Method Detail
assignResourceString()method
protected function assignResourceString(object:Object, propertyName:String, resourceSuffix:String):void

Combines the propertyName and resourceSuffix into a resource name with the form propertyName + _ + resourceSuffix.

If the specified object has a property with the name specified by the resourceSuffix value, if a necessary resource value exists it is assigned to the property

Parameters

object:Object — The stage component that will be processed
 
propertyName:String — The property name of the specified stage component whose value will be used as a base name for the resource values.
 
resourceSuffix:String — The suffix that together with the property name value forms the resourcename

assignResourceStrings()method 
protected function assignResourceStrings(object:Object, propertyName:String):void

Parameters

object:Object — The stage component that will be processed
 
propertyName:String — The property name of the specified stage component whose value will be used as a base name for the resource values.

connectListeners()method 
protected function connectListeners():void

Adds the reassignResourceStrings method as an Event.CHANGE listener.

disconnectListeners()method 
protected function disconnectListeners():void

Removes the reassignResourceStrings method as an Event.CHANGE listener.

dispose()method 
override public function dispose():void

initLocalizationStageProcessor()method 
protected function initLocalizationStageProcessor():void

process()method 
override public function process(object:DisplayObject):DisplayObject

Parameters

object:DisplayObject

Returns
DisplayObject
resourceManagerChange_handler()method 
protected function resourceManagerChange_handler(event:Event):void

Handles the Event.CHANGE on the resourceManager, when invoked it re-assigns all the resource values to each stage component that has been processed.

Parameters

event:Event — An Event.ADDED event