Class ThemeFns

java.lang.Object
org.zkoss.web.fn.ThemeFns

public class ThemeFns extends Object
Providing theme relevant functions for EL.
Since:
6.5.0
Author:
simonpai, jumperchen
  • Method Details

    • gradient

      public static String gradient(String direction, String colors)
      Generates a specific of browser CSS color gradient rules String.
      Parameters:
      direction - "ver", "hor", "diag-", "diag+", "rad"
      colors - the colors with stops, which are separated by semicolon ";". For example,
      ThemeFns.gradient("ver", "#fefefe 0%; #eeeeee 100%");
      Returns:
      A specific CSS gradient rules String
    • gradValue

      public static String gradValue(String direction, String colors)
      Generates a specific CSS color gradient value only.
      Parameters:
      direction - "ver", "hor", "diag-", "diag+", "rad"
      colors - the colors with stops, which are separated by semicolon ";" For example,
      ThemeFns.gradValue("ver", "#fefefe 0%; #eeeeee 100%");
      Returns:
      A specific CSS gradient rules String without the words "background:".
    • gradients

      public static String gradients(String direction, String colors)
      Generates a set of cross-browser CSS color gradient rules String.
      Parameters:
      direction - "ver", "hor", "diag-", "diag+", "rad"
      colors - the colors, which are separated by semicolon ";"
      Returns:
      A set of cross-browser CSS gradient rules String
    • applyCSS3

      public static String applyCSS3(String styleName, String styleValue)
      Generates a specific browser CSS rule String for the given style name and value.

      Note: the method is only applied with the browser prefix as the style name, if the CSS3 style usage rule is different between browsers, please use another method instead.

      Parameters:
      styleName - the value of the style name, like box-sizing, animation
      styleValue - the value according to the style name, like border-box, mymove 5s infinite
      Returns:
      a specific browser CSS rule string, like -moz-box-sizing for firefox and -webkit-box-sizing for safari and chrome
    • box

      public static String box(String styleName, String styleValue)
      Generates a specific browser CSS rule string for box model.
      Parameters:
      styleName - the value of the style name, like box-orient, box-pack
      styleValue - the value according to the style name, like horizontal, center
      Returns:
      a specific browser CSS rule string, like -moz-box-orient for firefox and -webkit-box-orient for safari and chrome
    • box2

      public static String box2(String styleName, String styleValue, String styleName2, String styleValue2)
      Generates a specific browser CSS rule string for box model with two pair styles.
      See Also:
    • box3

      public static String box3(String styleName, String styleValue, String styleName2, String styleValue2, String styleName3, String styleValue3)
      Generates a specific browser CSS rule string for box model with three pair styles.
      See Also:
    • transform

      public static String transform(String style)
      Generates a specific browser CSS transform.
      Parameters:
      style - the value of the transform
      Returns:
      a specific browser CSS transform
    • boxShadow

      public static String boxShadow(String style)
      Generates a specific browser CSS box-shadow.
      Parameters:
      style - the value of the box-shadow
      Returns:
      a specific browser CSS box-shadow
    • borderRadius

      public static String borderRadius(String style)
      Generates a specific browser CSS border-radius.
      Parameters:
      style - the value of the border-radius
      Returns:
      a specific browser CSS border-radius
    • loadProperties

      public static void loadProperties(String path)
      Loads a theme properties and apply them into the request scope.
      Parameters:
      path - a file path
    • getThemeRegistry

      public static ThemeRegistry getThemeRegistry()
      Returns the current theme registry
      Returns:
      the current theme registry
      Since:
      6.5.2
    • setThemeRegistry

      public static void setThemeRegistry(ThemeRegistry themeRegistry)
      Change the theme registry
      Parameters:
      themeRegistry - the new theme registry
      Since:
      6.5.2
    • getThemeResolver

      public static ThemeResolver getThemeResolver()
      Returns the current theme resolver
      Returns:
      the current theme resolver
      Since:
      6.5.2
    • setThemeResolver

      public static void setThemeResolver(ThemeResolver themeResolver)
      Change the current theme resolver
      Parameters:
      themeResolver - the new theme resolver
    • getCurrentTheme

      public static String getCurrentTheme()
      Returns the current theme name
      Returns:
      the current theme name
      Since:
      6.5.2