Package org.zkoss.web.theme
Class StandardTheme
java.lang.Object
org.zkoss.web.theme.Theme
org.zkoss.web.theme.StandardTheme
A standard implementation of Theme.
- Since:
- 6.5.2
- Author:
- neillee
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumUsed to specify the origin of theme resources (e.g. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName used to display the default themestatic final StringName used to identify the default themestatic final StandardTheme.ThemeOriginOrigin of the default theme.static final intPriority of the default theme -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default themeStandardTheme(String themeName) Instantiate a standard themeStandardTheme(String themeName, String displayName, int priority) Instantiate a standard themeStandardTheme(String themeName, String displayName, int priority, StandardTheme.ThemeOrigin origin) Instantiate a standard themeStandardTheme(String themeName, StandardTheme.ThemeOrigin origin) Instantiate a standard theme -
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator<StandardTheme>Defines the ordering of standard themes.intvoidsetDisplayName(String displayName) Rename the display namevoidsetPriority(int priority) Adjust the priority of the theme
-
Field Details
-
DEFAULT_NAME
Name used to identify the default theme- See Also:
-
DEFAULT_DISPLAY
Name used to display the default theme- See Also:
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITYPriority of the default theme- See Also:
-
DEFAULT_ORIGIN
Origin of the default theme. For default desktop theme, it is inside zul.jar/zkex.jar/zkmax.jar. For default tablet theme, it is inside zkmax.jar.
-
-
Constructor Details
-
StandardTheme
public StandardTheme()Instantiate a default theme -
StandardTheme
Instantiate a standard theme- Parameters:
themeName- name used to identify the theme
-
StandardTheme
Instantiate a standard theme- Parameters:
themeName- name used to identify the themeorigin- where the theme resource is located, jar or folder
-
StandardTheme
Instantiate a standard theme- Parameters:
themeName- name used to identify the themedisplayName- name used to display the themepriority- used to choose which theme to use, if no theme is specified, and no preferred theme is set. Higher priority themes are chosen over the lower priority themes. Lower the priority value, higher the priority.
-
StandardTheme
public StandardTheme(String themeName, String displayName, int priority, StandardTheme.ThemeOrigin origin) Instantiate a standard theme- Parameters:
themeName- name used to identify the themedisplayName- name used to display the themepriority- used to choose which theme to use, if no theme is specified, and no preferred theme is set. Higher priority themes are chosen over the lower priority themes. Lower the priority value, higher the priority.origin- where the theme resources (i.e. CSS and images) are located
-
-
Method Details
-
getDisplayName
- Returns:
- the name used to display the theme
-
setDisplayName
Rename the display name- Parameters:
displayName- the new name used to display the theme
-
getPriority
public int getPriority()- Returns:
- the priority of the theme
-
setPriority
public void setPriority(int priority) Adjust the priority of the theme- Parameters:
priority- the new priority of the theme
-
getOrigin
- Returns:
- the origin of the theme resource
-
getComparator
Defines the ordering of standard themes. Higher priority themes are ordered before the lower priority themes.- Returns:
- the comparator based on theme's priority values
-