Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / air / src / FileProvider.js
diff --git a/air/src/FileProvider.js b/air/src/FileProvider.js
deleted file mode 100644 (file)
index 2500824..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*\r
- * Ext JS Library 0.30\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.air.FileProvider\r
- * @extends Ext.state.Provider\r
- * \r
- * An Ext state provider implementation for Adobe AIR that stores state in the application \r
- * storage directory.\r
- * \r
- * @constructor\r
- * @param {Object} config\r
- */\r
-Ext.air.FileProvider = function(config){\r
-    Ext.air.FileProvider.superclass.constructor.call(this);\r
-       \r
-       this.defaultState = {\r
-               mainWindow : {\r
-                       width:780,\r
-                       height:580,\r
-                       x:10,\r
-                       y:10\r
-               }\r
-       };\r
-       \r
-    Ext.apply(this, config);\r
-    this.state = this.readState();\r
-       \r
-       var provider = this;\r
-       air.NativeApplication.nativeApplication.addEventListener('exiting', function(){\r
-               provider.saveState();\r
-       });\r
-};\r
-\r
-Ext.extend(Ext.air.FileProvider, Ext.state.Provider, {\r
-       /**\r
-        * @cfg {String} file\r
-        * The file name to use for the state file in the application storage directory\r
-        */\r
-       file: 'extstate.data',\r
-       \r
-       /**\r
-        * @cfg {Object} defaultState\r
-        * The default state if no state file can be found\r
-        */\r
-       // private\r
-    readState : function(){\r
-               var stateFile = air.File.applicationStorageDirectory.resolvePath(this.file);\r
-               if(!stateFile.exists){\r
-                       return this.defaultState || {};\r
-               }\r
-               \r
-               var stream = new air.FileStream();\r
-               stream.open(stateFile, air.FileMode.READ);\r
-               \r
-               var stateData = stream.readObject();\r
-               stream.close();\r
-               \r
-               return stateData || this.defaultState || {};\r
-    },\r
-\r
-    // private\r
-    saveState : function(name, value){\r
-        var stateFile = air.File.applicationStorageDirectory.resolvePath(this.file);\r
-               var stream = new air.FileStream();\r
-               stream.open(stateFile, air.FileMode.WRITE);\r
-               stream.writeObject(this.state);\r
-               stream.close();\r
-    }\r
-});
\ No newline at end of file