3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.state.Manager
\r
9 * This is the global state manager. By default all components that are "state aware" check this class
\r
10 * for state information if you don't pass them a custom state provider. In order for this class
\r
11 * to be useful, it must be initialized with a provider when your application initializes. Example usage:
\r
13 // in your initialization function
\r
15 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
\r
16 var win = new Window(...);
\r
22 Ext.state.Manager = function(){
\r
23 var provider = new Ext.state.Provider();
\r
27 * Configures the default state provider for your application
\r
28 * @param {Provider} stateProvider The state provider to set
\r
30 setProvider : function(stateProvider){
\r
31 provider = stateProvider;
\r
35 * Returns the current value for a key
\r
36 * @param {String} name The key name
\r
37 * @param {Mixed} defaultValue The default value to return if the key lookup does not match
\r
38 * @return {Mixed} The state data
\r
40 get : function(key, defaultValue){
\r
41 return provider.get(key, defaultValue);
\r
45 * Sets the value for a key
\r
46 * @param {String} name The key name
\r
47 * @param {Mixed} value The state data
\r
49 set : function(key, value){
\r
50 provider.set(key, value);
\r
54 * Clears a value from the state
\r
55 * @param {String} name The key name
\r
57 clear : function(key){
\r
58 provider.clear(key);
\r
62 * Gets the currently configured state provider
\r
63 * @return {Provider} The state provider
\r
65 getProvider : function(){
\r