Packagefeathers.skins
Classpublic class StyleProviderRegistry
InheritanceStyleProviderRegistry Inheritance Object

Product Version : Feathers 2.0.0

Used by themes to create and manage style providers for component classes.



Public Methods
 MethodDefined By
  
StyleProviderRegistry(registerGlobally:Boolean = true, styleProviderFactory:Function = null)
Constructor.
StyleProviderRegistry
  
Removes the style provider for the specified component class.
StyleProviderRegistry
  
dispose():void
Disposes the theme.
StyleProviderRegistry
  
getRegisteredClasses(result:Vector.<Class> = null):Vector.<Class>
Returns all classes that have been registered with a style provider.
StyleProviderRegistry
  
Creates an IStyleProvider for the specified component class, or if it was already created, returns the existing registered style provider.
StyleProviderRegistry
  
hasStyleProvider(forClass:Class):Boolean
Determines if an IStyleProvider for the specified component class has been created.
StyleProviderRegistry
Constructor Detail
StyleProviderRegistry()Constructor
public function StyleProviderRegistry(registerGlobally:Boolean = true, styleProviderFactory:Function = null)

Constructor.

If style providers are to be registered globally, they will be passed to the static globalStyleProvider property of the specified class. If the class does not define a globalStyleProvider property, an error will be thrown.

The style provider factory function is expected to have the following signature:

function():IStyleProvider

Parameters
registerGlobally:Boolean (default = true) — Determines if the registry sets the static globalStyleProvider property.
 
styleProviderFactory:Function (default = null) — An optional function that creates a new style provider. If null, a StyleNameFunctionStyleProvider will be created.
Method Detail
clearStyleProvider()method
public function clearStyleProvider(forClass:Class):IStyleProvider

Removes the style provider for the specified component class. If the registry is global, and the static globalStyleProvider property contains the same value, it will be set to null. If it contains a different value, then it will be left unchanged to avoid conflicts with other registries or code.

Parameters

forClass:Class — The style provider is registered for this class.

Returns
IStyleProvider
dispose()method 
public function dispose():void

Disposes the theme.

getRegisteredClasses()method 
public function getRegisteredClasses(result:Vector.<Class> = null):Vector.<Class>

Returns all classes that have been registered with a style provider.

Parameters

result:Vector.<Class> (default = null)

Returns
Vector.<Class>
getStyleProvider()method 
public function getStyleProvider(forClass:Class):IStyleProvider

Creates an IStyleProvider for the specified component class, or if it was already created, returns the existing registered style provider. If the registry is global, a newly created style provider will be passed to the static globalStyleProvider property of the specified class.

Parameters

forClass:Class — The style provider is registered for this class.

Returns
IStyleProvider
hasStyleProvider()method 
public function hasStyleProvider(forClass:Class):Boolean

Determines if an IStyleProvider for the specified component class has been created.

Parameters

forClass:Class — The class that may have a style provider.

Returns
Boolean