ItEr27S11AltaEtiquetasTipoEtiquetaItEr26S13: Added order by name to list Labels
This commit is contained in:
parent
8711780c22
commit
ea1431c141
4 changed files with 10 additions and 10 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package org.navalplanner.web.labels;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.labels.entities.Label;
|
||||
|
|
@ -55,7 +54,7 @@ public interface ILabelTypeModel {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
Set<Label> getLabels();
|
||||
List<Label> getLabels();
|
||||
|
||||
/**
|
||||
* Add {@link Label} to {@link LabelType}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package org.navalplanner.web.labels;
|
|||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.validator.InvalidValue;
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
|
|
@ -98,7 +97,7 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
return labelTypeModel.getLabelType();
|
||||
}
|
||||
|
||||
public Set<Label> getLabels() {
|
||||
public List<Label> getLabels() {
|
||||
return labelTypeModel.getLabels();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ import static org.navalplanner.web.I18nHelper._;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.hibernate.validator.ClassValidator;
|
||||
|
|
@ -199,9 +197,13 @@ public class LabelTypeModel implements ILabelTypeModel {
|
|||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Set<Label> getLabels() {
|
||||
return (labelType != null) ? labelType.getLabels()
|
||||
: new HashSet<Label>();
|
||||
public List<Label> getLabels() {
|
||||
// Safe copy
|
||||
List<Label> labels = new ArrayList<Label>();
|
||||
if (labelType != null) {
|
||||
labels.addAll(labelType.getLabels());
|
||||
}
|
||||
return labels;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<grid id="gridLabels" height="320px"
|
||||
model="@{controller.labels}">
|
||||
<columns sizable="true">
|
||||
<column label="${i18n:_('Name')}" />
|
||||
<column label="${i18n:_('Name')}" sort="auto(name)" />
|
||||
<column label="${i18n:_('Operations')}" />
|
||||
</columns>
|
||||
<rows>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue