Package java.util

Examples of java.util.Locale


       * 4 preconfig locales: English, France, Arabic, Vietnamese
      **/
      Collection<LocaleConfig> locales = service_.getLocalConfigs();
      assertTrue(locales.size() == 4);

      Locale vnlocale = service_.getLocaleConfig("vi").getLocale();
      assertContains(locales, vnlocale);
      assertContains(locales, Locale.ENGLISH);
      assertContains(locales, Locale.FRENCH);
   }
View Full Code Here


    // by default, set isSelected equal to false.
    // This ensures no null pointer if something
    // goes wrong or isSelected is not set explicitly.
    this.isSelected = false;
    this.resourceKey = "";
    locale = new Locale("en");
  }
View Full Code Here

      try
      {
         Collection<LocaleConfig> localeConfigs = localeService_.getLocalConfigs();
         // String defaultLang =
         // localeService_.getDefaultLocaleConfig().getLanguage();
         Locale defaultLocale = localeService_.getDefaultLocaleConfig().getLocale();

         for (Iterator<LocaleConfig> iter = localeConfigs.iterator(); iter.hasNext();)
         {
            LocaleConfig localeConfig = iter.next();
            // String language = localeConfig.getLanguage();
            // String content = getResourceBundleContent(name, language,
            // defaultLang, cl);
            Locale locale = localeConfig.getLocale();
            String language = locale.getLanguage();
            String country = locale.getCountry();

            String content = getResourceBundleContent(name, locale, defaultLocale, cl);
            if (content != null)
            {
               // save the content
View Full Code Here

      if (locale_ == null)
      {
         String[] localeParams = localeName.split("_");
         if (localeParams.length > 1)
         {
            locale_ = new Locale(localeParams[0], localeParams[1]);
         }else{
            locale_ = new Locale(localeName);
         }
      }
   }
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws RuntimeException, Exception {
    HttpSession session = request.getSession(true);
    UserObject user = (UserObject)session.getAttribute("userobject");
    UserPrefererences prefs = user.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(prefs.getTimeZone());
    Locale locale = request.getLocale();
   
    String forward = ".view.calendar.datetime";
    // "dateTimeSelectForm" in mappings/calendar.xml
    DynaActionForm dateForm = (DynaActionForm) form;
    try {
View Full Code Here

            // however, could cache the last few instances
            SimpleDateFormat df;
            if (locale == null) {
                df = new SimpleDateFormat(format);
            } else {
                Locale l = new Locale(locale);
                df = new SimpleDateFormat(format, l);
            }
            if (timeZone != null) {
                df.setTimeZone(TimeZone.getTimeZone(timeZone));
            }
View Full Code Here

   *
   * @return The icon.
   */
  public Icon getSmallIcon()
  {
    final Locale locale = getContext().getLocale();
    return getIconTheme().getSmallIcon(locale, "action.back.small-icon"); //$NON-NLS-1$
  }
View Full Code Here

   *
   * @return The icon.
   */
  public Icon getLargeIcon()
  {
    final Locale locale = getContext().getLocale();
    return getIconTheme().getLargeIcon(locale, "action.back.icon"); //$NON-NLS-1$
  }
View Full Code Here

   *
   * @return The icon.
   */
  public Icon getSmallIcon()
  {
    final Locale locale = getContext().getLocale();
    return getIconTheme().getSmallIcon(locale, "action.about.small-icon"); //$NON-NLS-1$
  }
View Full Code Here

   *
   * @return The icon.
   */
  public Icon getLargeIcon()
  {
    final Locale locale = getContext().getLocale();
    return getIconTheme().getLargeIcon(locale, "action.about.icon"); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of java.util.Locale

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.