Class SessionThemeProvider

java.lang.Object
de.agilecoders.wicket.core.settings.SessionThemeProvider
All Implemented Interfaces:
ActiveThemeProvider
Direct Known Subclasses:
CookieThemeProvider

public class SessionThemeProvider extends Object implements ActiveThemeProvider
#### Description An ActiveThemeProvider implementation that stores the active theme in the user session as style.
  • Constructor Details

    • SessionThemeProvider

      public SessionThemeProvider()
  • Method Details

    • getActiveTheme

      public ITheme getActiveTheme()
      Description copied from interface: ActiveThemeProvider
      returns the current active theme (can be user/session scoped). If none is set a default theme should be returned (implementation specific). There is a session scoped implementation: SessionThemeProvider
      Specified by:
      getActiveTheme in interface ActiveThemeProvider
      Returns:
      the current active theme
    • setActiveTheme

      public void setActiveTheme(String themeName)
      Description copied from interface: ActiveThemeProvider
      sets the active theme by its name.
      Specified by:
      setActiveTheme in interface ActiveThemeProvider
      Parameters:
      themeName - the theme name
    • setActiveTheme

      public void setActiveTheme(ITheme theme)
      Description copied from interface: ActiveThemeProvider
      sets the active theme
      Specified by:
      setActiveTheme in interface ActiveThemeProvider
      Parameters:
      theme - the theme to set
    • loadThemeName

      protected String loadThemeName()
      Loads the name of theme from the session's style
      Returns:
      The session's style
    • storeThemeName

      protected void storeThemeName(String themeName)
      Stores the theme name in the session's style
      Parameters:
      themeName - The name of the current theme
    • assertBoundSession

      protected void assertBoundSession(Session session)
      checks on existing session, if there isn't one it will be created.
      Parameters:
      session - current session to bind