- populateWSMenuEntry(jws2al, alignFrame);
- }
-
- @Override
- public void menuDeselected(MenuEvent e)
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void menuCanceled(MenuEvent e)
- {
- // TODO Auto-generated method stub
-
- }
-
- });
- wsmenu.add(jws2al);
-
- }
-
- private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame)
- {
- if (running || services == null || services.size() == 0)
- {
- return;
- }
- boolean byhost = Cache.getDefault("WSMENU_BYHOST", true), bytype = Cache
- .getDefault("WSMENU_BYTYPE", true);
- /**
- * 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();
- jws2al.removeAll();
- String lasthost = null;
- for (final Jws2Instance service : services)
- {
- atpoint = jws2al;
- String host = service.getHost();
- String type = service.serviceType;
- if (byhost)
- {
- atpoint = findOrCreateMenu(atpoint, host);
- if (atpoint.getToolTipText() == null)
- {
- atpoint.setToolTipText("Services at " + host);
- }
- }
- if (bytype)
- {
- atpoint = findOrCreateMenu(atpoint, type);
- if (atpoint.getToolTipText() == null)
- {
- atpoint.setToolTipText(service.getActionText());
- }
- }
- if (!byhost
- && !hostLabels.contains(host + service.serviceType
- + service.getActionText()))
- // !hostLabels.contains(host + (bytype ?
- // service.serviceType+service.getActionText() : "")))
- {
- // add a marker indicating where this service is hosted
- // relies on services from the same host being listed in a contiguous
- // group
- JMenuItem hitm;
- atpoint.addSeparator();
- if (lasthost == null || !lasthost.equals(host))