<commit_before>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;
   }
}
<commit_msg>remove class, move methods to HelpMenu<commit_after>package eg.ui.menu;

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

import java.awt.Desktop;

import java.io.File;
import java.io.IOException;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * 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 -> showHelpSite());
      showDocuItm.addActionListener(e -> showDocuSite());
   }
   
   public JMenu getMenu() {
      return menu;
   }

   private void showHelpSite() {
      openWebSite("https://eadgyth.github.io/Programming-Editor/help/help.html");
   }

   private void showDocuSite() {
      openWebSite("https://eadgyth.github.io/Programming-Editor/");
   }

   private void openWebSite(String url) {
      try {
         if (Desktop.isDesktopSupported()) {
            Desktop.getDesktop().browse(new URI(url));
         }
      }
      catch (IOException | URISyntaxException e) {
         eg.utils.FileUtils.logStack(e);
      }
   }
}

{'fraction_non_alphanumeric': 0.12303881090008258, 'fraction_numerical': 0.0, 'mean_word_length': 2.965630114566285, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5974844', 'n_tokens_mistral': 782, 'n_tokens_neox': 773, 'n_words': 169}