Packageorg.spicefactory.parsley.view
Classpublic class Configure
InheritanceConfigure Inheritance Object

Provides a fluent API for configuring a target in a view. This API can be used in ActionScript components (Flex or Flash) as an alternative to the <Configure> MXML tag for MXML components.



Public Methods
 MethodDefined By
  
autoremove(value:Boolean):Configure
Indicates whether the target should be removed when the view is removed from the stage.
Configure
  
complete(callback:Function):Configure
A callback to invoke when the processing of the view configuration has been completed.
Configure
  
configId(configId:String):Configure
The configuration id to use to look up an object definition matching this target instance.
Configure
  
The object definition to use to configure the target.
Configure
  
execute():void
Executes this view configuration at the nearest Context in the view hierarchy.
Configure
  
The instance that controls the lifecycle of the view.
Configure
  
The processor to use for the target instance.
Configure
  
reuse(value:Boolean):Configure
Indicates whether the target instance will be reused in subsequent lifecycles of the view.
Configure
  
target(target:Object):Configure
The target to get processed by the nearest Context in the view hierarchy.
Configure
  
view(view:DisplayObject):Configure
[static] The view that demarcates the lifecycle of the target instance to be configured.
Configure
Method Detail
autoremove()method
public function autoremove(value:Boolean):Configure

Indicates whether the target should be removed when the view is removed from the stage. Only has an effect when no custom ViewLifecycle has been set.

Parameters

value:Boolean — Indicates whether the target should be removed when the view is removed from the stage

Returns
Configure — this Configure instance for method chaining
complete()method 
public function complete(callback:Function):Configure

A callback to invoke when the processing of the view configuration has been completed.

Parameters

callback:Function — a callback to invoke when the processing of the view configuration has been completed

Returns
Configure — this Configure instance for method chaining
configId()method 
public function configId(configId:String):Configure

The configuration id to use to look up an object definition matching this target instance. If a definition has already been set for this configuration instance, this value will be ignored.

Parameters

configId:String — the configuration id to use to look up an object definition matching this target instance

Returns
Configure — this Configure instance for method chaining
definition()method 
public function definition(definition:DynamicObjectDefinition):Configure

The object definition to use to configure the target. This property is optional. Some ViewProcessors may look for an object definition in the Context that matches the target instance getting processed when this value is null.

Parameters

definition:DynamicObjectDefinition — the object definition to use to configure the target

Returns
Configure — this Configure instance for method chaining
execute()method 
public function execute():void

Executes this view configuration at the nearest Context in the view hierarchy.

lifecycle()method 
public function lifecycle(lifecycle:ViewLifecycle):Configure

The instance that controls the lifecycle of the view. This property may be null, in this case the default lifecycle installed in the Context for the type of view of this configuration will be used.

Parameters

lifecycle:ViewLifecycle — the instance that controls the lifecycle of the view

Returns
Configure — this Configure instance for method chaining
processor()method 
public function processor(processor:ViewProcessor):Configure

The processor to use for the target instance. This property may be null, in this case the default processor installed in the Context will be used.

Parameters

processor:ViewProcessor — the processor to use for the target instance

Returns
Configure — this Configure instance for method chaining
reuse()method 
public function reuse(value:Boolean):Configure

Indicates whether the target instance will be reused in subsequent lifecycles of the view. When set to false the configuration will only be processed once. This value should be true if the application keeps instances of the view in memory and adds them back to the stage later. It should be false if the view will get garbage collected once it has been removed from the stage.

Parameters

value:Boolean — indicates whether the target instance will be reused in subsequent lifecycles of the view

Returns
Configure — this Configure instance for method chaining
target()method 
public function target(target:Object):Configure

The target to get processed by the nearest Context in the view hierarchy.

Parameters

target:Object — the target to get processed by the nearest Context in the view hierarchy

Returns
Configure — this Configure instance for method chaining
view()method 
public static function view(view:DisplayObject):Configure

The view that demarcates the lifecycle of the target instance to be configured. The view may be the same instance as the target itself or a different one that just controls the lifecycle. A typical example for the two properties pointing to different instances would be the target being a presentation model that should get added to the Context for the time the view it belongs to is on the stage.

Parameters

view:DisplayObject — the view that demarcates the lifecycle of the target instance

Returns
Configure — a new Configure instance for further setup options