File: OpenCachePageFunction.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (41 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package tim.prune.function.browser;

import tim.prune.App;
import tim.prune.GenericFunction;
import tim.prune.data.DataPoint;
import tim.prune.data.GeocacheCode;

/**
 * Function to open a geocache page for the current point
 */
public class OpenCachePageFunction extends GenericFunction
{
	/**
	 * Constructor
	 * @param inApp app object
	 */
	public OpenCachePageFunction(App inApp) {
		super(inApp);
	}

	@Override
	public String getNameKey() {
		return "function.opengeocachepage";
	}

	/**
	 * Do the function call
	 */
	@Override
	public void begin()
	{
		DataPoint currentPoint = _app.getTrackInfo().getCurrentPoint();
		if (currentPoint == null) {
			return;
		}
		String url = GeocacheCode.getUrl(currentPoint.getWaypointName());
		if (url != null) {
			BrowserLauncher.launchBrowser(url);
		}
	}
}