| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.services.LocalizationSetterImpl
public class LocalizationSetterImpl
Given a set of supported locales, for a specified desired locale, sets the current thread's locale to a supported locale that is closest to the desired.
| Constructor Summary | |
|---|---|
| LocalizationSetterImpl(Request request,
                                             PersistentLocale persistentLocale,
                                             ThreadLocale threadLocale,
                                             String localeNames) | |
| Method Summary | |
|---|---|
|  List<Locale> | getSupportedLocales()Returns a list of supported locales, as per the SymbolConstants.SUPPORTED_LOCALESsymbol. | 
|  SelectModel | getSupportedLocalesModel()Returns the supported locales packaged as a model. | 
|  boolean | isSupportedLocaleName(String localeName)Checks to see if the indicated locale name is a supported locale name (that may have been incorporated into a request path). | 
|  boolean | setLocaleFromLocaleName(String localeName)Determines if the provided potential locale name (presumably, extracted from a request URL) is a supported locale name. | 
|  void | setNonPeristentLocaleFromLocaleName(String localeName)Allows the locale to be set from a specified locale name (which may be narrowed or defaulted to a support locale). | 
|  Locale | toLocale(String localeName)Converts a locale name into a Locale. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public LocalizationSetterImpl(Request request,
                              PersistentLocale persistentLocale,
                              ThreadLocale threadLocale,
                              @Symbol(value="tapestry.supported-locales")
                              String localeNames)
| Method Detail | 
|---|
public Locale toLocale(String localeName)
LocalizationSetter
toLocale in interface LocalizationSetterpublic boolean setLocaleFromLocaleName(String localeName)
LocalizationSetterThreadLocale (either
 to the provided locale, if supported, or to the default locale). If the locale name is supported, it will also
 set the PersistentLocale (which may affect how page and event links are
 generated, to persist the selected locale across requests).
 
 Note that locale names are case sensitive.
setLocaleFromLocaleName in interface LocalizationSetterlocaleName - name of locale to check (which may be blank or not a locale name)
PersistentLocale was
         setpublic void setNonPeristentLocaleFromLocaleName(String localeName)
LocalizationSetter
setNonPeristentLocaleFromLocaleName in interface LocalizationSetterlocaleName - locale in effect for this requestpublic List<Locale> getSupportedLocales()
LocalizationSetterSymbolConstants.SUPPORTED_LOCALES
 symbol.
getSupportedLocales in interface LocalizationSetterpublic boolean isSupportedLocaleName(String localeName)
LocalizationSetter
isSupportedLocaleName in interface LocalizationSetterpublic SelectModel getSupportedLocalesModel()
LocalizationSetterLocale.getDisplayName(Locale) (in that locale).
getSupportedLocalesModel in interface LocalizationSetter| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||