Package | org.restfulx.controllers |
Class | public class CommandsController |
Method | Defined by | ||
---|---|---|---|
CommandsController(commands:Array)
Creates a new instance of the controller.
| CommandsController | ||
addCommand(cmd:Class, useWeakReference:Boolean = true):void
Adds a given command class to the controller registry.
| CommandsController | ||
addCommandByName(cmdName:String, cmd:Class, useWeakReference:Boolean = true):void
Adds a given command using provided name (as opposed to inferred name) to the controller
registry.
| CommandsController | ||
execute(cmd:Object, data:Object = null, targetServiceId:int = -1):void
Executes a given command passing data and target service id for reference.
| CommandsController | ||
removeCommand(cmd:Class):void
Removes a given command from the registry.
| CommandsController | ||
removeCommandByName(cmdName:String):void
Removes a given command from the registry using the name provided.
| CommandsController |
CommandsController | () | constructor |
public function CommandsController(commands:Array)
Creates a new instance of the controller.
Parameterscommands:Array — the array of command classes to register e.g. [Command1, Command2]
|
addCommand | () | method |
public function addCommand(cmd:Class, useWeakReference:Boolean = true):void
Adds a given command class to the controller registry.
Parameterscmd:Class — command class
|
|
useWeakReference:Boolean (default = true ) — will be registered for events using a weak reference
|
addCommandByName | () | method |
public function addCommandByName(cmdName:String, cmd:Class, useWeakReference:Boolean = true):void
Adds a given command using provided name (as opposed to inferred name) to the controller registry.
ParameterscmdName:String — command name to use
|
|
cmd:Class — Command class that will be invoked
|
|
useWeakReference:Boolean (default = true ) — will be registered for events using a weak referece
|
execute | () | method |
public function execute(cmd:Object, data:Object = null, targetServiceId:int = -1):void
Executes a given command passing data and target service id for reference.
Parameterscmd:Object — command to execute. This can be either a String or a Class.
|
|
data:Object (default = null ) — arbitrary data to pass to the command
|
|
targetServiceId:int (default = -1 ) — indicates which service the command should use (if any)
|
removeCommand | () | method |
public function removeCommand(cmd:Class):void
Removes a given command from the registry.
Parameterscmd:Class — command class to remove
|
See also
removeCommandByName | () | method |
public function removeCommandByName(cmdName:String):void
Removes a given command from the registry using the name provided.
ParameterscmdName:String — command class to remove
|
See also