org.richfaces.skin
Class SkinFactory

java.lang.Object
  extended by org.richfaces.skin.SkinFactory

public abstract class SkinFactory
extends java.lang.Object

Base factory class ( implement Singleton design pattern ). Produce self instance to build current skin configuration. At present, realised as lazy creation factory. TODO - select point to initialize.

Version:
$Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
Author:
asmirnov@exadel.com (latest modification by $Author: alexsmirnov $)

Field Summary
static java.lang.String BASE_SKIN_PARAMETER
           
static java.lang.String DEFAULT_SKIN_FACTORY_IMPL_CLASS
          Full class name of default implementation of the SkinFactory class
static java.lang.String SERVICE_RESOURCE
          Resource Uri for file with name of class for application-wide SkinFactory same as SPI definitions for common Java SAX, Jsf etc.
static java.lang.String SKIN_PARAMETER
          Name of web application init parameter for current skin .
 
Constructor Summary
SkinFactory()
           
 
Method Summary
abstract  Skin getBaseSkin(javax.faces.context.FacesContext facesContext)
          Get base Skin implementation
abstract  Skin getDefaultSkin(javax.faces.context.FacesContext context)
          Get default Skin implementation.
static SkinFactory getInstance()
          Initialize skin factory.
abstract  Skin getSkin(javax.faces.context.FacesContext context)
          Get current Skin implementation.
abstract  Theme getTheme(javax.faces.context.FacesContext facesContext, java.lang.String name)
           
static void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_RESOURCE

public static final java.lang.String SERVICE_RESOURCE
Resource Uri for file with name of class for application-wide SkinFactory same as SPI definitions for common Java SAX, Jsf etc. factories


SKIN_PARAMETER

public static final java.lang.String SKIN_PARAMETER
Name of web application init parameter for current skin . Can be simple String for non-modified name, or EL-expression for calculate current skin. If EL evaluated to String - used as skin name, if to instance of Skin - used this instance. by default - "org.exadel.chameleon.SKIN"

See Also:
Constant Field Values

BASE_SKIN_PARAMETER

public static final java.lang.String BASE_SKIN_PARAMETER
See Also:
Constant Field Values

DEFAULT_SKIN_FACTORY_IMPL_CLASS

public static final java.lang.String DEFAULT_SKIN_FACTORY_IMPL_CLASS
Full class name of default implementation of the SkinFactory class

See Also:
Constant Field Values
Constructor Detail

SkinFactory

public SkinFactory()
Method Detail

reset

public static void reset()

getInstance

public static final SkinFactory getInstance()
Initialize skin factory. TODO - make call from init() method of any servlet or custom faces element method ??? If exist resource META-INF/services/org.richfaces.skin.SkinFactory , create instance of class by name from first line of this file. If such class have constructor with SkinFactory parameter, instantiate it with instance of default factory ( as usual in JSF ). If any error occurs in instantiate custom factory, return default.


getDefaultSkin

public abstract Skin getDefaultSkin(javax.faces.context.FacesContext context)
Get default Skin implementation.

Parameters:
context -
Returns:

getSkin

public abstract Skin getSkin(javax.faces.context.FacesContext context)
Get current Skin implementation.

Parameters:
context -
Returns:

getBaseSkin

public abstract Skin getBaseSkin(javax.faces.context.FacesContext facesContext)
Get base Skin implementation

Parameters:
facesContext -
Returns:

getTheme

public abstract Theme getTheme(javax.faces.context.FacesContext facesContext,
                               java.lang.String name)
Parameters:
facesContext -
name -
Returns:


Copyright © 2010. All Rights Reserved.