use of org.openforis.collect.designer.model.LabelledItem.LabelComparator in project collect by openforis.
the class SurveyLanguageVM method init.
@Init
public void init() {
languages = new ArrayList<LabelledItem>();
List<String> codes = Languages.getCodes(Standard.ISO_639_1);
for (String code : codes) {
LabelledItem item = new LabelledItem(code, Labels.getLabel(code));
languages.add(item);
}
Collections.sort(languages, new LabelComparator());
assignedLanguages = getSurveyAssignedLanguages();
}
use of org.openforis.collect.designer.model.LabelledItem.LabelComparator in project collect by openforis.
the class NewSurveyParametersPopUpVM method initLanguageModel.
private void initLanguageModel() {
List<LabelledItem> languages = new ArrayList<LabelledItem>();
List<String> codes = Languages.getCodes(Standard.ISO_639_1);
for (String code : codes) {
LabelledItem item = new LabelledItem(code, Labels.getLabel(code));
languages.add(item);
}
Collections.sort(languages, new LabelComparator());
languageModel = new BindingListModelListModel<LabelledItem>(new ListModelList<LabelledItem>(languages));
LabelledItem defaultLanguage = LabelledItem.getByCode(languages, Locale.ENGLISH.getLanguage());
form.put(LANGUAGE_FIELD_NAME, defaultLanguage);
}
Aggregations