Packageorg.springextensions.actionscript.localization
SVN browsingLocalizationStageProcessor.as
FisheyeLocalizationStageProcessor.as
Classpublic class LocalizationStageProcessor
InheritanceLocalizationStageProcessor Inheritance AbstractStageProcessor

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

See also

PropertyValueBasedObjectSelector


Documentation reference: the localizationstageprocessor class

Sample project: localization (source)

External reference: http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Runtime_Localization


Public Properties
 PropertyDefined by
  bundleName : String
The name of the resource bundle that contains all te resource values.
LocalizationStageProcessor
 Inheriteddocument : Object
The MXML document associated with the current IStageProcessor.
AbstractStageProcessor
 InheritedisDisposed : Boolean
AbstractStageProcessor
 InheritedobjectSelector : IObjectSelector
The specified IObjectSelector instance.
AbstractStageProcessor
  resourceManager : IResourceManager
The IResourceManager instance used to retrieve resource values from.
LocalizationStageProcessor
  resourceSuffixes : Array

An Array 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
LocalizationStageProcessor
  
process(object:Object):Object
LocalizationStageProcessor
Protected Methods
 MethodDefined by
 Inherited
AbstractStageProcessor
  
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
  
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  [read-write]

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.

resourceManagerproperty 
resourceManager:IResourceManager  [read-write]

The IResourceManager instance used to retrieve resource values from.

Implementation
    public function get resourceManager():IResourceManager
    public function set resourceManager(value:IResourceManager):void
resourceSuffixesproperty 
resourceSuffixes:Array  [read-write]

An Array 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():Array
    public function set resourceSuffixes(value:Array):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 
public override function dispose():void
process()method 
public override function process(object:Object):ObjectParameters
object:Object

Returns
Object
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