net.curre.prefcount.service
Class LafThemeService

java.lang.Object
  extended by net.curre.prefcount.service.LafThemeService

public class LafThemeService
extends java.lang.Object

This is a helper class to assist with Look and Feel issues.

Created date: Jun 11, 2007

Author:
Yevgeny Nyden

Field Summary
static PrefSkin[] AVAILABLE_SKINS
          Array of available themes/skins.
 
Method Summary
 PrefSkin findSkinById(java.lang.String skinId)
          Returns the skin given its ID (resource key).
 PrefSkin getCurrentSkin()
          Returns reference to the current skin.
static LafThemeService getInstance()
          Returns an instance of this class to use.
 void setLookAndFeel(java.lang.String skinId, boolean isFirstRun)
          Sets the Look and Feel according to the passed theme/skin name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AVAILABLE_SKINS

public static final PrefSkin[] AVAILABLE_SKINS
Array of available themes/skins.

Method Detail

getInstance

public static LafThemeService getInstance()
Returns an instance of this class to use.

Returns:
singleton instance of this class to use.

getCurrentSkin

public PrefSkin getCurrentSkin()
Returns reference to the current skin.

Returns:
reference to the current skin.

setLookAndFeel

public void setLookAndFeel(java.lang.String skinId,
                           boolean isFirstRun)
Sets the Look and Feel according to the passed theme/skin name.

Parameters:
skinId - Theme/skin ID (resource key) to set the LaF to.
isFirstRun - Flag to indicate the first run of this method (when true).

findSkinById

public PrefSkin findSkinById(java.lang.String skinId)
                      throws ServiceException
Returns the skin given its ID (resource key).

Parameters:
skinId - Skin ID (resource key).
Returns:
The skin with the given ID (resource key).
Throws:
ServiceException - If skin with given ID was not found.


Copyright © 2008. All Rights Reserved.