com.extjs.gxt.ui.client.state
Class CookieProvider

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.state.Provider
          extended by com.extjs.gxt.ui.client.state.CookieProvider
All Implemented Interfaces:
Observable

public class CookieProvider
extends Provider

The default Provider implementation which saves state via cookies.


Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.state.Provider
manager
 
Constructor Summary
CookieProvider(java.lang.String path, java.util.Date expires, java.lang.String domain, boolean secure)
          Creates a new cookie provider
 
Method Summary
 void clear(java.lang.String name)
          Clears a value.
protected  void clearKey(java.lang.String name)
           
protected  java.lang.String getValue(java.lang.String name)
           
 void set(java.lang.String name, java.lang.String value, java.util.Date expires)
           
protected  void setValue(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class com.extjs.gxt.ui.client.state.Provider
bind, get, getBoolean, getDate, getInteger, getMap, getString, set
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieProvider

public CookieProvider(java.lang.String path,
                      java.util.Date expires,
                      java.lang.String domain,
                      boolean secure)
Creates a new cookie provider

Parameters:
path - The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)
expires - the cookie expiration date (defaults to 7 days from now)
domain - The domain to save the cookie for. Note that you cannot specify a different domain than your page is on, but you can specify a sub-domain.
secure - true if the site is using SSL
Method Detail

clearKey

protected void clearKey(java.lang.String name)
Specified by:
clearKey in class Provider

getValue

protected java.lang.String getValue(java.lang.String name)
Specified by:
getValue in class Provider

setValue

protected void setValue(java.lang.String name,
                        java.lang.String value)
Specified by:
setValue in class Provider

clear

public void clear(java.lang.String name)
Description copied from class: Provider
Clears a value.

Overrides:
clear in class Provider
Parameters:
name - the key name

set

public void set(java.lang.String name,
                java.lang.String value,
                java.util.Date expires)