Class Locales


  • public class Locales
    extends java.lang.Object
    Helper class for centrally managing different locales. This class provides the locales statically. Optionally, you can specify a Properties object from which this class determines which Locale to use. If the Locales are changed this is also recorded in the Properties object.
    • Constructor Summary

      Constructors 
      Constructor Description
      Locales()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Locale getGUILocale()
      Returns the locale applicable for the user interface.
      static java.util.Locale getOrderLocale()
      Returns the locale applicable for the unit orders.
      static void setGUILocale​(java.util.Locale l)
      Sets the locale for the user interface.
      static void setOrderLocale​(java.util.Locale l)
      Sets the locale for the unit orders.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Locales

        public Locales()
    • Method Detail

      • setGUILocale

        public static void setGUILocale​(java.util.Locale l)
        Sets the locale for the user interface. If Locales was initialized with a Properties object earlier, the new Locale is stored in it.
      • getGUILocale

        public static java.util.Locale getGUILocale()
                                             throws java.lang.IllegalStateException
        Returns the locale applicable for the user interface.
        Throws:
        java.lang.IllegalStateException
      • setOrderLocale

        public static void setOrderLocale​(java.util.Locale l)
        Sets the locale for the unit orders. If Locales was initialized with a Properties object earlier, the new Locale is stored in it.
      • getOrderLocale

        public static java.util.Locale getOrderLocale()
                                               throws java.lang.IllegalStateException
        Returns the locale applicable for the unit orders. Defaults to {Locale.GERMAN} when {#setOrderLocale} has not been invoked before.
        Throws:
        java.lang.IllegalStateException