3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.state.Manager"></div>/**
\r
15 * @class Ext.state.Manager
\r
16 * This is the global state manager. By default all components that are "state aware" check this class
\r
17 * for state information if you don't pass them a custom state provider. In order for this class
\r
18 * to be useful, it must be initialized with a provider when your application initializes. Example usage:
\r
20 // in your initialization function
\r
22 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
\r
23 var win = new Window(...);
\r
29 Ext.state.Manager = function(){
\r
30 var provider = new Ext.state.Provider();
\r
33 <div id="method-Ext.state.Manager-setProvider"></div>/**
\r
34 * Configures the default state provider for your application
\r
35 * @param {Provider} stateProvider The state provider to set
\r
37 setProvider : function(stateProvider){
\r
38 provider = stateProvider;
\r
41 <div id="method-Ext.state.Manager-get"></div>/**
\r
42 * Returns the current value for a key
\r
43 * @param {String} name The key name
\r
44 * @param {Mixed} defaultValue The default value to return if the key lookup does not match
\r
45 * @return {Mixed} The state data
\r
47 get : function(key, defaultValue){
\r
48 return provider.get(key, defaultValue);
\r
51 <div id="method-Ext.state.Manager-set"></div>/**
\r
52 * Sets the value for a key
\r
53 * @param {String} name The key name
\r
54 * @param {Mixed} value The state data
\r
56 set : function(key, value){
\r
57 provider.set(key, value);
\r
60 <div id="method-Ext.state.Manager-clear"></div>/**
\r
61 * Clears a value from the state
\r
62 * @param {String} name The key name
\r
64 clear : function(key){
\r
65 provider.clear(key);
\r
68 <div id="method-Ext.state.Manager-getProvider"></div>/**
\r
69 * Gets the currently configured state provider
\r
70 * @return {Provider} The state provider
\r
72 getProvider : function(){
\r