org.zkoss.web.theme
Class StandardTheme

java.lang.Object
  extended by org.zkoss.web.theme.Theme
      extended by org.zkoss.web.theme.StandardTheme

public final class StandardTheme
extends Theme

A standard implementation of Theme.

Since:
6.5.2
Author:
neillee

Nested Class Summary
static class StandardTheme.ThemeOrigin
          Used to specify the origin of theme resources (e.g.
 
Field Summary
static java.lang.String DEFAULT_DISPLAY
          Name used to display the default theme
static java.lang.String DEFAULT_NAME
          Name used to identify the default theme
static StandardTheme.ThemeOrigin DEFAULT_ORIGIN
          Origin of the default theme.
static int DEFAULT_PRIORITY
          Priority of the default theme
 
Constructor Summary
StandardTheme()
          Instantiate a default theme
StandardTheme(java.lang.String themeName)
          Instantiate a standard theme
StandardTheme(java.lang.String themeName, StandardTheme.ThemeOrigin origin)
          Instantiate a standard theme
StandardTheme(java.lang.String themeName, java.lang.String displayName, int priority)
          Instantiate a standard theme
StandardTheme(java.lang.String themeName, java.lang.String displayName, int priority, StandardTheme.ThemeOrigin origin)
          Instantiate a standard theme
 
Method Summary
static java.util.Comparator<StandardTheme> getComparator()
          Defines the ordering of standard themes.
 java.lang.String getDisplayName()
           
 StandardTheme.ThemeOrigin getOrigin()
           
 int getPriority()
           
 void setDisplayName(java.lang.String displayName)
          Rename the display name
 void setPriority(int priority)
          Adjust the priority of the theme
 
Methods inherited from class org.zkoss.web.theme.Theme
getName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final java.lang.String DEFAULT_NAME
Name used to identify the default theme

See Also:
Constant Field Values

DEFAULT_DISPLAY

public static final java.lang.String DEFAULT_DISPLAY
Name used to display the default theme

See Also:
Constant Field Values

DEFAULT_PRIORITY

public static final int DEFAULT_PRIORITY
Priority of the default theme

See Also:
Constant Field Values

DEFAULT_ORIGIN

public static final StandardTheme.ThemeOrigin 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 Detail

StandardTheme

public StandardTheme()
Instantiate a default theme


StandardTheme

public StandardTheme(java.lang.String themeName)
Instantiate a standard theme

Parameters:
themeName - name used to identify the theme

StandardTheme

public StandardTheme(java.lang.String themeName,
                     StandardTheme.ThemeOrigin origin)
Instantiate a standard theme

Parameters:
themeName - name used to identify the theme
origin - where the theme resource is located, jar or folder

StandardTheme

public StandardTheme(java.lang.String themeName,
                     java.lang.String displayName,
                     int priority)
Instantiate a standard theme

Parameters:
themeName - name used to identify the theme
displayName - name used to display the theme
priority - 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(java.lang.String themeName,
                     java.lang.String displayName,
                     int priority,
                     StandardTheme.ThemeOrigin origin)
Instantiate a standard theme

Parameters:
themeName - name used to identify the theme
displayName - name used to display the theme
priority - 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 Detail

getDisplayName

public java.lang.String getDisplayName()
Returns:
the name used to display the theme

setDisplayName

public void setDisplayName(java.lang.String displayName)
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

public StandardTheme.ThemeOrigin getOrigin()
Returns:
the origin of the theme resource

getComparator

public static java.util.Comparator<StandardTheme> 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


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo