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:
parent
5ab2406ab2
commit
55331b3067
|
@ -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);
|
||||
|
@ -348,7 +355,7 @@ public class CreateDatasetForm extends Composite{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
public void onFailure(Throwable caught){
|
||||
|
||||
setAlertBlock("Error while retrieving licenses, try to refresh the page", AlertType.ERROR, true);
|
||||
|
||||
|
@ -961,4 +968,4 @@ public class CreateDatasetForm extends Composite{
|
|||
tagsPanel.clear();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue