package org.mote.wiimote.whiteboard.gui;

import javax.swing.JOptionPane;

import org.jdesktop.application.Action;
import org.mote.wiimote.whiteboard.WiimoteWhiteboard;
import org.mote.wiimote.whiteboard.util.BareBonesBrowserLaunch;
import org.mote.wiimote.whiteboard.util.Util;

@SuppressWarnings("serial")
public class HelpHandler {
	
	@Action
	public void help() {
		if (Util.INSIDE_APP_BUNDLE) {
			HelpBook.launchHelpViewer();
		} else {
			if (JOptionPane.showConfirmDialog(null, Util.getResourceMap(HelpHandler.class).getString("helpQuestion"), Util.getResourceMap(HelpHandler.class).getString("help.Action.text"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
				BareBonesBrowserLaunch.openURL(WiimoteWhiteboard.getProperty("onlineHelp"));
			}
		}
	}

}
