net.sf.sfac.lang
Class LanguageSupportImpl

java.lang.Object
  extended by net.sf.sfac.lang.LanguageSupport
      extended by net.sf.sfac.lang.LanguageSupportImpl
All Implemented Interfaces:
Cloneable

public class LanguageSupportImpl
extends LanguageSupport
implements Cloneable


Constructor Summary
LanguageSupportImpl(String[] allBundleNames, String startLocaleId)
          Construct a LanguageSupportImpl using several bundle and the given locale.
LanguageSupportImpl(String bundleName, String startLocaleId)
          Construct a LanguageSupportImpl using one bundle and the given locale.
 
Method Summary
 void addLanguageListenerImpl(LanguageListener lis)
           
 void addResourceBundle(String bundleName)
          Add a resourceBundle to the bundle used by this LanguageSupportImpl.
 LanguageSupport copyInstance()
           
 Locale getCurrentLocaleImpl()
           
 String getLocalizedStringImpl(String key)
           
 String getLocalizedStringImpl(String key, Object... params)
           
 String getOptionalLocalizedStringImpl(String key, String defaultValue)
           
protected  void loadResources(Locale newLocale)
           
 void removeLanguageListenerImpl(LanguageListener lis)
           
 void saveTrackedInfo()
           
 void setTracker(LocalizedStringTracker newTracker)
          Set a tracker to track string usage in the application.
 void updateLanguageImpl(String newLocaleId)
           
 
Methods inherited from class net.sf.sfac.lang.LanguageSupport
addLanguageListener, getCurrentLocale, getInstance, getLocalizedString, getLocalizedString, getOptionalLocalizedString, removeLanguageListener, setInstance, updateLanguage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageSupportImpl

public LanguageSupportImpl(String bundleName,
                           String startLocaleId)
Construct a LanguageSupportImpl using one bundle and the given locale. Other bundles can be added with the addResourceBundle method.

Parameters:
bundleName - name of the (unique) bundle.
startLocaleId - id of the locale.

LanguageSupportImpl

public LanguageSupportImpl(String[] allBundleNames,
                           String startLocaleId)
Construct a LanguageSupportImpl using several bundle and the given locale.

Parameters:
allBundleNames - name of the bundles.
startLocaleId - id of the locale.
Method Detail

copyInstance

public LanguageSupport copyInstance()
Specified by:
copyInstance in class LanguageSupport

setTracker

public void setTracker(LocalizedStringTracker newTracker)
Set a tracker to track string usage in the application.


saveTrackedInfo

public void saveTrackedInfo()

addResourceBundle

public void addResourceBundle(String bundleName)
Add a resourceBundle to the bundle used by this LanguageSupportImpl. (this will fire a language changed event to all listeners).

Parameters:
bundleName - newly defined bundle.

getLocalizedStringImpl

public String getLocalizedStringImpl(String key)
Specified by:
getLocalizedStringImpl in class LanguageSupport

getLocalizedStringImpl

public String getLocalizedStringImpl(String key,
                                     Object... params)
Specified by:
getLocalizedStringImpl in class LanguageSupport

getOptionalLocalizedStringImpl

public String getOptionalLocalizedStringImpl(String key,
                                             String defaultValue)
Specified by:
getOptionalLocalizedStringImpl in class LanguageSupport

updateLanguageImpl

public void updateLanguageImpl(String newLocaleId)
Specified by:
updateLanguageImpl in class LanguageSupport

loadResources

protected void loadResources(Locale newLocale)

getCurrentLocaleImpl

public Locale getCurrentLocaleImpl()
Specified by:
getCurrentLocaleImpl in class LanguageSupport

addLanguageListenerImpl

public void addLanguageListenerImpl(LanguageListener lis)
Specified by:
addLanguageListenerImpl in class LanguageSupport

removeLanguageListenerImpl

public void removeLanguageListenerImpl(LanguageListener lis)
Specified by:
removeLanguageListenerImpl in class LanguageSupport


Copyright © 2012. All Rights Reserved.