JAL-3807 JPred can now successfully submit and track the job.
[jalview.git] / src / jalview / ws / api / ServiceWithParameters.java
index d345869..d875fd7 100644 (file)
@@ -1,8 +1,16 @@
 package jalview.ws.api;
 
+import jalview.bin.Cache;
+import jalview.gui.AlignFrame;
+import jalview.ws.JPredClient;
+import jalview.ws.jws2.MsaWSClient;
+import jalview.ws.jws2.SequenceAnnotationWSClient;
 import jalview.ws.params.ParamManager;
 
+import javax.swing.JMenu;
+
 public abstract class ServiceWithParameters extends UIinfo
+    implements JalviewServiceEndpointProviderI
 {
 
   protected jalview.ws.uimodel.AlignAnalysisUIText aaui;
@@ -79,4 +87,30 @@ public abstract class ServiceWithParameters extends UIinfo
             + getName();
   }
 
+  protected enum ServiceClient
+  {
+    MSAWSCLIENT, SEQUENCEANNOTATIONWSCLIENT, JPREDWSCLIENT;
+  };
+
+  protected ServiceClient style = null;
+
+  public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
+  {
+    switch (style)
+    {
+    case MSAWSCLIENT:
+        new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
+      break;
+    case JPREDWSCLIENT:
+        JPredClient.getMenuEntryProvider(this).attachWSMenuEntry(atpoint, alignFrame);
+        break;
+    case SEQUENCEANNOTATIONWSCLIENT:
+        new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this,
+                alignFrame);
+      break;
+    default:
+      Cache.log.warn("Implementation error ? Service " + getName()
+              + " has Unknown service style " + style);
+    }
+  }
 }