use of com.haulmont.cuba.gui.config.MenuItem in project cuba by cuba-platform.
the class SettingsWindow method initDefaultScreenField.
protected void initDefaultScreenField() {
boolean screenSelectionEnabled = webConfig.getUserCanChooseDefaultScreen();
if (!screenSelectionEnabled) {
defaultScreenField.setEditable(false);
defaultScreenField.setDescription(getMessage("defaultScreenSelectionDisabled"));
}
Map<String, String> map = new LinkedHashMap<>();
for (MenuItem item : collectPermittedScreens(menuConfig.getRootItems())) {
map.put(menuConfig.getItemCaption(item.getId()), item.getScreen());
}
defaultScreenField.setOptionsMap(map);
String defaultScreen = userSettingService.loadSetting(ClientType.WEB, "userDefaultScreen");
if (StringUtils.isEmpty(defaultScreen) || !screenSelectionEnabled) {
defaultScreen = webConfig.getDefaultScreenId();
}
defaultScreenField.setValue(defaultScreen);
}