*/
private void addEnumeratedServices(final JMenu jws2al, final AlignFrame alignFrame, List<Jws2Instance> enumerableServices)
{
- boolean byhost = Cache.getDefault("WSMENU_BYHOST", false), bytype = Cache
- .getDefault("WSMENU_BYTYPE", false);
- /**
- * eventually, JWS2 services will appear under the same align/etc submenus.
- * for moment we keep them separate.
- */
- JMenu atpoint;
- MsaWSClient msacl = new MsaWSClient();
- Vector hostLabels = new Vector();
- Hashtable<String,String> lasthostFor = new Hashtable<String,String>();
+ boolean byhost = Cache.getDefault("WSMENU_BYHOST", false), bytype = Cache
+ .getDefault("WSMENU_BYTYPE", false);
+ /**
+ * eventually, JWS2 services will appear under the same align/etc submenus.
+ * for moment we keep them separate.
+ */
+ JMenu atpoint;
+ MsaWSClient msacl = new MsaWSClient();
+ List<String> hostLabels = new ArrayList<String>();
+ Hashtable<String, String> lasthostFor = new Hashtable<String, String>();
Hashtable<String, ArrayList<Jws2Instance>> hosts = new Hashtable<String, ArrayList<Jws2Instance>>();
ArrayList<String> hostlist=new ArrayList<String>();
for (Jws2Instance service : enumerableServices)
// contiguous
// group
JMenuItem hitm;
- atpoint.addSeparator();
+ if (hostLabels.contains(host)) {
+ atpoint.addSeparator();
+ } else {
+ hostLabels.add(host);
+ }
if (lasthostFor.get(service.action) == null || !lasthostFor.get(service.action).equals(host))
{
atpoint.add(hitm = new JMenuItem(host));
.wrapTooltip("Opens the JABAWS server's homepage in web browser"));
lasthostFor.put(service.action,host);
}
- hostLabels.addElement(host + service.serviceType
+ hostLabels.add(host + service.serviceType
+ service.getActionText());
- // hostLabels.addElement(host + (bytype ?
- // service.serviceType+service.getActionText() : ""));
}
service.attachWSMenuEntry(atpoint, alignFrame);
- /*
- * JMenuItem sitem = new JMenuItem(service.serviceType);
- * sitem.setToolTipText("Hosted at " + service.hosturl);
- * sitem.addActionListener(new ActionListener() {
- *
- * @Override public void actionPerformed(ActionEvent e) { AlignmentView
- * msa = alignFrame.gatherSequencesForAlignment(); MsaWSClient client =
- * new MsaWSClient(service, "JWS2 Alignment of " +
- * alignFrame.getTitle(), msa, false, true,
- * alignFrame.getViewport().getAlignment().getDataset(), alignFrame); }
- * });
- */
}
}
}