Packageweavejs.api.core
Interfacepublic interface IProgressIndicator extends ILinkableObject
Implementors ProgressIndicator

This is an interface for a central location to report progress of asynchronous requests. Since this interface extends ILinkableObject, getCallbackCollection() can be used on an IProgressIndicator. Callbacks should be triggered after any action that would change the result of getNormalizedProgress().



Public Methods
 MethodDefined By
  
addTask(taskToken:Object, busyObject:ILinkableObject = null, description:String = null):void
This function will register a background task.
IProgressIndicator
  
This function checks the overall progress of all pending requests.
IProgressIndicator
  
This is the number of active background tasks.
IProgressIndicator
  
hasTask(taskToken:Object):Boolean
This function will check if a background task is registered as an active task.
IProgressIndicator
  
removeTask(taskToken:Object):void
This function will remove a previously registered pending request token and decrease the pendingRequestCount if necessary.
IProgressIndicator
  
updateTask(taskToken:Object, progress:Number):void
This function will report the progress of a background task.
IProgressIndicator
Method Detail
addTask()method
public function addTask(taskToken:Object, busyObject:ILinkableObject = null, description:String = null):void

This function will register a background task.

Parameters

taskToken:Object — A token representing a background task. If this is an AsyncToken, a responder will be added that will automatically call removeTask(taskToken) on success or failure.
 
busyObject:ILinkableObject (default = null) — An object that is responsible for the task. If specified, will call WeaveAPI.SessionManager.assignBusyTask().
 
description:String (default = null) — A description of the task.

See also

weave.api.core.ISessionManager.assignBusyTask()
getNormalizedProgress()method 
public function getNormalizedProgress():Number

This function checks the overall progress of all pending requests.

Returns
Number — A Number between 0 and 1.
getTaskCount()method 
public function getTaskCount():int

This is the number of active background tasks.

Returns
int
hasTask()method 
public function hasTask(taskToken:Object):Boolean

This function will check if a background task is registered as an active task.

Parameters

taskToken:Object — A token representing a background task.

Returns
Boolean — A value of true if the task was previously added and not yet removed.
removeTask()method 
public function removeTask(taskToken:Object):void

This function will remove a previously registered pending request token and decrease the pendingRequestCount if necessary. Also calls WeaveAPI.SessionManager.unassignBusyTask().

Parameters

taskToken:Object — The object to remove from the progress indicator.

See also

weave.api.core.ISessionManager.unassignBusyTask()
updateTask()method 
public function updateTask(taskToken:Object, progress:Number):void

This function will report the progress of a background task.

Parameters

taskToken:Object — An object representing a task.
 
progress:Number — A number between 0 and 1 indicating the current progress of the task.