From 7423fd27a25ace181a99c20b307d54b860d0fbc2 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 9 Sep 2010 15:48:36 +0000 Subject: [PATCH] remove duplicate host URLs in service list when not indexing services by host --- src/jalview/ws/jws2/Jws2Discoverer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); /* -- 1.7.10.2