Packageweavejs.core
Classpublic class SessionStateLog
InheritanceSessionStateLog Inheritance Object
Implements ILinkableVariable, IDisposableObject

This class saves the session history of an ILinkableObject.



Public Properties
 PropertyDefined By
  debug : Boolean = false
[static]
SessionStateLog
  enableHistoryRewrite : Boolean = true
[static]
SessionStateLog
  redoHistory : Array
[read-only]
SessionStateLog
  undoHistory : Array
[read-only]
SessionStateLog
Public Methods
 MethodDefined By
  
SessionStateLog(subject:ILinkableObject, syncDelay:uint = 0)
SessionStateLog
  
clearHistory(directional:int = 0):void
This will clear all undo and redo history.
SessionStateLog
  
dispose():void
SessionStateLog
  
This will generate an untyped session state object that contains the session history log.
SessionStateLog
  
redo(numberOfSteps:int = 1):void
This will redo a number of steps that have been previously undone.
SessionStateLog
  
setSessionState(state:Object):void
This will load a session state log from an untyped session state object.
SessionStateLog
  
squashHistory(directionalSquashCount:int):void
This will squash a sequence of undos or redos into a single undo or redo.
SessionStateLog
  
This function will save any pending diff in session state.
SessionStateLog
  
undo(numberOfSteps:int = 1):void
This will undo a number of steps from the saved history.
SessionStateLog
Public Constants
 ConstantDefined By
  enableLogging : LinkableBoolean
When this is set to true, changes in the session state of the subject will be automatically logged.
SessionStateLog
Property Detail
debugproperty
public static var debug:Boolean = false

enableHistoryRewriteproperty 
public static var enableHistoryRewrite:Boolean = true

redoHistoryproperty 
redoHistory:Array  [read-only]


Implementation
    public function get redoHistory():Array
undoHistoryproperty 
undoHistory:Array  [read-only]


Implementation
    public function get undoHistory():Array
Constructor Detail
SessionStateLog()Constructor
public function SessionStateLog(subject:ILinkableObject, syncDelay:uint = 0)



Parameters
subject:ILinkableObject
 
syncDelay:uint (default = 0)
Method Detail
clearHistory()method
public function clearHistory(directional:int = 0):void

This will clear all undo and redo history.

Parameters

directional:int (default = 0) — Zero will clear everything. Set this to -1 to clear all undos or 1 to clear all redos.

dispose()method 
public function dispose():void

getSessionState()method 
public function getSessionState():Object

This will generate an untyped session state object that contains the session history log.

Returns
Object — An object containing the session history log.
redo()method 
public function redo(numberOfSteps:int = 1):void

This will redo a number of steps that have been previously undone.

Parameters

numberOfSteps:int (default = 1) — The number of steps to redo.

setSessionState()method 
public function setSessionState(state:Object):void

This will load a session state log from an untyped session state object.

Parameters

state:Object — The ByteArray containing the output from seralize().

squashHistory()method 
public function squashHistory(directionalSquashCount:int):void

This will squash a sequence of undos or redos into a single undo or redo.

Parameters

directionalSquashCount:int — Number of undos (negative) or redos (positive) to squash.

synchronizeNow()method 
public function synchronizeNow():void

This function will save any pending diff in session state. Use this function only when necessary (for example, when writing a collaboration service that must synchronize).

undo()method 
public function undo(numberOfSteps:int = 1):void

This will undo a number of steps from the saved history.

Parameters

numberOfSteps:int (default = 1) — The number of steps to undo.

Constant Detail
enableLoggingConstant
public const enableLogging:LinkableBoolean

When this is set to true, changes in the session state of the subject will be automatically logged.