<commit_before>/*
 *  Copyright (c) 2014 University of Tartu
 */

package org.qsardb.editor.common;

import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.plaf.basic.BasicFileChooserUI;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;

public class Utils {
	public static void main(String[] args) { // DELME
		for (int i=0; i<5; i++) {
			JFileChooser fc = Utils.getFileChooser();
			if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
				System.out.println("Selected: "+fc.getSelectedFile());
			}
		}
	}

	private static File currentDir = new File(System.getProperty("user.dir"));

	public static JFileChooser getFileChooser() {
		return new JFileChooser(currentDir) {
			private File prevSelection = null;
			
			@Override
			public void approveSelection() {
				AWTEvent currentEvent = EventQueue.getCurrentEvent();
				File selection = getSelectedFile();<commit_msg>Removed unneeded method<commit_after>/*
 *  Copyright (c) 2014 University of Tartu
 */

package org.qsardb.editor.common;

import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.plaf.basic.BasicFileChooserUI;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;

public class Utils {
	private static File currentDir = new File(System.getProperty("user.dir"));

	public static JFileChooser getFileChooser() {
		return new JFileChooser(currentDir) {
			private File prevSelection = null;

			@Override
			public void approveSelection() {
				AWTEvent currentEvent = EventQueue.getCurrentEvent();
				File selection = getSelectedFile();
{'fraction_non_alphanumeric': 0.10838663823738451, 'fraction_numerical': 0.0035536602700781805, 'mean_word_length': 5.2555555555555555, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2396211', 'n_tokens_mistral': 946, 'n_tokens_neox': 885, 'n_words': 198}