Class LocaleService

  • All Implemented Interfaces:
    java.io.Serializable

    public class LocaleService
    extends java.lang.Object
    implements java.io.Serializable
    Server 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
      void addLocale​(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.LocaleData createLocaleData​(java.util.Locale locale)
      Creates a LocaleData instance for transportation to the client.
      UI getUI()
      Retrieves the UI this service is bound to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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-side Locale instances and sent to the client when needed, eliminating the need to use the Locale class 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