Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 70600288 by Tony CHEMIT at 2017-08-19T12:33:14+02:00 Améliorer le tri des types (See #853) - - - - - 1 changed file: - client/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java Changes: ===================================== client/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java +++ b/client/src/main/java/fr/ird/observe/client/ui/tree/selection/nodes/ReferentialsSelectionTreeNode.java @@ -24,9 +24,12 @@ package fr.ird.observe.client.ui.tree.selection.nodes; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import fr.ird.observe.client.ObserveSwingApplicationContext; +import fr.ird.observe.services.decoration.ObserveI18nDecoratorHelper; import fr.ird.observe.services.dto.referential.ReferentialDto; import java.util.Iterator; import org.apache.commons.collections4.EnumerationUtils; +import org.jetbrains.annotations.NotNull; import static org.nuiton.i18n.I18n.t; @@ -41,7 +44,7 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri public static ReferentialsSelectionTreeNode of(String name, ImmutableSet<Class<? extends ReferentialDto>> types) { ReferentialsSelectionTreeNode result = new ReferentialsSelectionTreeNode(t(name)); - for (Class<? extends ReferentialDto> aClass : types) { + for (Class<? extends ReferentialDto> aClass : ObserveI18nDecoratorHelper.sortPluralTypes(types, ObserveSwingApplicationContext.get().getConfig().getLocale())) { ReferentialSelectionTreeNode child = new ReferentialSelectionTreeNode<>(aClass); result.add(child); } @@ -56,7 +59,7 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri } } - public ReferentialsSelectionTreeNode(String name) { + private ReferentialsSelectionTreeNode(String name) { super(name, true); } @@ -80,8 +83,10 @@ public class ReferentialsSelectionTreeNode extends SelectionTreeNodeSupport<Stri return null; } + @NotNull @Override public Iterator<ReferentialSelectionTreeNode<?>> iterator() { + //noinspection unchecked return (Iterator) EnumerationUtils.toList(children()).iterator(); } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7060028863b8a3929a3664780082... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7060028863b8a3929a3664780082... You're receiving this email because of your account on gitlab.com.