import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
import jalview.util.MessageManager;
+import jalview.ws.api.ServiceWithParameters;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
* jalview.ws.jws2.jabaws2.Jws2Instance, jalview.gui.AlignFrame)
*/
@Override
- public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
+ public void attachWSMenuEntry(JMenu wsmenu,
+ final ServiceWithParameters service,
final AlignFrame alignFrame)
{
if (registerAAConWSInstance(wsmenu, service, alignFrame))
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient(service, alignFrame, null, false);
+ new SequenceAnnotationWSClient((Jws2Instance) service, alignFrame,
+ null, false);
}
});
wsmenu.add(annotservice);
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient(service, alignFrame, null, true);
+ new SequenceAnnotationWSClient((Jws2Instance) service, alignFrame,
+ null, true);
}
});
wsmenu.add(annotservice);
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient(service, alignFrame, preset,
+ new SequenceAnnotationWSClient((Jws2Instance) service,
+ alignFrame, preset,
false);
}
{
annotservice = new JMenuItem(
MessageManager.getString("label.view_documentation"));
- if (service.docUrl != null)
+ if (service != null && service.hasDocumentationUrl())
{
annotservice.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent arg0)
{
- Desktop.instance.showUrl(service.docUrl);
+ Desktop.instance.showUrl(service.getDocumentationUrl());
}
});
annotservice.setToolTipText(
JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage(
"label.view_service_doc_url", new String[]
- { service.docUrl, service.docUrl })));
+ { service.getDocumentationUrl(),
+ service.getDocumentationUrl() })));
wsmenu.add(annotservice);
}
}
import jalview.ws.params.ParamManager;
import java.io.Closeable;
+import java.net.URL;
import javax.swing.JMenu;
public JABAService service;
- public String docUrl;
-
/**
*
* @param hosturl
int p = description.indexOf("MORE INFORMATION:");
if (p > -1)
{
- docUrl = description.substring(description.indexOf("http", p)).trim();
+ String docUrl = description.substring(description.indexOf("http", p))
+ .trim();
if (docUrl.indexOf('\n') > -1)
{
docUrl = docUrl.substring(0, docUrl.indexOf("\n")).trim();
}
+ if (docUrl.length() > 0)
+ {
+ try
+ {
+ URL url = new URL(docUrl);
+ if (url != null)
+ {
+ setDocumentationUrl(docUrl);
+ }
+ } catch (Exception x)
+ {
+
+ }
+ }
}
}