Packageorg.springextensions.actionscript.core.command
SVN browsingCompositeCommand.as
FisheyeCompositeCommand.as
Classpublic class CompositeCommand
InheritanceCompositeCommand Inheritance AbstractProgressOperation Inheritance AbstractOperation Inheritance flash.events.EventDispatcher
ImplementsICompositeCommand
SubclassesTaskCommand

Basic implementation of the 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


Public Properties
 PropertyDefined by
  commands : Array
[read-only]
CompositeCommand
  currentCommand : ICommand
[read-only] The ICommand that is currently being executed.
CompositeCommand
 Inheritederror : *
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
 Inheritedprogress : uint
The progress of this operation.
AbstractProgressOperation
 Inheritedresult : *
The result of this operation or null if the operation does not have a result.
AbstractOperation
 Inheritedtimeout : int
The timeout in milliseconds.
AbstractOperation
 Inheritedtotal : uint
The total amount of progress this operation should make before being done.
AbstractProgressOperation
Public Methods
 MethodDefined by
  
Creates a new CompositeCommand instance.
CompositeCommand
  
Adds an ICommand to the current ICompositeCommand.
CompositeCommand
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
dispatchCompleteEvent(result:* = null):Boolean
Convenience method for dispatching a OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
dispatchErrorEvent(error:* = null):Boolean
Convenience method for dispatching a OperationEvent.ERROR event.
AbstractOperation
 Inherited
Convenience method for dispatching a OperationEvent.TIMEOUT event.
AbstractOperation
  
execute():*
Executes the command.
CompositeCommand
 Inherited
removeCompleteListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
removeErrorListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.ERROR event.
AbstractOperation
 Inherited
removeProgressListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.PROGRESS event.
AbstractProgressOperation
 Inherited
removeTimeoutListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.TIMEOUT event.
AbstractOperation
Protected Methods
 MethodDefined by
  
addCommandListeners(asyncCommand:IOperation):void
Adds the onCommandResult and onCommandFault event handlers to the specified IAsyncCommand instance.
CompositeCommand
  
CompositeCommand
  
CompositeCommand
 Inherited
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
  
CompositeCommand
  
Retrieves and removes the next ICommand from the internal list and passes it to the executeCommand() method.
CompositeCommand
  
CompositeCommand
  
CompositeCommand
  
removeCommand(asyncCommand:IOperation):void
CompositeCommand
  
Removes the onCommandResult and onCommandFault event handlers from the specified IAsyncCommand instance.
CompositeCommand
  
setCommands(value:Array):void
CompositeCommand
 Inherited
startTimeout():void
AbstractOperation
Events
 EventSummaryDefined by
 Inherited Dispatched when the current AbstractOperation has new progress information to report.AbstractProgressOperation
 Inherited Dispatched when the current AbstractOperation has completed its functionality successfully.AbstractOperation
 Inherited Dispatched when the current AbstractOperation encountered an error.AbstractOperation
 Inherited Dispatched when the current AbstractOperation timed out.AbstractOperation
Property detail
commandsproperty
commands:Array  [read-only]Implementation
    public function get commands():Array
currentCommandproperty 
currentCommand:ICommand  [read-only]

The ICommand that is currently being executed.

Implementation
    public function get currentCommand():ICommand
failOnFaultproperty 
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

kindproperty 
kind:CompositeCommandKind  [read-write]Implementation
    public function get kind():CompositeCommandKind
    public function set kind(value:CompositeCommandKind):void
numCommandsproperty 
numCommands:uint  [read-only]

The number of pending commands.

Implementation
    public function get numCommands():uint
Constructor detail
CompositeCommand()constructor
public function CompositeCommand(kind:CompositeCommandKind = null)

Creates a new CompositeCommand instance.

Parameters
kind:CompositeCommandKind (default = null)
Method detail
addCommand()method
public function addCommand(command:ICommand):ICompositeCommand

Adds an ICommand to the current ICompositeCommand.

Parameters
command:ICommand

Returns
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.

Parameters
asyncCommand:IOperation
addOperation()method 
public function addOperation(operationClass:Class, ... constructorArgs):ICompositeCommandParameters
operationClass:Class
 
... constructorArgs

Returns
ICompositeCommand
dispatchAfterCommandEvent()method 
protected function dispatchAfterCommandEvent(command:ICommand):voidParameters
command:ICommand
dispatchBeforeCommandEvent()method 
protected function dispatchBeforeCommandEvent(command:ICommand):voidParameters
command:ICommand
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.

Parameters
command:ICommand

See also

CompositeCommandEvent
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 
protected function onCommandFault(event:OperationEvent):voidParameters
event:OperationEvent
onCommandResult()method 
protected function onCommandResult(event:OperationEvent):voidParameters
event:OperationEvent
removeCommand()method 
protected function removeCommand(asyncCommand:IOperation):voidParameters
asyncCommand:IOperation
removeCommandListeners()method 
protected function removeCommandListeners(asyncCommand:IOperation):void

Removes the onCommandResult and onCommandFault event handlers from the specified IAsyncCommand instance.

Parameters
asyncCommand:IOperation
setCommands()method 
protected function setCommands(value:Array):voidParameters
value:Array