| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
AbstractCommand provides a skeleton for commands which
might work within plugin's
FrontController. Abstract command
provides methods which allow the
FrontController to set
the command owner at the command creation. Additionally the
AbstractCommand class provides convenient method to access
all MVC components and logging tools of the plugin owner.
LowRA encourage the creation of stateless commands, it means
that commands must realize all their process entirely in
the execute call. The constructor of a stateless
command should always be empty.
See the How to use
the Command pattern implementation in LowRA document for more details
on the commands package structure.
protected var _owner:Plugin
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
A reference to the plugin owner of this command.
public function AbstractCommand()
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Empty constructor of a stateless command
public function execute(e:Event = null):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Override the execute virtual method
to create a concret command. Stateless command
may use the passed-in event as data source for
their operation.
Parameters
| e:Event (default = null) — event object that will be used as data source by the command
|
Throws
| — UnimplementedVirtualMethodException — Concret
command doesn't override the execute method
|
| |
| — UnreachableDataException — Stateless command
use the passed-in event as data source for its execution,
so the event must provide the right data for the current
Command object.
|
protected function firePrivateEvent(e:Event):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Fires a private event directly on this command's owner.
Parameters
public function getLogger():PluginDebug
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the exclusive logger object owned by the plugin.
It allow this command to send logging message directly on
its owner logging channel.
Returns
public function getModel(key:String):AbstractModel
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns a reference to the model AbstractModel.
It allow this command to locate any model registered to
owner's ModelLocator.
Parameters
Returns
| AbstractModel —
a reference to the model registered with key argument
|
public function getOwner():Plugin
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns a reference to the owner of this command.
Returns
| Plugin —
the plugin owner of this command
|
public function getView(key:String):AbstractView
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns a reference to the view AbstractView.
It allow this command to locate any view registered to
owner's ViewLocator.
Parameters
Returns
public function isModelRegistered(key:String):Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Check if a model AbstractModel is registered
with passed key in owner's ModelLocator.
Parameters
Returns
| Boolean — true if model a model AbstractModel is registered.
|
public function isViewRegistered(key:String):Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Check if a view AbstractView is registered
with passed key in owner's ViewLocator.
Parameters
Returns
| Boolean — true if model a view AbstractView is registered.
|
public function setOwner(owner:Plugin):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Defines the plugin owner of this command.
Generally the owner is defined by the
FrontController of a plugin when
it instantiate a command.
Parameters
| owner:Plugin — plugin which will own the command
|
public function toString():String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the string representation of this instance.
Returns
| String — the string representation of this instance
|
LowRA API documentation 2008- 2009
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1
mer. févr. 25 2009, 9:22 AM GMT+01:00