public MainConfigBackingBean(EhourConfigStub config) { this.config = config; smtpAuthentication = StringUtils.isNotBlank(config.getSmtpUsername()) && StringUtils.isNotBlank(config.getSmtpPassword()); Calendar cal = new GregorianCalendar(); DateUtil.dayOfWeekFix(cal); cal.set(Calendar.DAY_OF_WEEK, config.getFirstDayOfWeek()); firstWeekStart = cal.getTime(); }
public List<Locale> getAvailableLanguages() { Locale[] locales = Locale.getAvailableLocales(); Map<String, Locale> localeMap = new HashMap<String, Locale>(); // remove all variants for (Locale locale : locales) { if (isTranslationsOnly() && !ArrayUtils.contains(config.getAvailableTranslations(), locale.getLanguage())) { continue; } if (localeMap.containsKey(locale.getLanguage()) && locale.getDisplayName().indexOf('(') != -1) { continue; } localeMap.put(locale.getLanguage(), locale); } SortedSet<Locale> localeSet = new TreeSet<Locale>(new LocaleComparator(LocaleComparator.CompareType.LANGUAGE)); for (Locale locale : localeMap.values()) { localeSet.add(locale); } return new ArrayList<Locale>(localeSet); }
/** @param firstWeekStart the firstWeekStart to set */ public void setFirstWeekStart(Date firstWeekStart) { this.firstWeekStart = firstWeekStart; Calendar cal = new GregorianCalendar(); cal.setTime(firstWeekStart); config.setFirstDayOfWeek(cal.get(Calendar.DAY_OF_WEEK)); }
public void setLocaleCountry(Locale localeCountry) { config.setLocaleFormatting(localeCountry); }
public Locale getLocaleCountry() { return config.getFormattingLocale(); }
/** @param localeLanguage the localeLanguage to set */ public void setLocaleLanguage(Locale localeLanguage) { config.setLocaleLanguage(localeLanguage); }
/** @return the localeLanguage */ public Locale getLocaleLanguage() { return config.getLanguageLocale(); }