List of usage examples for java.util TimeZone getAvailableIDs
public static synchronized String[] getAvailableIDs()
From source file:org.webguitoolkit.ui.controls.util.TextService.java
/** * fill given Select with available timezones if loaded as AssociationModel no extra processing logic is needed in persist() * to mark the timezone-containing object as changed *///from w w w.ja va2 s .c om public void loadTimeZonesAsAssociationModel(ISelect tzSelect) { String[] timezoneArray = TimeZone.getAvailableIDs(); List tzList = new ArrayList(); for (int i = 0; i <= timezoneArray.length - 1; i++) { tzList.add(TimeZone.getTimeZone(timezoneArray[i])); } AssociationSelectModel sModel = new AssociationSelectModel("ID", "ID", true); tzSelect.setModel(sModel); sModel.setOptions(tzList); tzSelect.loadList(); }
From source file:org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.java
public void createControlSource(final Composite parent) { final Group group = new Group(parent, SWT.NONE); group.setText(Messages/* w w w .java 2s. c om*/ .getString("org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.5")); //$NON-NLS-1$ final GridData groupData = new GridData(SWT.FILL, SWT.FILL, true, false); group.setLayoutData(groupData); final GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3; group.setLayout(gridLayout); /* file selection */ final Label labelFilePath = new Label(group, SWT.READ_ONLY); labelFilePath.setText(Messages .getString("org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.6")); //$NON-NLS-1$ m_textFileSource = new Text(group, SWT.READ_ONLY | SWT.BORDER); m_textFileSource.setText(DEFAUL_FILE_LABEL); m_textFileSource.addFocusListener(this); final GridData textData = new GridData(SWT.FILL, SWT.FILL, true, false); m_textFileSource.setLayoutData(textData); /* Choose file button */ final Button chooseFileButton = new Button(group, SWT.PUSH); chooseFileButton.setText(Messages .getString("org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.7")); //$NON-NLS-1$ final GridData chooseFileButtonGridData = new GridData(); chooseFileButtonGridData.horizontalAlignment = GridData.END; chooseFileButton.setLayoutData(chooseFileButtonGridData); chooseFileButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { m_sourceFile = chooseFile(m_sourceFile); if (m_sourceFile != null) { m_textFileSource.setText(m_sourceFile.getPath()); validate(); } } }); final Label formatLabel = new Label(group, SWT.NONE); formatLabel.setText(Messages .getString("org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.10")); //$NON-NLS-1$ m_formatCombo = new ComboViewer(group, SWT.READ_ONLY | SWT.DROP_DOWN); final GridData formatData = new GridData(SWT.FILL, SWT.FILL, true, false); m_formatCombo.getControl().setLayoutData(formatData); m_formatCombo.add(m_adapter); m_formatCombo.setContentProvider(new ArrayContentProvider()); m_formatCombo.setLabelProvider(new ILabelProvider() { @Override public Image getImage(final Object element) { return null; } @Override public String getText(final Object element) { return element.toString(); } @Override public void addListener(final ILabelProviderListener listener) { // nothing as labelprovider will not change } @Override public void dispose() { // nothing as labelprovider will not change } @Override public boolean isLabelProperty(final Object element, final String property) { return true; } @Override public void removeListener(final ILabelProviderListener listener) { // nothing } }); m_formatCombo.setInput(m_adapter); m_formatCombo.addSelectionChangedListener(this); if (m_adapter.length > 0) m_formatCombo.setSelection(new StructuredSelection(m_adapter[0])); // just a placeholder new Label(group, SWT.NONE); /* time zone selection */ final Label timezoneLabel = new Label(group, SWT.NONE); timezoneLabel.setText(Messages .getString("org.kalypso.ui.wizards.imports.observation.ImportObservationSelectionWizardPage.0")); //$NON-NLS-1$ final String[] tz = TimeZone.getAvailableIDs(); Arrays.sort(tz); final ComboViewer comboTimeZones = new ComboViewer(group, SWT.BORDER | SWT.SINGLE); comboTimeZones.getControl().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); m_timezone = KalypsoCorePlugin.getDefault().getTimeZone(); comboTimeZones.setContentProvider(new ArrayContentProvider()); comboTimeZones.setLabelProvider(new LabelProvider()); comboTimeZones.setInput(tz); comboTimeZones.addFilter(new TimezoneEtcFilter()); comboTimeZones.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(final SelectionChangedEvent event) { final IStructuredSelection selection = (IStructuredSelection) comboTimeZones.getSelection(); updateTimeZone((String) selection.getFirstElement()); } }); comboTimeZones.getCombo().addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { updateTimeZone(comboTimeZones.getCombo().getText()); } }); if (m_timezone != null) { final String id = m_timezone.getID(); if (ArrayUtils.contains(tz, id)) comboTimeZones.setSelection(new StructuredSelection(id)); else comboTimeZones.getCombo().setText(id); } // just a placeholder new Label(group, SWT.NONE); }
From source file:org.anodyneos.jse.cron.CronDaemon.java
protected TimeZone getTimeZone(String tzs) throws JseException { String[] allTZ = TimeZone.getAvailableIDs(); TimeZone tz = null;// w w w . j a v a 2s . c om for (int i = 0; i < allTZ.length; i++) { if (allTZ[i].equals(tzs)) { tz = TimeZone.getTimeZone(tzs); break; } } if (null == tz) { throw new JseException("TimeZone not available: " + tzs); } return tz; }
From source file:com.haulmont.cuba.gui.app.security.user.edit.UserEditor.java
protected void createTimeZoneField() { FieldGroup.FieldConfig timeZoneFc = fieldGroupRight.getFieldNN("timeZone"); HBoxLayout hbox = factory.createComponent(HBoxLayout.class); hbox.setSpacing(true);/* w ww. j av a2 s .c om*/ timeZoneLookup = factory.createComponent(LookupField.class); timeZoneLookup.setDatasource(timeZoneFc.getTargetDatasource(), timeZoneFc.getProperty()); timeZoneLookup.setRequired(false); MetaClass userMetaClass = userDs.getMetaClass(); timeZoneLookup.setEditable(fieldGroupRight.isEditable() && security.isEntityAttrUpdatePermitted(userMetaClass, timeZoneFc.getProperty())); Map<String, Object> options = new TreeMap<>(); for (String id : TimeZone.getAvailableIDs()) { TimeZone timeZone = TimeZone.getTimeZone(id); options.put(timeZones.getDisplayNameLong(timeZone), id); } timeZoneLookup.setOptionsMap(options); hbox.add(timeZoneLookup); CheckBox autoDetectField = factory.createComponent(CheckBox.class); autoDetectField.setDatasource(timeZoneFc.getTargetDatasource(), "timeZoneAuto"); autoDetectField.setCaption(messages.getMainMessage("timeZone.auto")); autoDetectField.setDescription(messages.getMainMessage("timeZone.auto.descr")); autoDetectField.setAlignment(Alignment.MIDDLE_RIGHT); autoDetectField.setEditable(fieldGroupRight.isEditable() && security.isEntityAttrUpdatePermitted(userMetaClass, "timeZoneAuto")); hbox.add(autoDetectField); hbox.expand(timeZoneLookup); timeZoneFc.setComponent(hbox); }
From source file:net.antidot.sql.model.core.SQLConnector.java
/** * Return corresponding xsd timezone syntax from a given MySQL format. * References : MySQL format ://from w w w . j ava2s. c o m * http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html XSD syntax * : http://www.schemacentral.com/sc/xsd/t-xsd_dateTime.html * * @param format * @return */ public static String getTimeZoneFromMySQLFormat(String format) { String result = null; if (format.equals("SYSTEM")) { // Use timezone system result = timeZoneToStr(TimeZone.getDefault()); } else if (format.indexOf(":") != -1) { // The value is given as a string indicating an offset from UTC // Complex problem : how determine time zome from its offset ? // But this MySQL format is already in xsd:date format if (format.equals("+00:00") || format.equals("-00:00")) result = "Z"; else result = format; } else { String[] IDs = TimeZone.getAvailableIDs(); for (String ID : IDs) { if (ID.equals(format)) { result = timeZoneToStr(TimeZone.getTimeZone(format)); break; } } } return result; }
From source file:com.funambol.LDAP.admin.LDAPSyncSourceConfigPanel.java
/** * Create the panel//from www . ja v a 2 s .com * @throws Exception if error occures during creation of the panel */ private void init() { // set layout this.setLayout(null); int startX = 14; int fontHeight = 18; int col1Size = 150; int col2X = startX + col1Size + 6; //170px int col2Size = 350; int col3X = col2X + col2Size + 6; // 550 int col3Size = 90; int chkboxSize = 18; // set properties of label, position and border // referred to the title of the panel titledBorder1 = new TitledBorder(""); panelName.setFont(titlePanelFont); panelName.setText("Edit LDAP SyncSourceContacts"); panelName.setBounds(new Rectangle(startX, 5, 316, 28)); panelName.setAlignmentX(SwingConstants.CENTER); panelName.setBorder(titledBorder1); int baseline = 60; sourceUriLabel.setText("Source URI: "); sourceUriLabel.setToolTipText("Choose a unique word"); sourceUriLabel.setFont(defaultFont); sourceUriLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); sourceUriValue.setFont(FONT_ARIAL); sourceUriValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; nameLabel.setText("Name: "); nameLabel.setToolTipText("Choose a word and set this into your client in order to use this connector"); nameLabel.setFont(defaultFont); nameLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); nameValue.setFont(FONT_ARIAL); nameValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; typeLabel.setText("Type: "); typeLabel.setToolTipText("Only VCARD are supported, SIF is deprecated"); typeLabel.setFont(defaultFont); typeLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); typeValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; providerUrlLabel.setText("LDAP URI: "); providerUrlLabel.setToolTipText("eg. ldap://ldap.example.com , ldaps://ldap.example.com:390 "); providerUrlLabel.setFont(defaultFont); providerUrlLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); providerUrlValue.setFont(FONT_ARIAL); providerUrlValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; ldapBaseLabel.setText("LDAP Base DN: "); ldapBaseLabel.setToolTipText( "This is used to define where to store/read user's data.\nRead install.txt notes to use parameters"); ldapBaseLabel.setFont(defaultFont); ldapBaseLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); ldapBaseValue.setFont(FONT_ARIAL); ldapBaseValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; // TODO contactDaoLabel, entryFilterLabel daoNameLabel.setText("DAO Class for converting item to LDAP"); daoNameLabel.setToolTipText("piTypePerson, inetOrgPerson or organizationalPerson"); daoNameLabel.setFont(defaultFont); daoNameLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); daoNameValue.setFont(FONT_ARIAL); daoNameValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; entryFilterLabel.setText("Filter user by"); entryFilterLabel .setToolTipText("A valid LDAP search filter, eg: (&(objectclass=inetOrgPerson)(active=1))"); entryFilterLabel.setFont(defaultFont); entryFilterLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); entryFilterValue.setFont(FONT_ARIAL); entryFilterValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; ldapUserLabel.setText("LDAP User: "); ldapUserLabel.setToolTipText("LDAP Bind DN (username) to access the LDAP server"); ldapUserLabel.setFont(defaultFont); ldapUserLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); ldapUserValue.setFont(FONT_ARIAL); ldapUserValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; ldapPassLabel.setText("LDAP Password: "); ldapPassLabel.setToolTipText("LDAP Bind DN password to access LDAP server"); ldapPassLabel.setFont(defaultFont); ldapPassLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); ldapPassValue.setFont(FONT_ARIAL); ldapPassValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); // follow referral followReferralLabel.setText("Follow Referral "); followReferralLabel.setToolTipText("Select this checkbox if you want ldap to follow smart-referrals"); followReferralLabel.setFont(defaultFont); followReferralLabel.setBounds(new Rectangle(col3X, 270, col3Size, fontHeight)); followReferralValue.setSelected(false); followReferralValue.setBounds(new Rectangle(col3X, 300, col3Size, fontHeight)); // connection pooling connectionPoolingLabel.setText("Pooling "); connectionPoolingLabel.setToolTipText("Select this checkbox if you want use connection pooling"); connectionPoolingLabel.setFont(defaultFont); connectionPoolingLabel.setBounds(new Rectangle(col3X + col3Size, 270, col3Size, fontHeight)); connectionPoolingValue.setSelected(false); connectionPoolingValue.setBounds(new Rectangle(col3X + col3Size, 300, col3Size, fontHeight)); baseline += 30; dbNameLabel.setText("Funambol DBMS Name: "); dbNameLabel.setToolTipText("Funambol DS table to store metadata. Use fnblcore"); dbNameLabel.setFont(defaultFont); dbNameLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); dbNameValue.setFont(FONT_ARIAL); dbNameValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); baseline += 30; timeZoneLabel.setFont(defaultFont); timeZoneLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); timeZoneValue = new JComboBox(TimeZone.getAvailableIDs()); timeZoneValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); // rpolli baseline += 30; ldapServerLabel.setText("LDAP Server Type"); ldapServerLabel.setFont(defaultFont); ldapServerLabel.setBounds(new Rectangle(startX, baseline, col1Size, fontHeight)); ldapServerValue.setBounds(new Rectangle(col2X, baseline, col2Size, fontHeight)); ldapServerValue.setToolTipText("Select compatibility unique ID's per items."); confirmButton.setFont(defaultFont); confirmButton.setText("Add"); confirmButton.setBounds(col2X, 420, 70, 25); confirmButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { try { validateValues(); getValues(); if (getState() == STATE_INSERT) { LDAPSyncSourceConfigPanel.this.actionPerformed(new ActionEvent( LDAPSyncSourceConfigPanel.this, ACTION_EVENT_INSERT, event.getActionCommand())); } else { LDAPSyncSourceConfigPanel.this.actionPerformed(new ActionEvent( LDAPSyncSourceConfigPanel.this, ACTION_EVENT_UPDATE, event.getActionCommand())); } } catch (Exception e) { e.printStackTrace(); notifyError(new AdminException(e.getMessage())); } } }); // add all components to the panel this.add(panelName, null); this.add(nameLabel, null); this.add(nameValue, null); this.add(typeLabel, null); this.add(typeValue, null); this.add(sourceUriLabel, null); this.add(sourceUriValue, null); //rpolli this.add(ldapServerLabel, null); this.add(ldapServerValue, null); this.add(this.daoNameLabel, null); this.add(this.daoNameValue, null); this.add(followReferralLabel, null); this.add(followReferralValue, null); this.add(connectionPoolingLabel, null); this.add(connectionPoolingValue, null); this.add(providerUrlLabel, null); this.add(providerUrlValue, null); // this.add(ldapPortLabel , null); // this.add(ldapPortValue , null); // this.add(isSSLLabel , null); // this.add(isSSLValue , null); this.add(ldapBaseLabel, null); this.add(ldapBaseValue, null); this.add(entryFilterLabel, null); this.add(entryFilterValue, null); this.add(ldapUserLabel, null); this.add(ldapUserValue, null); this.add(ldapPassLabel, null); this.add(ldapPassValue, null); this.add(timeZoneLabel, null); this.add(timeZoneValue, null); this.add(dbNameLabel, null); this.add(dbNameValue, null); this.add(confirmButton, null); }
From source file:org.tightblog.ui.restapi.WeblogController.java
@GetMapping(value = "/tb-ui/authoring/rest/weblogconfig/metadata") public WeblogConfigMetadata getWeblogConfigMetadata(Locale locale, Principal p) { User user = userRepository.findEnabledByUserName(p.getName()); WeblogConfigMetadata metadata = new WeblogConfigMetadata(); metadata.absoluteSiteURL = dp.getAbsoluteUrl(); metadata.usersOverrideAnalyticsCode = webloggerPropertiesRepository.findOrNull() .isUsersOverrideAnalyticsCode(); metadata.usersCommentNotifications = webloggerPropertiesRepository.findOrNull() .isUsersCommentNotifications(); metadata.sharedThemeMap = themeManager.getEnabledSharedThemesList().stream() // Remove sitewide theme options for non-admins, if desired admin can create a sitewide blog // and assign a non-admin user ownership of it on the members page. .filter(theme -> !theme.isSiteWide() || user.hasEffectiveGlobalRole(GlobalRole.ADMIN)) .collect(Utilities.toLinkedHashMap(SharedTheme::getId, st -> st)); metadata.editFormats = Arrays.stream(Weblog.EditFormat.values()).collect(Utilities.toLinkedHashMap( Weblog.EditFormat::name, eF -> messages.getMessage(eF.getDescriptionKey(), null, locale))); metadata.locales = Arrays.stream(Locale.getAvailableLocales()) .sorted(Comparator.comparing(Locale::getDisplayName)) .collect(Utilities.toLinkedHashMap(Locale::toString, Locale::getDisplayName)); metadata.timezones = Arrays.stream(TimeZone.getAvailableIDs()).sorted(Comparator.comparing(tz -> tz)) .collect(Utilities.toLinkedHashMap(tz -> tz, tz -> tz)); WebloggerProperties.CommentPolicy globalCommentPolicy = webloggerPropertiesRepository.findOrNull() .getCommentPolicy();//from w w w . j av a2 s .co m metadata.commentOptions = Arrays.stream(WebloggerProperties.CommentPolicy.values()) .filter(co -> co.getLevel() <= globalCommentPolicy.getLevel()) .collect(Utilities.toLinkedHashMap(WebloggerProperties.CommentPolicy::name, co -> messages.getMessage(co.getWeblogDescription(), null, locale))); metadata.commentDayOptions = Arrays.stream(WeblogEntry.CommentDayOption.values()) .collect(Utilities.toLinkedHashMap(cdo -> Integer.toString(cdo.getDays()), cdo -> messages.getMessage(cdo.getDescriptionKey(), null, locale))); return metadata; }
From source file:org.sakaiproject.user.tool.UserPrefsTool.java
/** * @return Returns the prefTimeZones./*from ww w . j av a 2 s . c om*/ */ public List getPrefTimeZones() { if (prefTimeZones.size() == 0) { String[] timeZoneArray = TimeZone.getAvailableIDs(); Arrays.sort(timeZoneArray); for (int i = 0; i < timeZoneArray.length; i++) prefTimeZones.add(new SelectItem(timeZoneArray[i], timeZoneArray[i])); } return prefTimeZones; }
From source file:ch.cyberduck.ui.cocoa.BookmarkController.java
public void setTimezonePopup(NSPopUpButton timezonePopup) { this.timezonePopup = timezonePopup; this.timezonePopup.setTarget(this.id()); this.timezonePopup.setAction(Foundation.selector("timezonePopupClicked:")); this.timezonePopup.removeAllItems(); final List<String> timezones = Arrays.asList(TimeZone.getAvailableIDs()); this.timezonePopup.addItemWithTitle(UTC.getID()); this.timezonePopup.lastItem().setRepresentedObject(UTC.getID()); this.timezonePopup.menu().addItem(NSMenuItem.separatorItem()); Collections.sort(timezones, new Comparator<String>() { @Override//from w w w. j av a 2s. co m public int compare(String o1, String o2) { return TimeZone.getTimeZone(o1).getID().compareTo(TimeZone.getTimeZone(o2).getID()); } }); for (String tz : timezones) { if (tz.matches(TIMEZONE_CONTINENT_PREFIXES)) { this.timezonePopup.addItemWithTitle(String.format("%s", tz)); this.timezonePopup.lastItem().setRepresentedObject(tz); } } }
From source file:nl.strohalm.cyclos.controls.settings.EditLocalSettingsAction.java
@Override protected void prepareForm(final ActionContext context) throws Exception { final HttpServletRequest request = context.getRequest(); final EditLocalSettingsForm form = context.getForm(); final LocalSettings settings = settingsService.getLocalSettings(); form.setSetting("enableSms", StringUtils.isNotEmpty(settings.getSendSmsWebServiceUrl()) || StringUtils.isNotEmpty(settings.getSmsChannelName())); final TransactionNumber transactionNumber = settings.getTransactionNumber(); form.setSetting("enableTransactionNumber", transactionNumber != null && transactionNumber.getPadLength() > 0); getDataBinder().writeAsString(form.getSetting(), settings); RequestHelper.storeEnum(request, LocalSettings.Language.class, "languages"); RequestHelper.storeEnum(request, FileUnits.class, "uploadUnits"); RequestHelper.storeEnum(request, LocalSettings.NumberLocale.class, "numberLocales"); RequestHelper.storeEnum(request, LocalSettings.Precision.class, "precisions"); RequestHelper.storeEnum(request, LocalSettings.DecimalInputMethod.class, "decimalInputMethods"); final Map<DatePattern, String> datePatterns = new LinkedHashMap<DatePattern, String>(); for (final DatePattern datePattern : DatePattern.values()) { datePatterns.put(datePattern, messageHelper.getDatePatternDescription(datePattern).toUpperCase()); }/*ww w . ja v a 2 s .c om*/ request.setAttribute("datePatterns", datePatterns); RequestHelper.storeEnum(request, LocalSettings.TimePattern.class, "timePatterns"); RequestHelper.storeEnum(request, LocalSettings.CsvRecordSeparator.class, "csvRecordSeparators"); RequestHelper.storeEnum(request, LocalSettings.CsvValueSeparator.class, "csvValueSeparators"); RequestHelper.storeEnum(request, LocalSettings.CsvStringQuote.class, "csvStringQuotes"); RequestHelper.storeEnum(request, LocalSettings.MemberResultDisplay.class, "memberResultDisplays"); RequestHelper.storeEnum(request, LocalSettings.SortOrder.class, "memberSortOrders"); RequestHelper.storeEnum(request, TextFormat.class, "textFormats"); request.setAttribute("brokeringExpirationUnits", Arrays.asList(TimePeriod.Field.DAYS, TimePeriod.Field.MONTHS, TimePeriod.Field.YEARS)); request.setAttribute("deleteMessagesExpirationUnits", Arrays.asList(TimePeriod.Field.DAYS, TimePeriod.Field.MONTHS, TimePeriod.Field.YEARS)); request.setAttribute("maxChargebackTimeUnits", Arrays.asList(TimePeriod.Field.DAYS, TimePeriod.Field.WEEKS, TimePeriod.Field.MONTHS)); request.setAttribute("indexRebuildingTimeUnits", Arrays.asList(TimePeriod.Field.DAYS, TimePeriod.Field.WEEKS, TimePeriod.Field.MONTHS)); request.setAttribute("smsChannels", channelService.listNonBuiltin()); request.setAttribute("smsCustomFields", channelService.possibleCustomFieldsAsPrincipal()); // Transform the time zones in an final List<String> timeZones = new ArrayList<String>(); for (final String id : TimeZone.getAvailableIDs()) { if (!id.contains("/") || id.contains("Etc")) { continue; } timeZones.add(id); } Collections.sort(timeZones); timeZones.add(0, "GMT"); request.setAttribute("timeZones", timeZones); }