The CommandManager is the central control for navigator commands that directly
affect the attachments in the Portfolio, such as previewing, editing, and extracting
attachments. It has a cache to keep track of what command need to run and what commands
could not be executed because they require a request from the host.
A CommandManager static instance that can be shared by Flex components.
Implementation public static function get instance():CommandManager
pendingCommandMap
property
protected var pendingCommandMap:Object
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
An internal map to track commands which could not be executed because they required
a request from the host.
Constructor Detail
CommandManager
()
Constructor
public function CommandManager(target:IEventDispatcher = null)
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Constructor
Parameters
target:IEventDispatcher (default = null)
Method Detail
addPendingCommand
()
method
protected function addPendingCommand(commandType:String, operand:*, arguments:*):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Adds a command to pendingCommandMap, along with its operand and arguments.
The pendingCommandMap tracks commands which could not be executed because
they required a request from the host.
Parameters
commandType:String
operand:*
arguments:*
deleteAttachment
()
method
public function deleteAttachment(attachment:IAttachment):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Determines and then executes the appropriate command for deleting the given attachment.
Determines and then executes the appropriate command for deleting the set of selected attachments.
editAttachment
()
method
public function editAttachment(attachment:IAttachment, previewAppropriateTypes:Boolean = true):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Determines and then executes the appropriate command for editing the indicated attachment
in its native application. If previewAppropriateTypes is true then it checks to see
if the attachment is an HTML file or SWF file, in which case it will use the preview command
instead.
protected function invokeCommand(commandType:String, operand:* = null, arguments:Array = null):Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Executes the ICommand of type commandType from the commandCache,
or requests the ICommand if it is not current present in commandCache.
Returns true if the command was succesfully executed or requested;
returns false if the command is not enabled.
Parameters
commandType:String
operand:* (default = null)
arguments:Array (default = null)
Returns
Boolean
onCommandsChanged
()
method
protected function onCommandsChanged(event:Event):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Listens for command changes from the host, and executes any pending commands that
have become available.