<commit_before>package com.redpois0n.guiscrot;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;

@SuppressWarnings("serial")
public class MainFrame extends JFrame {
	
	public static final MainFrame INSTANCE = new MainFrame();

	public MainFrame() {
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		add(panel, BorderLayout.WEST);
		
		JPopupMenu global = GlobalPopupMenu.getPopupMenu();
		
		for (Component c : global.getComponents()) {
			if (c instanceof JMenuItem) {
				JMenuItem mi = (JMenuItem) c;
				JButton btn = new JButton(mi.getText(), mi.getIcon());
				panel.add(btn);
				
				for (ActionListener l : mi.getActionListeners()) {
					btn.addActionListener(l);
				}
			} else if (c instanceof JMenu) {
				JMenu m = (JMenu) c;
				
				final JButton btn = new JButton(m.getText(), m.getIcon());
				panel.add(btn);
				
				final JPopupMenu menu2 = new JPopupMenu();
				
				btn.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						menu2.show(null, btn.getX() + btn.getWidth(), 0);
					}
				});
				
				for (Component c1 : m.getComponents()) {
					menu2.add(c1);
				}
			}
		}
		
	}

}<commit_msg>Converts JMenuItem to JButton, and converts JMenu to JButton with PopupMenu<commit_after>package com.redpois0n.guiscrot;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;

@SuppressWarnings("serial")
public class MainFrame extends JFrame {

	public static final MainFrame INSTANCE = new MainFrame();

	public MainFrame() {
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setLayout(new BorderLayout(0, 0));

		JPanel panel = new JPanel();
		add(panel, BorderLayout.WEST);

		JPopupMenu global = GlobalPopupMenu.getPopupMenu();

		for (Component c : global.getComponents()) {
			if (c instanceof JMenu) {
				JMenu m = (JMenu) c;

				final JButton btn = new JButton(m.getText(), m.getIcon());
				panel.add(btn);

				final JPopupMenu menu2 = new JPopupMenu();

				btn.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent e) {
						menu2.show((Component) e.getSource(), btn.getWidth(), 0);
						menu2.requestFocus();
					}
				});

				for (Component c1 : m.getMenuComponents()) {
					menu2.add(c1);
				}
			} else if (c instanceof JMenuItem) {
				JMenuItem mi = (JMenuItem) c;
				JButton btn = new JButton(mi.getText(), mi.getIcon());
				panel.add(btn);

				for (ActionListener l : mi.getActionListeners()) {
					btn.addActionListener(l);
				}
			}
		}

	}

}
{'fraction_non_alphanumeric': 0.12424338961452693, 'fraction_numerical': 0.0136986301369863, 'mean_word_length': 3.743202416918429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6876306', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1032, 'n_words': 239}