Skip to main content

ViewStateManager

Import :

const ViewStateManager = brackets.getModule("view/ViewStateManager")

_

ViewStateManager is a singleton for views to park their global viwe state. The state is saved with project data but the View or View Factory is responsible for restoring the view state when the view is created.

Views should implement getViewState() so that the view state can be saved and that data is cached for later use.

Views or View Factories are responsible for restoring the view state when the view of that file is created by recalling the cached state. Views determine what data is store in the view state and how to restore it.

Kind: global variable

reset()

resets the view state cache

Kind: global function

updateViewState(view, viewState)

Updates the view state for the specified view

Kind: global function

ParamTypeDescription
viewObjectthe to save state
viewState*any data that the view needs to restore the view state.

getViewState(file) ⇒ *

gets the view state for the specified file

Kind: global function
Returns: * - whatever data that was saved earlier with a call setViewState

ParamTypeDescription
fileFilethe file to record the view state for

addViewStates(viewStates)

adds an array of view states

Kind: global function

ParamTypeDescription
viewStatesobject.<string, *>View State object to append to the current set of view states