Package com.vaadin.server
Class LocaleService
- java.lang.Object
-
- com.vaadin.server.LocaleService
-
- All Implemented Interfaces:
java.io.Serializable
public class LocaleService extends java.lang.Object implements java.io.SerializableServer side service which handles locale and the transmission of locale date to the client side LocaleService.- Since:
- 7.1
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocaleService(UI ui, com.vaadin.shared.ui.ui.UIState.LocaleServiceState state)Creates a LocaleService bound to the given UI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocale(java.util.Locale locale)Adds a locale to be sent to the client (browser) for date and time entry etc.protected com.vaadin.shared.ui.ui.UIState.LocaleDatacreateLocaleData(java.util.Locale locale)Creates a LocaleData instance for transportation to the client.UIgetUI()Retrieves the UI this service is bound to.
-
-
-
Constructor Detail
-
LocaleService
public LocaleService(UI ui, com.vaadin.shared.ui.ui.UIState.LocaleServiceState state)
Creates a LocaleService bound to the given UI.- Parameters:
ui- The UI which owns the LocaleService- Since:
- 7.1
-
-
Method Detail
-
getUI
public UI getUI()
Retrieves the UI this service is bound to.- Returns:
- the UI for this service
- Since:
- 7.1
-
addLocale
public void addLocale(java.util.Locale locale)
Adds a locale to be sent to the client (browser) for date and time entry etc. All locale specific information is derived from server-sideLocaleinstances and sent to the client when needed, eliminating the need to use theLocaleclass and all the framework behind it on the client.- Parameters:
locale- The locale which is required on the client side
-
createLocaleData
protected com.vaadin.shared.ui.ui.UIState.LocaleData createLocaleData(java.util.Locale locale)
Creates a LocaleData instance for transportation to the client.- Parameters:
locale- The locale for which to create a LocaleData object- Returns:
- A LocaleData object with information about the given locale
- Since:
- 7.1
-
-