Fixed license list sorting

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129490 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-06-28 10:05:23 +00:00
parent 5ab2406ab2
commit 55331b3067
1 changed files with 558 additions and 551 deletions

View File

@ -330,13 +330,20 @@ public class CreateDatasetForm extends Composite{
licenseBean = lBean;
// fill the listbox
for(String license: licenseBean.getLicenses()){
// sort the list
List<String> listOfNames = licenseBean.getLicenses();
Collections.sort(listOfNames);
licenseListbox.addItem(license);
// fill the listbox
for(int i = 0; i < listOfNames.size(); i++){
licenseListbox.addItem(listOfNames.get(i));
if(listOfNames.get(i).equals("Creative Commons Attribution"))
licenseListbox.setItemSelected(i, true);
}
// everything went ok
setAlertBlock("", AlertType.ERROR, false);
continueButton.setEnabled(true);