Author: ndkhoiits
Date: 2010-08-24 23:58:46 -0400 (Tue, 24 Aug 2010)
New Revision: 3925
Modified:
portal/branches/branched-r3845/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
Log:
GTNPORTAL-977 Sort languages by alphabeticaly in Userprofile
Modified:
portal/branches/branched-r3845/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
---
portal/branches/branched-r3845/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-08-25
03:58:08 UTC (rev 3924)
+++
portal/branches/branched-r3845/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-08-25
03:58:46 UTC (rev 3925)
@@ -42,6 +42,8 @@
import org.exoplatform.webui.form.UIFormStringInput;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -190,6 +192,8 @@
}
lang.add(option);
}
+
+ Collections.sort(lang, new LanguagesComparator());
langSelectBox.setOptions(lang);
}
@@ -282,4 +286,12 @@
ResourceBundle res = service.getResourceBundle("locale.portal.webui",
locale);
return res;
}
+
+ private class LanguagesComparator implements Comparator<SelectItemOption>
+ {
+ public int compare(SelectItemOption item0, SelectItemOption item1)
+ {
+ return item0.getLabel().compareToIgnoreCase(item1.getLabel());
+ }
+ }
}
Show replies by date