Use Resource.getCaptionFor() for showing list of resources selected

FEA: ItEr68OTS03XestionRecursosEstratexicosItEr67OTS03
This commit is contained in:
Diego Pino Garcia 2011-01-24 18:39:34 +01:00
parent 942beaf3a6
commit 30509aa3d1

View file

@ -185,11 +185,8 @@ public class NewAllocationSelectorController extends
private String buildSelectedAllocationsString() {
if (currentAllocationType == AllocationType.SPECIFIC) {
List<String> result = new ArrayList<String>();
for (Resource each : getSelectedResourcesOnListbox()) {
result.add(each.getShortDescription());
}
return StringUtils.join(result, ",");
List<Resource> resources = getSelectedResources();
return Resource.getCaptionFor(resources);
} else {
List<Criterion> criteria = getSelectedCriterions();
return currentAllocationType.asCaption(criteria);
@ -339,7 +336,7 @@ public class NewAllocationSelectorController extends
if (isGenericType()) {
return allResourcesShown();
} else {
return getSelectedResourcesOnListbox();
return getSelectedResources();
}
}
@ -354,7 +351,7 @@ public class NewAllocationSelectorController extends
}
@SuppressWarnings("unchecked")
private List<Resource> getSelectedResourcesOnListbox() {
private List<Resource> getSelectedResources() {
List<Resource> result = new ArrayList<Resource>();
Set<Listitem> selectedItems = listBoxResources.getSelectedItems();
for (Listitem item : selectedItems) {