Class IvyFreyaTheme
java.lang.Object
ch.ivyteam.ivy.jsf.primefaces.theme.IvyFreyaTheme
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 TypeMethodDescriptionGet the current freya layout css, e.g "css/layout-ivy-light.css".Get the freya library "freya-layout".getLogo()
Get the branding logo for the current theme mode, "logo" or "logo_light".getMode()
Get the current theme mode, "light" or "dark".getTheme()
Get the current freya theme, e.g.void
Set the current theme mode.void
Toggle the theme mode between "light" and "dark".
-
Method Details
-
setMode
Set the current theme mode.- Parameters:
themeMode
- "light" and "dark" are supported- API:
- This public API is available in Java.
-
getMode
Get the current theme mode, "light" or "dark".- API:
- This public API is available in Java.
-
getTheme
Get the current freya theme, e.g. "freya-ivy-light".- API:
- This public API is available in Java.
-
getLayout
Get the current freya layout css, e.g "css/layout-ivy-light.css".- API:
- This public API is available in Java.
-
getLibrary
Get the freya library "freya-layout".- API:
- This public API is available in Java.
-
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.
-