01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.state;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12:
13: /**
14: * The default Provider implementation which saves state via cookies.
15: * <p/>
16: * Usage :
17: * <pre>
18: * CookieProvider cp = new CookieProvider(...);
19: * Manager.setProvider(cp);
20: * </pre>
21: *
22: * @see com.gwtext.client.state.Manager
23: */
24: public class CookieProvider extends Provider {
25:
26: public CookieProvider() {
27: jsObj = create();
28: }
29:
30: /**
31: * Creates a new Cookieprovider using the specified configuration.
32: *
33: * @param config the configuration
34: */
35: public CookieProvider(CookieProviderConfig config) {
36: jsObj = create(config.getJsObj());
37: }
38:
39: private native JavaScriptObject create() /*-{
40: return new $wnd.Ext.state.CookieProvider();
41: }-*/;
42:
43: private native JavaScriptObject create(JavaScriptObject config) /*-{
44: return new $wnd.Ext.state.CookieProvider(config);
45: }-*/;
46: }
|