to.etc.domui.themes
Class FragmentedThemeStore

java.lang.Object
  extended by to.etc.domui.themes.FragmentedThemeStore
All Implemented Interfaces:
ITheme

public class FragmentedThemeStore
extends java.lang.Object
implements ITheme

Author:
Frits Jalvingh Created on Jan 10, 2011

Constructor Summary
FragmentedThemeStore(DomApplication app, byte[] tbytes, JSTemplate stylesheetSource, java.util.Map<java.lang.String,java.lang.Object> themeProperties, java.util.List<java.lang.String> themeInheritanceStack, java.util.List<java.lang.String> iconInheritanceStack, ResourceDependencies deps)
           
 
Method Summary
protected  java.lang.String findIconURLUncached(java.lang.String icon)
          Uncached search for an iconized image.
 ResourceDependencies getDependencies()
          The dependencies for this theme instance.
 java.lang.String getIconURL(java.lang.String icon)
          Locate the specified theme resource from the theme, and return the URL needed to get it.
 java.lang.String getStylesheet()
          Returns the stylesheet RURL to include in every page.
 byte[] getStyleSheetBytes()
           
 JSTemplate getStylesheetTemplate()
           
 java.lang.String getThemePath(java.lang.String path)
          Get a resource from the theme's inheritance path.
 java.util.Map<java.lang.String,java.lang.Object> getThemeProperties()
          Return the read-only properties for a theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentedThemeStore

public FragmentedThemeStore(DomApplication app,
                            byte[] tbytes,
                            JSTemplate stylesheetSource,
                            java.util.Map<java.lang.String,java.lang.Object> themeProperties,
                            java.util.List<java.lang.String> themeInheritanceStack,
                            java.util.List<java.lang.String> iconInheritanceStack,
                            ResourceDependencies deps)
Method Detail

getStyleSheetBytes

public byte[] getStyleSheetBytes()

getStylesheet

public java.lang.String getStylesheet()
Description copied from interface: ITheme
Returns the stylesheet RURL to include in every page. This must return an application-relative URL, i.e. it must not include the webapp's context and must not start with a /.

Specified by:
getStylesheet in interface ITheme
Returns:

getDependencies

public ResourceDependencies getDependencies()
Description copied from interface: ITheme
The dependencies for this theme instance. This will be used by the engine to check if this instance needs to be reloaded because it's source files have changed in development mode.

Specified by:
getDependencies in interface ITheme
Returns:

getStylesheetTemplate

public JSTemplate getStylesheetTemplate()

getThemeProperties

public java.util.Map<java.lang.String,java.lang.Object> getThemeProperties()
Description copied from interface: ITheme
Return the read-only properties for a theme.

Specified by:
getThemeProperties in interface ITheme
Returns:

getIconURL

@Nonnull
public java.lang.String getIconURL(@Nonnull
                                           java.lang.String icon)
                            throws java.lang.Exception
Locate the specified theme resource from the theme, and return the URL needed to get it. Any THEME/ or ICON/ things have already been stripped; the name passed is something simple like "btnOkay.png".

Specified by:
getIconURL in interface ITheme
Parameters:
icon -
Returns:
Throws:
java.lang.Exception

findIconURLUncached

@Nullable
protected java.lang.String findIconURLUncached(java.lang.String icon)
                                        throws java.lang.Exception
Uncached search for an iconized image. If the thing is not found return null, else return the actual path for the icon.

Parameters:
icon -
Returns:
Throws:
java.lang.Exception

getThemePath

@Nullable
public java.lang.String getThemePath(java.lang.String path)
                              throws java.lang.Exception
Description copied from interface: ITheme
Get a resource from the theme's inheritance path.

Specified by:
getThemePath in interface ITheme
Returns:
Throws:
java.lang.Exception