File

context-dashboard/memento/dashboard-edit-mode.service.ts

Description

Facade for implementation of Memento design pattern (caretaker, originator). Responsible for undo/redo feature during edit mode of dashboard.

Index

Methods
Accessors

Constructor

constructor(originator: DashboardOriginatorService, caretaker: DashboardCaretakerService)
Parameters :
Name Type Optional
originator DashboardOriginatorService No
caretaker DashboardCaretakerService No

Methods

getCurrentState
getCurrentState()

Returns copy of current state.

init
init(state: DashboardChildrenState)

Initializes dashboard children state on edit mode start.

Parameters :
Name Type Optional Description
state DashboardChildrenState No

Dashboard children initial state.

Returns : void
newState
newState(state: DashboardChildrenState)

Saves current state for further undo actions and sets new dashboard children state.

Parameters :
Name Type Optional Description
state DashboardChildrenState No

Dashboard children updated state.

Returns : void
redo
redo()

Applies previously undone change.

Current state of dashboard children after applying previously undone change.

reset
reset()

Resets dashboard children state to initial one and returns initial state.

Initial state of dashboard children.

undo
undo()

Reverts last dashboard children change.

Current state of dashboard children after reverting last change.

Accessors

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.

results matching ""

    No results matching ""