Package java.util

Examples of java.util.Locale


    ActionWithLocale action = new ActionWithLocale();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    Locale locale = Locale.getDefault();
   
    HttpServletRequest request = createMock(HttpServletRequest.class);
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
   
    replay(request);
View Full Code Here


  @Test
  public void testResolveLocale()
  {
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    StrecksLocaleResolver resolver = new StrecksLocaleResolver();
    Locale locale = Locale.getDefault();
   
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
    replay(request);
    assert locale == resolver.resolveLocale(request);
   
View Full Code Here

  /**
   * Returns the list of available categories in furniture library in the given language.
   */
  public List<FurnitureCategory> getDefaultCategories(String language) {
    Locale locale;
    int underscoreIndex = language.indexOf('_');
    if (underscoreIndex != -1) {
      locale = new Locale(language.substring(0, underscoreIndex), language.substring(underscoreIndex + 1));
    } else {
      locale = new Locale(language.length() == 0
          ? this.preferences.getFurnitureDefaultLanguage()
          : language);
    }
    ResourceBundle resource = ResourceBundle.getBundle(
        "com.eteks.furniturelibraryeditor.viewcontroller.DefaultCategories", locale);
View Full Code Here

                  }



         case 2 : String country = ch.getCountry();
                  Locale locale = new Locale(Locale.getDefault().getLanguage(), country);
                  return locale.getDisplayCountry();
         case 3 : return ch.getTimeZone().getDisplayName();
         default: return ch;
       }
     }
View Full Code Here

    mCountryCB.removeAllItems();
    mCountryCB.addItem(new FilterItem(mLocalizer.msg("allCountries",
        "All Countries"), null));
    ArrayList<FilterItem> items = new ArrayList<FilterItem>(countries.size());
    for (String country : countries) {
      Locale locale = new Locale(Locale.getDefault().getLanguage(), country);
      items.add(new FilterItem(locale.getDisplayCountry(), country));
    }
    Collections.sort(items);

    String defaultCountry = Settings.propSelectedChannelCountry.getString();
    for (FilterItem item : items) {
View Full Code Here

        String line = null;
        try {
            FTPFileFactory ff = new FTPFileFactory(parser);
            if (locale != null) {
                System.out.println("Setting locale to " + locale);
                Locale l = new Locale(locale);
                Locale[] locales = new Locale[2];
                locales[0] = l;
                locales[1] = Locale.ENGLISH;
                ff.setLocales(locales);
            }
View Full Code Here

    if (item instanceof Channel) {
      Channel channel = (Channel) item;

      StringBuilder buf = new StringBuilder();

      Locale loc = new Locale(Locale.getDefault().getLanguage(), channel.getCountry());
      buf.append("<html>");
      buf.append("<b>").append(Localizer.getLocalization(Localizer.I18N_CHANNEL)).append(" :</b> ").append(channel.getName()).append("<br>");
      if (!TVBrowser.isStable()) {
        buf.append("<b>ID (dev. only) :</b> ").append(channel.getUniqueId())
            .append("<br>");
      }
      buf.append("<b>").append(mLocalizer.msg("country", "Country")).append(" :</b> ").append(loc.getDisplayCountry()).append("<br>");
      buf.append("<b>").append(mLocalizer.msg("timezone", "Timezone")).append(" :</b> ").append(channel.getTimeZone().getDisplayName()).append("<br>");
      buf.append("<b>").append(mLocalizer.msg("category", "Category")).append(" :</b> ").append(ChannelUtil.getNameForCategories(channel.getCategories())).append("<br><br>");
      buf.append(mLocalizer.msg("provided", "provided by")).append("<br><center>").append(ChannelUtil.getProviderName(channel)).append("</center>");
      buf.append("</html>");
      return buf.toString();
View Full Code Here

    mMenuBar.updateFiltersMenu();
  }

  public void showHelpDialog() {

    Locale locale = Locale.getDefault();
    String language = locale.getLanguage();

    java.io.File indexFile = new java.io.File("help/" + language
        + "/index.html");
    if (!indexFile.exists()) {
      indexFile = new java.io.File("help/default/index.html");
View Full Code Here

    Calendar calendar;
    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();
    // If current time requested get the system instance
    if (current) {
      calendar = Calendar.getInstance(tz, locale);
    } else {
      calendar = new GregorianCalendar(tz, locale);
View Full Code Here

        CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    UserPrefererences prefs = userObject.getUserPref();
    TimeZone tz = TimeZone.getTimeZone(prefs.getTimeZone());
    Locale locale = request.getLocale();
   
    PopulateForm populateForm = new PopulateForm();
    // set the form elements
    populateForm.setForm(request, form);
    // set form with respect to new opening page
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.