X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FWSClient.java;h=91fd4b0e704be0551ea36483e38f70b5cb91c6dc;hb=08bde8d252a69d4d6a3b2497f759bd5d6f154a3f;hp=29a8b9244cc1240ca3adde2aa5851df1595a06b6;hpb=ab9e5bf849afd2f41102db0bf9893de1df0512f6;p=jalview.git diff --git a/src/jalview/ws/WSClient.java b/src/jalview/ws/WSClient.java index 29a8b92..91fd4b0 100755 --- a/src/jalview/ws/WSClient.java +++ b/src/jalview/ws/WSClient.java @@ -18,10 +18,12 @@ */ package jalview.ws; +import javax.swing.JMenu; + import ext.vamsas.*; import jalview.gui.*; -public class WSClient +public abstract class WSClient { /** * WSClient holds the basic attributes that are displayed to the user @@ -73,6 +75,10 @@ public class WSClient { return setWebService(sh, false); } + /** + * original service handle that this client was derived from + */ + ServiceHandle serviceHandle=null; /** * initialise WSClient service information attributes from the service handle * @param sh @@ -102,4 +108,26 @@ public class WSClient } return wsInfo; } + /** + * convenience method to pass the serviceHandle reference that instantiated this + * service on to the menu entry constructor + * @param wsmenu the menu to which any menu entries/sub menus are to be attached + * @param alignFrame the alignFrame instance that provides input data for the service + */ + public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame) + { + if (serviceHandle==null) + { + throw new Error("IMPLEMENTATION ERROR: cannot attach WS Menu Entry without service handle reference!"); + } + attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); + } + /** + * method implemented by each WSClient implementation that creates menu entries that enact their service + * using data from alignFrame. + * @param wsmenu where new menu entries (and submenus) are to be attached + * @param serviceHandle the serviceHandle document for the service that entries are created for + * @param alignFrame + */ + public abstract void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle serviceHandle, final AlignFrame alignFrame); }