public List<SettingsProperty> getSettings(String section) { List<SettingsProperty> settings = new ArrayList<SettingsProperty>(); List<GlobalProperty> globalProperties = getService().getAllGlobalProperties(); for (GlobalProperty globalProperty : globalProperties) { SettingsProperty property = new SettingsProperty(globalProperty); if (section.equals(property.getSection()) && !isHidden(property)) { settings.add(property); } } Collections.sort(settings); return settings; }
@ModelAttribute(SECTIONS) public List<String> getSections() { SortedSet<String> sortedSections = new TreeSet<String>(); List<GlobalProperty> globalProperties = getService().getAllGlobalProperties(); for (GlobalProperty globalProperty : globalProperties) { SettingsProperty property = new SettingsProperty(globalProperty); if (!isHidden(property)) { sortedSections.add(property.getSection()); } } List<String> sections = new ArrayList<String>(); if (sortedSections.remove(SettingsProperty.GENERAL)) { sections.add(SettingsProperty.GENERAL); } sections.addAll(sortedSections); return sections; }