diff options
| author | Jonathan Bauer | 2014-12-05 15:22:08 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2014-12-05 15:22:08 +0100 |
| commit | 129ab652a10211cb825eb2afdc87ff3ab8d36c54 (patch) | |
| tree | 9a0506fc3159fe7160eacac3be62438fac55d5d5 /dozentenmodul/src/main/java/gui | |
| parent | [client] oops, bad while condition (diff) | |
| download | tutor-module-129ab652a10211cb825eb2afdc87ff3ab8d36c54.tar.gz tutor-module-129ab652a10211cb825eb2afdc87ff3ab8d36c54.tar.xz tutor-module-129ab652a10211cb825eb2afdc87ff3ab8d36c54.zip | |
[client] sort list of IdP by displayName
Diffstat (limited to 'dozentenmodul/src/main/java/gui')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/intro/Login_GUI.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java index f11d6c6f..82c2be24 100644 --- a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java @@ -9,6 +9,8 @@ import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.concurrent.ExecutionException; @@ -48,7 +50,6 @@ import thrift.ThriftConnection; import util.GuiOrganizer; import util.ResourceLoader; import util.ShibbolethECP; - import config.Config; @SuppressWarnings("serial") @@ -632,9 +633,18 @@ public class Login_GUI extends JFrame { for (OrganizationData org : tempOrgs) { if (org.getEcpUrl() != null && !org.getEcpUrl().isEmpty()) { organizations.add(org); + LOGGER.debug("Valid IdP: " + org.toString()); + } else { + LOGGER.debug("Skipped bad organization (no ECPUrl): " + org.toString()); } - LOGGER.debug("Valid IdP: " + org.toString()); } + // now we build the list, lets sort it + Collections.sort(organizations, new Comparator<OrganizationData>() { + @Override + public int compare(OrganizationData o1, OrganizationData o2) { + return o1.displayName.compareTo(o2.displayName); + } + }); } else { LOGGER.error("Thrift call of 'getOrganizations()' seems to have worked, but 'organizations' is still null."); LOGGER.error("Is the API of the masterserver working correctly?"); |
