3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.state.Manager"></div>/**
16 * @class Ext.state.Manager
17 * This is the global state manager. By default all components that are "state aware" check this class
18 * for state information if you don't pass them a custom state provider. In order for this class
19 * to be useful, it must be initialized with a provider when your application initializes. Example usage:
21 // in your initialization function
23 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
24 var win = new Window(...);
30 Ext.state.Manager = function(){
31 var provider = new Ext.state.Provider();
34 <div id="method-Ext.state.Manager-setProvider"></div>/**
35 * Configures the default state provider for your application
36 * @param {Provider} stateProvider The state provider to set
38 setProvider : function(stateProvider){
39 provider = stateProvider;
42 <div id="method-Ext.state.Manager-get"></div>/**
43 * Returns the current value for a key
44 * @param {String} name The key name
45 * @param {Mixed} defaultValue The default value to return if the key lookup does not match
46 * @return {Mixed} The state data
48 get : function(key, defaultValue){
49 return provider.get(key, defaultValue);
52 <div id="method-Ext.state.Manager-set"></div>/**
53 * Sets the value for a key
54 * @param {String} name The key name
55 * @param {Mixed} value The state data
57 set : function(key, value){
58 provider.set(key, value);
61 <div id="method-Ext.state.Manager-clear"></div>/**
62 * Clears a value from the state
63 * @param {String} name The key name
65 clear : function(key){
69 <div id="method-Ext.state.Manager-getProvider"></div>/**
70 * Gets the currently configured state provider
71 * @return {Provider} The state provider
73 getProvider : function(){