From: jprocter Date: Thu, 9 Sep 2010 15:48:36 +0000 (+0000) Subject: remove duplicate host URLs in service list when not indexing services by host X-Git-Tag: Release_2_6~54 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7423fd27a25ace181a99c20b307d54b860d0fbc2;p=jalview.git remove duplicate host URLs in service list when not indexing services by host --- diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java index dda8c4e..ceff8e4 100644 --- a/src/jalview/ws/jws2/Jws2Discoverer.java +++ b/src/jalview/ws/jws2/Jws2Discoverer.java @@ -366,6 +366,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI MsaWSClient msacl = new MsaWSClient(); Vector hostLabels = new Vector(); jws2al.removeAll(); + String lasthost=null; for (final Jws2Instance service : services) { atpoint = jws2al; @@ -394,9 +395,12 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI // group JMenuItem hitm; atpoint.addSeparator(); - atpoint.add(hitm = new JMenuItem(host)); - hitm.setForeground(Color.blue); - hostLabels.addElement(host); + if (lasthost==null || !lasthost.equals(host)) + { + atpoint.add(hitm = new JMenuItem(host)); + hitm.setForeground(Color.blue); + } + hostLabels.addElement(lasthost=host); } msacl.attachWSMenuEntry(atpoint, service, alignFrame); /*