Commit 46d36a37 authored by Dave Rowe's avatar Dave Rowe

Order by Display Name

Following suit with Users/Groups, Workgroups should order in alpha, shouldn't they?
parent dedb78d1
...@@ -995,26 +995,14 @@ public class WorkgroupManager implements Component { ...@@ -995,26 +995,14 @@ public class WorkgroupManager implements Component {
} }
/** /**
* Sorts all <code>Workgroups</code> by ID. * Sorts all <code>Workgroups</code> by Display Name.
*/ */
static Comparator<Workgroup> workgroupComparator = new Comparator<Workgroup>() { static Comparator<Workgroup> workgroupComparator = new Comparator<Workgroup>() {
public int compare(Workgroup item1, Workgroup item2) { public int compare(Workgroup item1, Workgroup item2) {
float int1 = item1.getID(); String str1 = item1.getDisplayName();
float int2 = item2.getID(); String str2 = item2.getDisplayName();
if (int1 == int2) { return str1.compareToIgnoreCase(str2);
return 0;
}
if (int1 > int2) {
return 1;
}
if (int1 < int2) {
return -1;
}
return 0;
} }
}; };
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment