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
Param | Type | Description |
---|---|---|
view | Object | the 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
Param | Type | Description |
---|---|---|
file | File | the file to record the view state for |
addViewStates(viewStates)
adds an array of view states
Kind: global function
Param | Type | Description |
---|---|---|
viewStates | object.<string, *> | View State object to append to the current set of view states |