Add custom comparator for Repos (sort them alphabetically)
Now they come out in a nice alphabetized list...
This commit is contained in:
parent
1468dfd6b6
commit
62dd8f35c0
@ -19,6 +19,8 @@ import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -51,6 +53,7 @@ public class RepoHelper {
|
||||
BuildFromCache();
|
||||
}
|
||||
|
||||
Collections.sort(repos, new CustomComparator());
|
||||
return repos;
|
||||
}
|
||||
|
||||
@ -205,6 +208,12 @@ public class RepoHelper {
|
||||
public void taskCompletionResult(String result);
|
||||
}
|
||||
|
||||
public class CustomComparator implements Comparator<Repo> {
|
||||
@Override
|
||||
public int compare(Repo o1, Repo o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user