Package io.keikai.theme
Class SpreadsheetThemes
- java.lang.Object
-
- io.keikai.theme.SpreadsheetThemes
-
public class SpreadsheetThemes extends Object
Facade for accessing internal theming subsystem In most cases, users need not use the underlying theme registry and theme resolver directly.- Since:
- 3.5.0
- Author:
- sam, neillee, RaymondChao
-
-
Constructor Summary
Constructors Constructor Description SpreadsheetThemes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getCurrentTheme()
Returns the current theme namestatic String
getDisplayName(String themeName)
Return the display name (human name) of the themestatic int
getPriority(String themeName)
Return the priority of the given themestatic String
getTheme(org.zkoss.zk.ui.Execution exe)
Returns the theme specified using the current theme resolution strategy Default strategy is to use cookiesstatic String[]
getThemes()
Returns an array of registered theme namesstatic boolean
hasTheme(String themeName)
Returns true if the theme is registeredstatic void
register(String themeName)
Register the theme, so it becomes available in the theme liststatic void
register(String themeName, SpreadsheetStandardTheme.ThemeOrigin origin)
Register the theme, and specifies its origin (e.g.static void
register(String themeName, String displayName, int priority)
Register the theme with detailsstatic void
register(String themeName, String displayName, int priority, SpreadsheetStandardTheme.ThemeOrigin origin)
Register the theme, its display name, its priority; and also specifies its origin (e.g.static String
resolveThemeURL(String url)
static void
setDisplayName(String themeName, String displayName)
Set the display name (human name) of the themestatic void
setPriority(String themeName, int priority)
Set the priority of the theme.static void
setTheme(org.zkoss.zk.ui.Execution exe, String themeName)
Sets the theme name using the current theme resolution strategy Default strategy is to use cookies
-
-
-
Method Detail
-
setTheme
public static void setTheme(org.zkoss.zk.ui.Execution exe, String themeName)
Sets the theme name using the current theme resolution strategy Default strategy is to use cookies- Parameters:
exe
- ExecutionthemeName
- the new intended theme name
-
getTheme
public static String getTheme(org.zkoss.zk.ui.Execution exe)
Returns the theme specified using the current theme resolution strategy Default strategy is to use cookies- Parameters:
exe
- Execution- Returns:
- the name of the theme or a fall back theme name determined by the theme resolution strategy used.
-
getCurrentTheme
public static String getCurrentTheme()
Returns the current theme name- Returns:
- the current theme name
-
hasTheme
public static boolean hasTheme(String themeName)
Returns true if the theme is registered- Parameters:
themeName
- the name of the theme- Returns:
- true if the theme with the given name is registered
-
getThemes
public static String[] getThemes()
Returns an array of registered theme names- Returns:
- an array of registered theme names
-
register
public static void register(String themeName)
Register the theme, so it becomes available in the theme list- Parameters:
themeName
- the name of the theme to be registered
-
register
public static void register(String themeName, SpreadsheetStandardTheme.ThemeOrigin origin)
Register the theme, and specifies its origin (e.g. from JAR or from FOLDER) Please useThemes.register("custom", Themes.ThemeOrigin.FOLDER)
to make your custom theme available if the theme resource is inside a folder- Parameters:
themeName
- theme nameorigin
- origin of the theme resource
-
register
public static void register(String themeName, String displayName, int priority)
Register the theme with details- Parameters:
themeName
- theme namedisplayName
- The human name of the themepriority
- Priority is higher if the value the smaller
-
register
public static void register(String themeName, String displayName, int priority, SpreadsheetStandardTheme.ThemeOrigin origin)
Register the theme, its display name, its priority; and also specifies its origin (e.g. from JAR or from FOLDER). Please useThemes.register("custom", "Custom Theme", 100, Themes.ThemeOrigin.FOLDER)
to make your custom theme available if the theme resource is inside a folder.- Parameters:
themeName
- theme namedisplayName
- a more descriptive name for the theme, for display purposepriority
- priority of the themeorigin
- origin of the theme resource
-
setDisplayName
public static void setDisplayName(String themeName, String displayName)
Set the display name (human name) of the theme- Parameters:
themeName
- theme namedisplayName
- the new name to be displayed
-
getDisplayName
public static String getDisplayName(String themeName)
Return the display name (human name) of the theme- Parameters:
themeName
- theme name- Returns:
- the display name
-
setPriority
public static void setPriority(String themeName, int priority)
Set the priority of the theme.- Parameters:
themeName
- theme namepriority
- Priority is higher if the value the smaller
-
getPriority
public static int getPriority(String themeName)
Return the priority of the given theme- Parameters:
themeName
- theme name- Returns:
- the priority of the given theme
-
-