X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fbrowser%2FWebMapFunction.java;fp=tim%2Fprune%2Ffunction%2Fbrowser%2FWebMapFunction.java;h=1639c45457dec4410f83f57c2199cbc6dcaab32f;hp=0000000000000000000000000000000000000000;hb=0a2480df5845e2d7190dfdec9b2653b1609e853d;hpb=2154b1969ac2995cca46546f217f53c066b0b749 diff --git a/tim/prune/function/browser/WebMapFunction.java b/tim/prune/function/browser/WebMapFunction.java new file mode 100644 index 0000000..1639c45 --- /dev/null +++ b/tim/prune/function/browser/WebMapFunction.java @@ -0,0 +1,46 @@ +package tim.prune.function.browser; + +import tim.prune.App; +import tim.prune.GenericFunction; + +/** + * Function to show a webservice for the current area or point + */ +public class WebMapFunction extends GenericFunction +{ + /** Service to call */ + private UrlGenerator.WebService _service; + /** Key for appearance in menu */ + private String _nameKey = null; + + /** + * Constructor + * @param inApp app object + * @param inService web service to call + * @param inNameKey name key for function + */ + public WebMapFunction(App inApp, UrlGenerator.WebService inService, + String inNameKey) + { + super(inApp); + _service = inService; + _nameKey = inNameKey; + } + + @Override + public String getNameKey() { + return _nameKey; + } + + @Override + /** + * Do the function call + */ + public void begin() + { + String url = UrlGenerator.generateUrl(_service, _app.getTrackInfo()); + if (url != null) { + BrowserLauncher.launchBrowser(url); + } + } +}