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