Class IvyFreyaTheme

java.lang.Object
ch.ivyteam.ivy.jsf.primefaces.theme.IvyFreyaTheme

public final class IvyFreyaTheme extends Object
Session bean for the access to the freya theme. If you use this bean you can switch the theme between dark and light mode, by call the toggleTheme() method or set the primefaces-theme-mode cookie on your browser to "dark" or "light". Use this bean like the following:

 <h:head>
 <f:attribute name="primefaces.THEME" value="#{ivyFreyaTheme.theme}" />
 ...
 <h:outputStylesheet name="#{ivyFreyaTheme.layout}" library="#{ivyFreyaTheme.library}" />
 ...
 </h:head>
 
Since:
9.4
API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current freya layout css, e.g "css/layout-ivy-light.css".
    Get the freya library "freya-layout".
    Get the branding logo for the current theme mode, "logo" or "logo_light".
    Get the current theme mode, "light" or "dark".
    Get the current freya theme, e.g.
    void
    setMode(String themeMode)
    Set the current theme mode.
    void
    Toggle the theme mode between "light" and "dark".
  • Method Details

    • setMode

      public void setMode(String themeMode)
      Set the current theme mode.
      Parameters:
      themeMode - "light" and "dark" are supported
      API:
      This public API is available in Java.
    • getMode

      public String getMode()
      Get the current theme mode, "light" or "dark".
      API:
      This public API is available in Java.
    • getTheme

      public String getTheme()
      Get the current freya theme, e.g. "freya-ivy-light".
      API:
      This public API is available in Java.
    • getLayout

      public String getLayout()
      Get the current freya layout css, e.g "css/layout-ivy-light.css".
      API:
      This public API is available in Java.
    • getLibrary

      public String getLibrary()
      Get the freya library "freya-layout".
      API:
      This public API is available in Java.
    • getLogo

      public String getLogo()
      Get the branding logo for the current theme mode, "logo" or "logo_light".
      API:
      This public API is available in Java.
    • toggleTheme

      public void toggleTheme()
      Toggle the theme mode between "light" and "dark".
      API:
      This public API is available in Java.