org.jboss.seam.faces
Class Selector

java.lang.Object
  extended by org.jboss.seam.core.AbstractMutable
      extended by org.jboss.seam.faces.Selector
All Implemented Interfaces:
Serializable, Mutable
Direct Known Subclasses:
LocaleSelector, ThemeSelector, TimeZoneSelector

public abstract class Selector
extends AbstractMutable
implements Serializable

Support for selector objects which remember their selection as a cookie

Author:
Gavin King
See Also:
Serialized Form

Field Summary
static int DEFAULT_MAX_AGE
           
 
Constructor Summary
Selector()
           
 
Method Summary
protected  void clearCookieValue()
           
protected  javax.servlet.http.Cookie getCookie()
           
 int getCookieMaxAge()
          The max age of the cookie
protected abstract  String getCookieName()
          Override to define the cookie name
 String getCookiePath()
           
protected  String getCookieValue()
           
protected  String getCookieValueIfEnabled()
          Get the value of the cookie
 boolean isCookieEnabled()
          Is the cookie enabled?
 void setCookieEnabled(boolean cookieEnabled)
           
 void setCookieMaxAge(int cookieMaxAge)
           
 void setCookiePath(String cookiePath)
           
protected  void setCookieValueIfEnabled(String value)
          Set the cookie
 
Methods inherited from class org.jboss.seam.core.AbstractMutable
clearDirty, setDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_AGE

public static final int DEFAULT_MAX_AGE
See Also:
Constant Field Values
Constructor Detail

Selector

public Selector()
Method Detail

isCookieEnabled

public boolean isCookieEnabled()
Is the cookie enabled?

Returns:
false by default

setCookieEnabled

public void setCookieEnabled(boolean cookieEnabled)

getCookieMaxAge

public int getCookieMaxAge()
The max age of the cookie

Returns:
1 year by default

setCookieMaxAge

public void setCookieMaxAge(int cookieMaxAge)

getCookiePath

public String getCookiePath()

setCookiePath

public void setCookiePath(String cookiePath)

getCookieName

protected abstract String getCookieName()
Override to define the cookie name


getCookieValueIfEnabled

protected String getCookieValueIfEnabled()
Get the value of the cookie


getCookie

protected javax.servlet.http.Cookie getCookie()

getCookieValue

protected String getCookieValue()

clearCookieValue

protected void clearCookieValue()

setCookieValueIfEnabled

protected void setCookieValueIfEnabled(String value)
Set the cookie