org.jboss.seam.theme
Class ThemeSelector

java.lang.Object
  extended by org.jboss.seam.core.AbstractMutable
      extended by org.jboss.seam.faces.Selector
          extended by org.jboss.seam.theme.ThemeSelector
All Implemented Interfaces:
java.io.Serializable, Mutable

@Scope(value=SESSION)
@Name(value="org.jboss.seam.theme.themeSelector")
@BypassInterceptors
@Install(precedence=0,
         classDependencies="javax.faces.context.FacesContext")
public class ThemeSelector
extends Selector

Selects the current user's theme

Author:
Gavin King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.seam.faces.Selector
DEFAULT_MAX_AGE
 
Constructor Summary
ThemeSelector()
           
 
Method Summary
 java.lang.String[] getAvailableThemes()
           
protected  java.lang.String getCookieName()
          Override to define the cookie name
 java.lang.String getLocalizedThemeName(java.lang.String name)
          Get the localized name of the named theme, by looking for org.jboss.seam.theme.<name> in the Seam resource bundle
 java.lang.String getTheme()
          Get the name of the current theme
 java.util.ResourceBundle getThemeResourceBundle()
          Get the resource bundle for the theme
 java.util.List<javax.faces.model.SelectItem> getThemes()
          Get a selectable list of available themes for display in the UI
 void initDefaultTheme()
           
static ThemeSelector instance()
           
 void select()
          Recreate the JSF view, using the new theme, and raise the org.jboss.seam.themeSelected event
 void select(javax.faces.event.ValueChangeEvent event)
           
 void selectTheme(java.lang.String themeName)
           
 void setAvailableThemes(java.lang.String[] themeNames)
           
 void setTheme(java.lang.String themeName)
           
 
Methods inherited from class org.jboss.seam.faces.Selector
clearCookieValue, getCookie, getCookieMaxAge, getCookiePath, getCookieValue, getCookieValueIfEnabled, isCookieEnabled, setCookieEnabled, setCookieMaxAge, setCookiePath, setCookieValueIfEnabled
 
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
 

Constructor Detail

ThemeSelector

public ThemeSelector()
Method Detail

initDefaultTheme

@Create
public void initDefaultTheme()

getCookieName

protected java.lang.String getCookieName()
Description copied from class: Selector
Override to define the cookie name

Specified by:
getCookieName in class Selector

select

public void select()
Recreate the JSF view, using the new theme, and raise the org.jboss.seam.themeSelected event


select

public void select(javax.faces.event.ValueChangeEvent event)

selectTheme

public void selectTheme(java.lang.String themeName)

getThemes

public java.util.List<javax.faces.model.SelectItem> getThemes()
Get a selectable list of available themes for display in the UI


getTheme

public java.lang.String getTheme()
Get the name of the current theme


setTheme

public void setTheme(java.lang.String themeName)

setAvailableThemes

public void setAvailableThemes(java.lang.String[] themeNames)

getThemeResourceBundle

public java.util.ResourceBundle getThemeResourceBundle()
Get the resource bundle for the theme


getLocalizedThemeName

public java.lang.String getLocalizedThemeName(java.lang.String name)
Get the localized name of the named theme, by looking for org.jboss.seam.theme.<name> in the Seam resource bundle


instance

public static ThemeSelector instance()

getAvailableThemes

public java.lang.String[] getAvailableThemes()


Copyright © 2011 Seam Framework. All Rights Reserved.