From: Jim Procter Date: Fri, 5 Feb 2021 17:03:12 +0000 (+0000) Subject: JAL-3746 JAL-3811 document SHOW_JWS2_SERVICES user preference and provide new menu... X-Git-Tag: Release_2_11_2_1~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a6152ff382c65a2cbd95163478cce7a65b1c641a;p=jalview.git JAL-3746 JAL-3811 document SHOW_JWS2_SERVICES user preference and provide new menu option for ‘one off’ JABAWS discovery if preference is disabled. --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 8eef930..e10c9eb 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -171,6 +171,8 @@ import jalview.ws.sifts.SiftsSettings; *
  • FOLLOW_SELECTIONS (true) Controls whether a new alignment view should * respond to selections made in other alignments containing the same sequences. *
  • + *
  • SHOW_JWS2_SERVICES (true) when set to false, jalview will not + * auto-discover JABAWS services
  • *
  • JWS2HOSTURLS comma-separated list of URLs to try for JABAWS services
  • *
  • SHOW_WSDISCOVERY_ERRORS (true) Controls if the web service URL discovery * warning dialog box is displayed.
  • diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 07baa2e..d791842 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4289,9 +4289,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, webService.add(me.webServiceNoServices); } // TODO: move into separate menu builder class. - boolean new_sspred = false; - if (Cache.getDefault("SHOW_JWS2_SERVICES", true)) { + // logic for 2.11.1.4 is + // always look to see if there is a discover. if there isn't + // we can't show any Jws2 services + // if there are services available, show them - regardless of + // the 'show JWS2 preference' + // if the discoverer is running then say so + // otherwise offer to trigger discovery if 'show JWS2' is not + // enabled Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer(); if (jws2servs != null) { @@ -4308,8 +4314,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } } - } + if (jws2servs.isRunning()) { JMenuItem tm = new JMenuItem( @@ -4317,6 +4323,26 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, tm.setEnabled(false); webService.add(tm); } + else if (!Cache.getDefault("SHOW_JWS2_SERVICES", true)) + { + JMenuItem enableJws2 = new JMenuItem( + "Discover Web Services"); + enableJws2.setToolTipText( + "Select to start JABA Web Service discovery (or enable option in Web Service preferences)"); + enableJws2.setEnabled(true); + enableJws2.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent e) + { + // start service discoverer, but ignore preference + Desktop.instance.startServiceDiscovery(false, + true); + } + }); + webService.add(enableJws2); + } } } build_urlServiceMenu(me.webService); diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 429a2c1..4f12de4 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -2205,7 +2205,8 @@ public class Desktop extends jalview.jbgui.GDesktop /** * start service discovery and wait till it is done */ - public void startServiceDiscovery() { + public void startServiceDiscovery() + { startServiceDiscovery(false); } @@ -2214,8 +2215,9 @@ public class Desktop extends jalview.jbgui.GDesktop * * @param blocking */ - public void startServiceDiscovery(boolean blocking) { - startServiceDiscovery(blocking, false); + public void startServiceDiscovery(boolean blocking) + { + startServiceDiscovery(blocking,false); } /**