Package org.zkoss.web.fn
Class ThemeFns
java.lang.Object
org.zkoss.web.fn.ThemeFns
Providing theme relevant functions for EL.
- Since:
- 6.5.0
- Author:
- simonpai, jumperchen
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringGenerates a specific browser CSS rule String for the given style name and value.static StringborderRadius(String style) Generates a specific browser CSS border-radius.static StringGenerates a specific browser CSS rule string for box model.static StringGenerates a specific browser CSS rule string for box model with two pair styles.static Stringbox3(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.static StringGenerates a specific browser CSS box-shadow.static StringReturns the current theme namestatic ThemeRegistryReturns the current theme registrystatic ThemeResolverReturns the current theme resolverstatic StringGenerates a specific of browser CSS color gradient rules String.static StringGenerates a set of cross-browser CSS color gradient rules String.static StringGenerates a specific CSS color gradient value only.static voidloadProperties(String path) Loads a theme properties and apply them into the request scope.static voidsetThemeRegistry(ThemeRegistry themeRegistry) Change the theme registrystatic voidsetThemeResolver(ThemeResolver themeResolver) Change the current theme resolverstatic StringGenerates a specific browser CSS transform.
-
Method Details
-
gradient
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
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
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
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, likebox-sizing,animationstyleValue- the value according to the style name, likeborder-box,mymove 5s infinite- Returns:
- a specific browser CSS rule string, like
-moz-box-sizingfor firefox and-webkit-box-sizingfor safari and chrome
-
box
Generates a specific browser CSS rule string for box model.- Parameters:
styleName- the value of the style name, likebox-orient,box-packstyleValue- the value according to the style name, likehorizontal,center- Returns:
- a specific browser CSS rule string, like
-moz-box-orientfor firefox and-webkit-box-orientfor 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. -
transform
Generates a specific browser CSS transform.- Parameters:
style- the value of the transform- Returns:
- a specific browser CSS transform
-
boxShadow
Generates a specific browser CSS box-shadow.- Parameters:
style- the value of the box-shadow- Returns:
- a specific browser CSS box-shadow
-
borderRadius
Generates a specific browser CSS border-radius.- Parameters:
style- the value of the border-radius- Returns:
- a specific browser CSS border-radius
-
loadProperties
Loads a theme properties and apply them into the request scope.- Parameters:
path- a file path
-
getThemeRegistry
Returns the current theme registry- Returns:
- the current theme registry
- Since:
- 6.5.2
-
setThemeRegistry
Change the theme registry- Parameters:
themeRegistry- the new theme registry- Since:
- 6.5.2
-
getThemeResolver
Returns the current theme resolver- Returns:
- the current theme resolver
- Since:
- 6.5.2
-
setThemeResolver
Change the current theme resolver- Parameters:
themeResolver- the new theme resolver
-
getCurrentTheme
Returns the current theme name- Returns:
- the current theme name
- Since:
- 6.5.2
-