Class StandardThemeProvider

java.lang.Object
org.zkoss.zul.theme.StandardThemeProvider
All Implemented Interfaces:
org.zkoss.zk.ui.util.ThemeProvider

public class StandardThemeProvider extends Object implements org.zkoss.zk.ui.util.ThemeProvider
A standard implementation of ThemeProvider for ZK CE, which works with the Marble theme (ZK 11.0 and later; formerly the Breeze series themes)
Author:
simonpai, jumperchen, neillee
  • Field Details

  • Constructor Details

    • StandardThemeProvider

      public StandardThemeProvider()
  • Method Details

    • getThemeFileSuffix

      protected static String getThemeFileSuffix()
    • isDefaultTheme

      protected static boolean isDefaultTheme()
      Returns whether the current theme is the default theme (Marble), which ships its own reset stylesheet and no Font Awesome.
      Since:
      11.0.0
    • getThemeURIs

      public Collection<Object> getThemeURIs(org.zkoss.zk.ui.Execution exec, List<Object> uris)
      Marble ships a reset stylesheet that must be loaded immediately before ZK's widget-CSS bundle (zk.wcs) so it keeps its "first" cascade position in the page. For the default theme this method inserts the reset URI right before the first entry that starts with DEFAULT_WCS; for any other theme it only applies the theme suffix to that entry, since a legacy theme resets in its own norm.css.dsp.

      Which reset stylesheet is served is controlled by the library property org.zkoss.zul.theme.browserDefault (boolean, default false):

      • false (default) — serve the standard global reset (~./zul/css/reset.css), which overrides browser defaults page-wide.
      • true — serve the host-safe reset (~./zul/css/reset-embed.css), scoped so it does not override a host page's own styles; use this when a ZK page is embedded inside another (non-ZK) page.

      Since ZK 11.0.0 this method inserts the reset stylesheet for the default theme; earlier versions only applied the non-default-theme suffix to the widget-CSS bundle.

      Specified by:
      getThemeURIs in interface org.zkoss.zk.ui.util.ThemeProvider
    • getWCSCacheControl

      public int getWCSCacheControl(org.zkoss.zk.ui.Execution exec, String uri)
      Specified by:
      getWCSCacheControl in interface org.zkoss.zk.ui.util.ThemeProvider
    • beforeWCS

      public String beforeWCS(org.zkoss.zk.ui.Execution exec, String uri)
      Specified by:
      beforeWCS in interface org.zkoss.zk.ui.util.ThemeProvider
    • beforeWidgetCSS

      public String beforeWidgetCSS(org.zkoss.zk.ui.Execution exec, String uri)
      Specified by:
      beforeWidgetCSS in interface org.zkoss.zk.ui.util.ThemeProvider