context-dashboard/memento/dashboard-edit-mode.service.ts
Facade for implementation of Memento design pattern (caretaker, originator). Responsible for undo/redo feature during edit mode of dashboard.
Methods |
Accessors |
constructor(originator: DashboardOriginatorService, caretaker: DashboardCaretakerService)
|
|||||||||
Parameters :
|
getCurrentState |
getCurrentState()
|
Returns copy of current state.
Returns :
DashboardChildrenState
|
init | ||||||||
init(state: DashboardChildrenState)
|
||||||||
Initializes dashboard children state on edit mode start.
Parameters :
Returns :
void
|
newState | ||||||||
newState(state: DashboardChildrenState)
|
||||||||
Saves current state for further undo actions and sets new dashboard children state.
Parameters :
Returns :
void
|
redo |
redo()
|
Applies previously undone change.
Returns :
DashboardChildrenState
Current state of dashboard children after applying previously undone change. |
reset |
reset()
|
Resets dashboard children state to initial one and returns initial state.
Returns :
DashboardChildrenState
Initial state of dashboard children. |
undo |
undo()
|
Reverts last dashboard children change.
Returns :
DashboardChildrenState
Current state of dashboard children after reverting last change. |
undoButtonDisabled |
getundoButtonDisabled()
|
changeToUndoName |
getchangeToUndoName()
|
Current dashboard change name for undo button title.
Returns :
string
|
redoStackLastItem |
getredoStackLastItem()
|
Redo stack latest item for defining redo button disable state and its title.
Returns :
DashboardChildrenState
|