Package org.zkoss.web.fn
Class ThemeFns
- java.lang.Object
-
- org.zkoss.web.fn.ThemeFns
-
public class ThemeFns extends java.lang.ObjectProviding theme relevant functions for EL.- Since:
- 6.5.0
- Author:
- simonpai, jumperchen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringapplyCSS3(java.lang.String styleName, java.lang.String styleValue)Generates a specific browser CSS rule String for the given style name and value.static java.lang.StringborderRadius(java.lang.String style)Generates a specific browser CSS border-radius.static java.lang.Stringbox(java.lang.String styleName, java.lang.String styleValue)Generates a specific browser CSS rule string for box model.static java.lang.Stringbox2(java.lang.String styleName, java.lang.String styleValue, java.lang.String styleName2, java.lang.String styleValue2)Generates a specific browser CSS rule string for box model with two pair styles.static java.lang.Stringbox3(java.lang.String styleName, java.lang.String styleValue, java.lang.String styleName2, java.lang.String styleValue2, java.lang.String styleName3, java.lang.String styleValue3)Generates a specific browser CSS rule string for box model with three pair styles.static java.lang.StringboxShadow(java.lang.String style)Generates a specific browser CSS box-shadow.static java.lang.StringgetCurrentTheme()Returns the current theme namestatic ThemeRegistrygetThemeRegistry()Returns the current theme registrystatic ThemeResolvergetThemeResolver()Returns the current theme resolverstatic java.lang.Stringgradient(java.lang.String direction, java.lang.String colors)Generates a specific of browser CSS color gradient rules String.static java.lang.Stringgradients(java.lang.String direction, java.lang.String colors)Generates a set of cross-browser CSS color gradient rules String.static java.lang.StringgradValue(java.lang.String direction, java.lang.String colors)Generates a specific CSS color gradient value only.static voidloadProperties(java.lang.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 java.lang.Stringtransform(java.lang.String style)Generates a specific browser CSS transform.
-
-
-
Method Detail
-
gradient
public static java.lang.String gradient(java.lang.String direction, java.lang.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 java.lang.String gradValue(java.lang.String direction, java.lang.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 java.lang.String gradients(java.lang.String direction, java.lang.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 java.lang.String applyCSS3(java.lang.String styleName, java.lang.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, 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
public static java.lang.String box(java.lang.String styleName, java.lang.String styleValue)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 java.lang.String box2(java.lang.String styleName, java.lang.String styleValue, java.lang.String styleName2, java.lang.String styleValue2)Generates a specific browser CSS rule string for box model with two pair styles.- See Also:
box(String, String)
-
box3
public static java.lang.String box3(java.lang.String styleName, java.lang.String styleValue, java.lang.String styleName2, java.lang.String styleValue2, java.lang.String styleName3, java.lang.String styleValue3)Generates a specific browser CSS rule string for box model with three pair styles.
-
transform
public static java.lang.String transform(java.lang.String style)
Generates a specific browser CSS transform.- Parameters:
style- the value of the transform- Returns:
- a specific browser CSS transform
-
boxShadow
public static java.lang.String boxShadow(java.lang.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 java.lang.String borderRadius(java.lang.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(java.lang.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 java.lang.String getCurrentTheme()
Returns the current theme name- Returns:
- the current theme name
- Since:
- 6.5.2
-
-