/*
 * Copyright (c) 1998-2016 by Richard A. Wilkes. All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * version 2.0. If a copy of the MPL was not distributed with this file, You
 * can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as defined
 * by the Mozilla Public License, version 2.0.
 */

package com.trollworks.gcs.menu;

import com.trollworks.gcs.app.GCSApp;
import com.trollworks.toolkit.annotation.Localize;
import com.trollworks.toolkit.ui.App;
import com.trollworks.toolkit.ui.menu.Command;
import com.trollworks.toolkit.ui.menu.DynamicMenuEnabler;
import com.trollworks.toolkit.ui.menu.MenuProvider;
import com.trollworks.toolkit.ui.menu.help.AboutCommand;
import com.trollworks.toolkit.ui.menu.help.OpenURICommand;
import com.trollworks.toolkit.ui.menu.help.UpdateCommand;
import com.trollworks.toolkit.utility.Localization;
import com.trollworks.toolkit.utility.Platform;

import java.util.Collections;
import java.util.Set;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

/** Provides the standard "Help" menu. */
public class HelpMenuProvider implements MenuProvider {
	@Localize("Help")
	@Localize(locale = "de", value = "Hilfe")
	@Localize(locale = "ru", value = "Справка")
	@Localize(locale = "es", value = "Ayuda")
	private static String	HELP;
	@Localize("Release Notes")
	@Localize(locale = "de", value = "Hinweise zur Veröffentlichung")
	@Localize(locale = "ru", value = "Примечания к выпуску")
	@Localize(locale = "es", value = "Notas de la versión")
	private static String	RELEASE_NOTES;
	@Localize("Bug Reports")
	@Localize(locale = "de", value = "Fehlerberichte")
	@Localize(locale = "ru", value = "Отчет об ошибках")
	@Localize(locale = "es", value = "Reportar errores")
	private static String	BUGS;
	@Localize("Feature Requests")
	@Localize(locale = "de", value = "Programmwünsche")
	@Localize(locale = "ru", value = "Заявки на добавление новых функций")
	@Localize(locale = "es", value = "Solicitar mejoras")
	private static String	FEATURES;
	@Localize("License")
	@Localize(locale = "de", value = "Lizenz")
	@Localize(locale = "ru", value = "Лицензия")
	@Localize(locale = "es", value = "Licencia")
	private static String	LICENSE;
	@Localize("Web Site")
	@Localize(locale = "de", value = "Webseite")
	@Localize(locale = "ru", value = "Сайт")
	@Localize(locale = "es", value = "Sitio Web")
	private static String	WEB_SITE;
	@Localize("Mailing Lists")
	@Localize(locale = "de", value = "Mailinglisten")
	@Localize(locale = "ru", value = "Списки рассылки")
	@Localize(locale = "es", value = "Listas de correo")
	private static String	MAILING_LISTS;

	static {
		Localization.initialize();
	}

	public static final String NAME = "Help"; //$NON-NLS-1$

	@Override
	public Set<Command> getModifiableCommands() {
		return Collections.emptySet();
	}

	@Override
	public JMenu createMenu() {
		JMenu menu = new JMenu(HELP);
		menu.setName(NAME);
		if (!Platform.isMacintosh()) {
			menu.add(new JMenuItem(AboutCommand.INSTANCE));
			menu.addSeparator();
		}
		menu.add(new JMenuItem(UpdateCommand.INSTANCE));
		menu.addSeparator();
		menu.add(new JMenuItem(new OpenURICommand(RELEASE_NOTES, GCSApp.WEB_SITE + "/release_notes.php"))); //$NON-NLS-1$
		menu.add(new JMenuItem(new OpenURICommand(LICENSE, App.getHomePath().resolve("license.html").toUri()))); //$NON-NLS-1$
		menu.addSeparator();
		menu.add(new JMenuItem(new OpenURICommand(WEB_SITE, GCSApp.WEB_SITE)));
		menu.add(new JMenuItem(new OpenURICommand(MAILING_LISTS, GCSApp.WEB_SITE + "/mailing_lists.php"))); //$NON-NLS-1$
		menu.add(new JMenuItem(new OpenURICommand(FEATURES, "https://gurpscharactersheet.atlassian.net/issues/?filter=10000"))); //$NON-NLS-1$
		menu.add(new JMenuItem(new OpenURICommand(BUGS, "https://gurpscharactersheet.atlassian.net/issues/?filter=10001"))); //$NON-NLS-1$
		DynamicMenuEnabler.add(menu);
		return menu;
	}
}

@@ -1665,407 +1665,26 @@
 orts
-%22)%0A%09@Localize(locale = %22de%22, value = %22Fehlerberichte%22)%0A%09@Localize(locale = %22ru%22, value = %22%D0%9E%D1%82%D1%87%D0%B5%D1%82 %D0%BE%D0%B1 %D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0%D1%85%22)%0A%09@Localize(locale = %22es%22, value = %22Reportar errores%22)%0A%09private static String%09BUGS;%0A%09@Localize(%22Feature Requests%22)%0A%09@Localize(locale = %22de%22, value = %22Programmw%C3%BCnsche%22)%0A%09@Localize(locale = %22ru%22, value = %22%D0%97%D0%B0%D1%8F%D0%B2%D0%BA%D0%B8 %D0%BD%D0%B0 %D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5 %D0%BD%D0%BE%D0%B2%D1%8B%D1%85 %D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9%22)%0A%09@Localize(locale = %22es%22, value = %22Solicitar mejora
+ & Feature Request
 s%22)%0A
@@ -1706,24 +1706,20 @@
  String%09
-FEATURES
+JIRA
 ;%0A%09@Loca
@@ -3292,149 +3292,12 @@
 and(
-FEATURES, %22https://gurpscharactersheet.atlassian.net/issues/?filter=10000%22))); //$NON-NLS-1$%0A%09%09menu.add(new JMenuItem(new OpenURICommand(BUGS
+JIRA
 , %22h
@@ -3340,29 +3340,8 @@
 .net
-/issues/?filter=10001
 %22)))

Replace 'Bug Reports' and 'Feature Requests' with a single menu item