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);
}
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);
}
Aggregations