<commit_before>package me.coley.recaf.ui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Map.Entry;

import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.objectweb.asm.tree.ClassNode;

import me.coley.recaf.LaunchParams;
import me.coley.recaf.Recaf;
import me.coley.recaf.agent.Agent;
import me.coley.recaf.agent.Attach;
import me.coley.recaf.agent.Marker;
import me.coley.recaf.plugin.Plugin;
import me.coley.recaf.ui.component.JVMMenu;
import me.coley.recaf.ui.component.action.ActionMenuItem;
import me.coley.recaf.ui.component.panel.AsmFlagsPanel;
import me.coley.recaf.ui.component.panel.ClassDisplayPanel;
import me.coley.recaf.ui.component.panel.SearchPanel;
import me.coley.recaf.ui.component.panel.SearchPanel.Results;
import me.coley.recaf.ui.component.panel.SearchPanel.SearchType;
import me.coley.recaf.ui.component.panel.TabbedPanel;
import me.coley.recaf.ui.component.panel.UiOptionsPanel;
import me.coley.recaf.ui.component.tree.JarFileTree;
import me.coley.recaf.util.FilePrompt;

public class SwingUI {
	private final JMenuBar menuBar = new JMenuBar();
	private final JMenu mnSearch;
	private final JMenu mnPlugins;
	public final JFrame frame;
	public final TabbedPanel tabs = new TabbedPanel();
	public JarFileTree classTree = new JarFileTree();

	public SwingUI() {
		frame = new JFrame(Lang.get("title.default"));
		frame.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				int dialogResult = JOptionPane.showConfirmDialog(null, Lang.get("misc.warn.exit"), "Warning",
						JOptionPane.YES_NO_OPTION);
				if (dialogResult == JOptionPane.YES_OPTION) {
					frame.dispose();
				}
			}
		});
		mnSearch = new JMenu(Lang.get("navbar.search"));
		mnPlugins = new JMenu(Lang.get("navbar.plugin"));
	}

	public void init(LaunchParams params) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
					frame.setSize(params.getSize());
					frame.setJMenuBar(menuBar);
					frame.getContentPane().setLayout(new BorderLayout(0, 0));<commit_msg>Forgot to associate closing with warn option<commit_after>package me.coley.recaf.ui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Map.Entry;

import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.objectweb.asm.tree.ClassNode;

import me.coley.recaf.LaunchParams;
import me.coley.recaf.Recaf;
import me.coley.recaf.agent.Agent;
import me.coley.recaf.agent.Attach;
import me.coley.recaf.agent.Marker;
import me.coley.recaf.plugin.Plugin;
import me.coley.recaf.ui.component.JVMMenu;
import me.coley.recaf.ui.component.action.ActionMenuItem;
import me.coley.recaf.ui.component.panel.AsmFlagsPanel;
import me.coley.recaf.ui.component.panel.ClassDisplayPanel;
import me.coley.recaf.ui.component.panel.SearchPanel;
import me.coley.recaf.ui.component.panel.SearchPanel.Results;
import me.coley.recaf.ui.component.panel.SearchPanel.SearchType;
import me.coley.recaf.ui.component.panel.TabbedPanel;
import me.coley.recaf.ui.component.panel.UiOptionsPanel;
import me.coley.recaf.ui.component.tree.JarFileTree;
import me.coley.recaf.util.FilePrompt;

public class SwingUI {
	private final JMenuBar menuBar = new JMenuBar();
	private final JMenu mnSearch;
	private final JMenu mnPlugins;
	public final JFrame frame;
	public final TabbedPanel tabs = new TabbedPanel();
	public JarFileTree classTree = new JarFileTree();

	public SwingUI() {
		frame = new JFrame(Lang.get("title.default"));
		frame.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				if (Recaf.INSTANCE.configs.ui.confirmDeletions) {
					int dialogResult = JOptionPane.showConfirmDialog(null, Lang.get("misc.warn.exit"), "Warning",
							JOptionPane.YES_NO_OPTION);
					if (dialogResult == JOptionPane.YES_OPTION) {
						frame.dispose();
					}
				} else {
					frame.dispose();
				}
			}
		});
		mnSearch = new JMenu(Lang.get("navbar.search"));
		mnPlugins = new JMenu(Lang.get("navbar.plugin"));
	}

	public void init(LaunchParams params) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
					frame.setSize(params.getSize());
					frame.setJMenuBar(menuBar);
					frame.getContentPane().setLayout(new BorderLayout(0, 0));
{'fraction_non_alphanumeric': 0.11891257578720907, 'fraction_numerical': 0.0007823195775474281, 'mean_word_length': 5.016470588235294, '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': '6868832', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1735, 'n_words': 301}