Search in sources :

Example 1 with UserTimeZone

use of com.haulmont.cuba.security.app.UserTimeZone in project cuba by cuba-platform.

the class SettingsWindow method saveTimeZoneSettings.

protected void saveTimeZoneSettings() {
    UserTimeZone userTimeZone = new UserTimeZone(timeZoneLookup.getValue(), timeZoneAutoField.getValue());
    userManagementService.saveOwnTimeZone(userTimeZone);
}
Also used : UserTimeZone(com.haulmont.cuba.security.app.UserTimeZone)

Example 2 with UserTimeZone

use of com.haulmont.cuba.security.app.UserTimeZone in project cuba by cuba-platform.

the class SettingsWindow method initTimeZoneFields.

protected void initTimeZoneFields() {
    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);
    timeZoneAutoField.setCaption(messages.getMainMessage("timeZone.auto"));
    timeZoneAutoField.setDescription(messages.getMainMessage("timeZone.auto.descr"));
    timeZoneAutoField.addValueChangeListener(e -> timeZoneLookup.setEnabled(!Boolean.TRUE.equals(e.getValue())));
    UserTimeZone userTimeZone = userManagementService.loadOwnTimeZone();
    timeZoneLookup.setValue(userTimeZone.name);
    timeZoneAutoField.setValue(userTimeZone.auto);
}
Also used : UserTimeZone(com.haulmont.cuba.security.app.UserTimeZone) UserTimeZone(com.haulmont.cuba.security.app.UserTimeZone)

Aggregations

UserTimeZone (com.haulmont.cuba.security.app.UserTimeZone)2