Package | org.spicefactory.parsley.core.view |
Interface | public interface ViewLifecycle extends flash.events.IEventDispatcher |
Implementors | AutoremoveLifecycle, CustomEventLifecycle |
init
and destroy
methods of the associated ViewProcessor
based on the lifecycle of the view.
Parsley comes with two default implementations. One controls the lifecycle
of the view based on stage events (addedToStage
and removedFromStage
)
the other based on custom events (configureView
and removeView
)
dispatched by the view instance. The autoremoveComponents
and autoremoveViewRoots
attributes of the <ViewSettings>
tag (or the ViewSettings
class in the
ContextBuilder API) control which of the two built-in lifecycles will be used.
A custom lifecycle can be specified with the <ViewLifecycle>
tag inside
the <ContextBuilder>
tag.
Method | Defined By | ||
---|---|---|---|
Starts controlling the lifecycle of the view instance contained in the specified
configuration instance. | ViewLifecycle | ||
stop():void
Stops controlling the lifecycle of the view instance. | ViewLifecycle |
start | () | method |
public function start(config:ViewConfiguration, context:Context):void
Starts controlling the lifecycle of the view instance contained in the specified
configuration instance. The primary purpose of this lifecycle instance is to invoke the init
and destroy
methods of the associated ViewProcessor
based on the lifecycle of the view.
Parameters
config:ViewConfiguration — the view configuration that holds the view this lifecycle instance should control
| |
context:Context — the Context associated with this view
|
stop | () | method |
public function stop():void
Stops controlling the lifecycle of the view instance.
After this method has been called this lifecycle instance should no longer
invoke the init
and destroy
methods of the associated
ViewProcessor
and free all resources it is holding.