package eg.ui.menu;

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

import eg.ui.Help;

/**
 * The menu for help actions
 * <p>Created in {@link MenuBar}
 */
class HelpMenu {
   
   private final JMenu     menu        = new JMenu("?");
   private final JMenuItem showHelpItm = new JMenuItem("Open help site");
   private final JMenuItem showDocuItm = new JMenuItem("Open docu site");
   private final JMenuItem aboutItm    = new JMenuItem("About Eadgyth");
   
   public HelpMenu() {
      menu.add(showHelpItm);
      menu.add(showDocuItm);
      menu.addSeparator();
      menu.add(aboutItm);
      aboutItm.addActionListener(e -> new eg.ui.InfoWin());      
      showHelpItm.addActionListener(e -> new Help().showHelpSite());
      showDocuItm.addActionListener(e -> new Help().showDocuSite());
   }
   
   public JMenu getMenu() {
      return menu;
   }
}

@@ -82,18 +82,132 @@
 ort 
-eg.ui.Help
+java.awt.Desktop;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException
 ;%0A%0A/
@@ -815,35 +815,24 @@
 stener(e -%3E 
-new Help().
 showHelpSite
@@ -881,19 +881,8 @@
  -%3E 
-new Help().
 show
@@ -954,11 +954,518 @@
 nu;%0A   %7D
+%0A%0A   private void showHelpSite() %7B%0A      openWebSite(%22https://eadgyth.github.io/Programming-Editor/help/help.html%22);%0A   %7D%0A%0A   private void showDocuSite() %7B%0A      openWebSite(%22https://eadgyth.github.io/Programming-Editor/%22);%0A   %7D%0A%0A   private void openWebSite(String url) %7B%0A      try %7B%0A         if (Desktop.isDesktopSupported()) %7B%0A            Desktop.getDesktop().browse(new URI(url));%0A         %7D%0A      %7D%0A      catch (IOException %7C URISyntaxException e) %7B%0A         eg.utils.FileUtils.logStack(e);%0A      %7D%0A   %7D
 %0A%7D%0A

remove class, move methods to HelpMenu