| Package | org.springextensions.actionscript.core.command |
| SVN browsing | CompositeCommand.as |
| Fisheye | CompositeCommand.as |
| Class | public class CompositeCommand |
| Inheritance | CompositeCommand AbstractProgressOperation AbstractOperation flash.events.EventDispatcher |
| Implements | ICompositeCommand |
| Subclasses | TaskCommand |
ICompositeCommand that executes a list of ICommand instances
that were added through the addCommand() method. The commands are executed in the order in which
they were added.
Documentation reference: composite commands
| Property | Defined by | ||
|---|---|---|---|
| commands : Array [read-only]
| CompositeCommand | ||
| currentCommand : ICommand
[read-only]
The
ICommand that is currently being executed. | CompositeCommand | ||
![]() | error : *
The error of this operation or
null if no error occurred during this operation. | AbstractOperation | |
| failOnFault : Boolean = false
Determines if the execution of all the
ICommands should be aborted if an
IAsyncCommand instance dispatches an AsyncCommandFaultEvent event. | CompositeCommand | ||
| kind : CompositeCommandKind | CompositeCommand | ||
| numCommands : uint [read-only]
The number of pending commands.
| CompositeCommand | ||
![]() | progress : uint
The progress of this operation.
| AbstractProgressOperation | |
![]() | result : *
The result of this operation or
null if the operation does not have a result. | AbstractOperation | |
![]() | timeout : int
The timeout in milliseconds.
| AbstractOperation | |
![]() | total : uint
The total amount of progress this operation should make before being done.
| AbstractProgressOperation | |
| Method | Defined by | ||
|---|---|---|---|
|
CompositeCommand(kind:CompositeCommandKind = null)
Creates a new
CompositeCommand instance. | CompositeCommand | ||
|
Adds an
ICommand to the current ICompositeCommand. | CompositeCommand | ||
![]() |
addCompleteListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.COMPLETE event.
| AbstractOperation | |
![]() |
addErrorListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.ERROR event.
| AbstractOperation | |
|
addOperation(operationClass:Class, ... constructorArgs):ICompositeCommand
| CompositeCommand | ||
![]() |
addProgressListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.PROGRESS event.
| AbstractProgressOperation | |
![]() |
addTimeoutListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.TIMEOUT event.
| AbstractOperation | |
![]() |
dispatchCompleteEvent(result:* = null):Boolean
Convenience method for dispatching a
OperationEvent.COMPLETE event. | AbstractOperation | |
![]() |
dispatchErrorEvent(error:* = null):Boolean
Convenience method for dispatching a
OperationEvent.ERROR event. | AbstractOperation | |
![]() |
dispatchTimeoutEvent():Boolean
Convenience method for dispatching a
OperationEvent.TIMEOUT event. | AbstractOperation | |
|
execute():*
Executes the command.
| CompositeCommand | ||
![]() |
removeCompleteListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.COMPLETE event.
| AbstractOperation | |
![]() |
removeErrorListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.ERROR event.
| AbstractOperation | |
![]() |
removeProgressListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.PROGRESS event.
| AbstractProgressOperation | |
![]() |
removeTimeoutListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.TIMEOUT event.
| AbstractOperation | |
| Method | Defined by | ||
|---|---|---|---|
|
addCommandListeners(asyncCommand:IOperation):void
Adds the
onCommandResult and onCommandFault event handlers to the specified IAsyncCommand instance. | CompositeCommand | ||
|
dispatchAfterCommandEvent(command:ICommand):void
| CompositeCommand | ||
|
dispatchBeforeCommandEvent(command:ICommand):void
| CompositeCommand | ||
![]() |
dispatchProgressEvent():void
Convenience method for dispatching a
OperationEvent.PROGRESS event. | AbstractProgressOperation | |
|
executeCommand(command:ICommand):void
If the specified
ICommand implements the IAsyncCommand interface the onCommandResult
and onCommandFault event handlers are added. | CompositeCommand | ||
|
executeCommandsInParallel():void
| CompositeCommand | ||
|
executeNextCommand():void
Retrieves and removes the next
ICommand from the internal list and passes it to the
executeCommand() method. | CompositeCommand | ||
|
onCommandFault(event:OperationEvent):void
| CompositeCommand | ||
|
onCommandResult(event:OperationEvent):void
| CompositeCommand | ||
|
removeCommand(asyncCommand:IOperation):void
| CompositeCommand | ||
|
removeCommandListeners(asyncCommand:IOperation):void
Removes the
onCommandResult and onCommandFault event handlers from the specified IAsyncCommand instance. | CompositeCommand | ||
|
setCommands(value:Array):void
| CompositeCommand | ||
![]() |
startTimeout():void
| AbstractOperation | |
| commands | property |
commands:Array [read-only]Implementation
public function get commands():Array
| currentCommand | property |
currentCommand:ICommand [read-only]
The ICommand that is currently being executed.
public function get currentCommand():ICommand
| failOnFault | property |
public var failOnFault:Boolean = false
Determines if the execution of all the ICommands should be aborted if an
IAsyncCommand instance dispatches an AsyncCommandFaultEvent event.
The default value is false.
See also
| kind | property |
kind:CompositeCommandKind [read-write]Implementation
public function get kind():CompositeCommandKind
public function set kind(value:CompositeCommandKind):void
| numCommands | property |
numCommands:uint [read-only]The number of pending commands.
Implementation public function get numCommands():uint
| CompositeCommand | () | constructor |
public function CompositeCommand(kind:CompositeCommandKind = null)
Creates a new CompositeCommand instance.
kind:CompositeCommandKind (default = null) |
| addCommand | () | method |
public function addCommand(command:ICommand):ICompositeCommand
Adds an ICommand to the current ICompositeCommand.
command:ICommand |
ICompositeCommand —
The current ICompositeCommand, this way calls to addCommand() can be chained.
|
| addCommandListeners | () | method |
protected function addCommandListeners(asyncCommand:IOperation):void
Adds the onCommandResult and onCommandFault event handlers to the specified IAsyncCommand instance.
asyncCommand:IOperation |
| addOperation | () | method |
public function addOperation(operationClass:Class, ... constructorArgs):ICompositeCommandParameters
operationClass:Class |
|
... constructorArgs |
ICompositeCommand |
| dispatchAfterCommandEvent | () | method |
| dispatchBeforeCommandEvent | () | method |
| execute | () | method |
public function execute():*Executes the command.
Returns* |
| executeCommand | () | method |
protected function executeCommand(command:ICommand):void
If the specified ICommand implements the IAsyncCommand interface the onCommandResult
and onCommandFault event handlers are added. Before the ICommand.execute() method is invoked
the CompositeCommandEvent.EXECUTE_COMMAND event is dispatched.
When the command argument is null the CompositeCommandEvent.COMPLETE event is dispatched instead.
command:ICommand |
See also
| executeCommandsInParallel | () | method |
protected function executeCommandsInParallel():void
| executeNextCommand | () | method |
protected function executeNextCommand():void
Retrieves and removes the next ICommand from the internal list and passes it to the
executeCommand() method.
| onCommandFault | () | method |
| onCommandResult | () | method |
| removeCommand | () | method |
| removeCommandListeners | () | method |
protected function removeCommandListeners(asyncCommand:IOperation):void
Removes the onCommandResult and onCommandFault event handlers from the specified IAsyncCommand instance.
asyncCommand:IOperation |
| setCommands | () | method |
protected function setCommands(value:Array):voidParameters
value:Array |