Class fever.app.theme.ThemeLocator

Description

Locator and manager for Application look and Feel.

Broadcasts onChangeEVENT event type when theme change.

Example using AsWing Look'n Feel.

   var at : ThemeLocator = ThemeLocator.getInstance();
   at.register( "Office 2003", new Office2003LAF() );
   at.register( "WinXP 2003", new WinXPLAF() );
   at.addEventListener( ThemeLocator.onChangeEVENT, this, _onUIUpdate );
   at.load( "WinXP 2003" );
 

Look and Feel is really apply using custom process.
Associates Command to fever.events.FeverEventList.onApplyLookAndFeelEVENT event type.
A concrete command example is available in FvApplyLookAndFeel

See Also

Field Index

CONFIG_ID, onChangeEVENT

Method Index

addEventListener(), clearListener(), getCurrentTheme(), getInstance(), getTheme(), getThemeList(), isRegistred(), load(), register(), registerTheme(), removeEventListener(), toString(), unregister()

Field Detail

onChangeEVENT

static public onChangeEVENT:EventType
Event type broadcasted when theme change.

CONFIG_ID

static public CONFIG_ID:String [Read Only]
Property name identifier for sharedObject saving.

Method Detail

getInstance

static public function getInstance():ThemeLocator

Returns unique FvThemeLocator instance.

register

public function register(lafName:String, lafInstance:Object, previewLink:String):Boolean

Registers a new available {code lafInstance} LookAndFeel instance with passed-in lafName id.

Return

registred Look'n Feel

Throws

IllegalArgumentExceptionif lafName or lafInstance are undefined or null

registerTheme

public function registerTheme(theme:Theme):Boolean

Registers passed-in Theme theme.

isRegistred

public function isRegistred(lafName:String):Boolean

Returns true if a theme is registred with passed-in lafName ID.

unregister

public function unregister(lafName:String):Boolean

Unregisters passed-in lafName Look And Feel from theme map.

load

public function load(lafName:String):Boolean

Applies passed-in lafName Look'n Feel.

LAF must be registred before with register() method.

If a theme configuration is saved, loads saved theme.

Look and Feel is really apply using custom process.
Associated Command to fever.events.FeverEventList.onApplyLookAndFeelEVENT event type
A concrete command example is available in FvApplyLookAndFeel

Return

true if LAF is correctly applied.

getThemeList

public function getThemeList():Array

Returns registred theme names list.

getTheme

public function getTheme(lafName:String):Theme

Returns Look'n Feel regitred with passed lafName id.

getCurrentTheme

public function getCurrentTheme():Theme

Returns current application theme.

If laf is registred in map, returns Theme instance.

addEventListener

public function addEventListener(type:EventType, listener):Void

Adds passed-in listener for receiving passed-in type event type.

removeEventListener

public function removeEventListener(type:EventType, listener):Void

Removes passed-in listener that suscribed for passed-in type event.

clearListener

public function clearListener():Void

Removes all theme listeners.

toString

public function toString():String

Returns string representation.