Packageorg.spicefactory.parsley.core.command.impl
Classpublic class DefaultCommandManager
InheritanceDefaultCommandManager Inheritance Object
Implements CommandManager

Default implementation of the CommandManager interface.



Public Methods
 MethodDefined By
  
Adds an active command to be managed by this instance.
DefaultCommandManager
  
getActiveCommandsByTrigger(messageType:Class, selector:*):Array
Returns all active commands triggered by a message that matches the specified type and selector in this scope.
DefaultCommandManager
  
getActiveCommandsByType(commandType:Class, id:String = null):Array
Returns all active commands of the specified type.
DefaultCommandManager
  
hasActiveCommandsForTrigger(messageType:Class, selector:*):Boolean
Indicates whether this scope has any active commands triggered by a message that matches the specified type and selector.
DefaultCommandManager
  
hasActiveCommandsOfType(commandType:Class, id:String = null):Boolean
Indicates whether this scope has any active commands that matches the specified command type and id.
DefaultCommandManager
Method Detail
addActiveCommand()method
public function addActiveCommand(command:ObservableCommand):void

Adds an active command to be managed by this instance.

Parameters

command:ObservableCommand — the active command to add

getActiveCommandsByTrigger()method 
public function getActiveCommandsByTrigger(messageType:Class, selector:*):Array

Returns all active commands triggered by a message that matches the specified type and selector in this scope.

Parameters

messageType:Class — the type of the message that triggered the commands
 
selector:* (default = NaN) — the selector of the message that triggered the commands

Returns
Array — all matching ObservableCommand instances.
getActiveCommandsByType()method 
public function getActiveCommandsByType(commandType:Class, id:String = null):Array

Returns all active commands of the specified type. If an id is specified it refers to the id the command is registered with in the Context.

Parameters

commandType:Class — the type of the command
 
id:String (default = null) — the id the command is registered with in the Context

Returns
Array — all matching ObservableCommand instances
hasActiveCommandsForTrigger()method 
public function hasActiveCommandsForTrigger(messageType:Class, selector:*):Boolean

Indicates whether this scope has any active commands triggered by a message that matches the specified type and selector.

Parameters

messageType:Class — the type of the message that triggered the commands
 
selector:* (default = NaN) — the selector of the message that triggered the commands

Returns
Boolean — true if there is at least one matching command in this scope.
hasActiveCommandsOfType()method 
public function hasActiveCommandsOfType(commandType:Class, id:String = null):Boolean

Indicates whether this scope has any active commands that matches the specified command type and id.

Parameters

commandType:Class — the type of the command
 
id:String (default = null) — the id the command is registered with in the Context

Returns
Boolean — true if there is at least one matching command in this scope.