File: HelpScreen.java

package info (click to toggle)
gpsprune 10-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,220 kB
  • ctags: 3,013
  • sloc: java: 22,662; sh: 23; makefile: 16; python: 15
file content (47 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download
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
42
43
44
45
46
47
package tim.prune.function;

import javax.swing.JOptionPane;

import tim.prune.App;
import tim.prune.GenericFunction;
import tim.prune.I18nManager;
import tim.prune.function.browser.BrowserLauncher;

/**
 * Class to show a simple help screen
 */
public class HelpScreen extends GenericFunction
{
	/**
	 * Constructor
	 * @param inApp app object
	 */
	public HelpScreen(App inApp)
	{
		super(inApp);
	}

	/**
	 * Get the name key
	 */
	public String getNameKey() {
		return "function.help";
	}

	/**
	 * Show the help screen
	 */
	public void begin()
	{
		// show the dialog and offer to open home page
		Object[] buttonTexts = {I18nManager.getText("button.showwebpage"), I18nManager.getText("button.cancel")};
		if (JOptionPane.showOptionDialog(_parentFrame, I18nManager.getText("dialog.help.help"),
				I18nManager.getText("function.help"), JOptionPane.YES_NO_OPTION,
				JOptionPane.INFORMATION_MESSAGE, null, buttonTexts, buttonTexts[1])
			== JOptionPane.YES_OPTION)
		{
			// User selected to launch home page
			BrowserLauncher.launchBrowser("http://activityworkshop.net/software/prune/index.html");
		}
	}
}