Skip to main content

ViewStateManager

Import :

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

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.

view/ViewStateManager.reset()

resets the view state cache

Kind: inner method of view/ViewStateManager

view/ViewStateManager.updateViewState(view, viewState)

Updates the view state for the specified view

Kind: inner method of view/ViewStateManager

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

view/ViewStateManager.getViewState(file) ⇒ *

gets the view state for the specified file

Kind: inner method of view/ViewStateManager
Returns: * - whatever data that was saved earlier with a call setViewState

ParamTypeDescription
fileFilethe file to record the view state for

view/ViewStateManager.addViewStates(viewStates)

adds an array of view states

Kind: inner method of view/ViewStateManager

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