<commit_before>package org.lodder.subtools.multisubdownloader.gui.dialog;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

import net.miginfocom.swing.MigLayout;

import org.lodder.subtools.multisubdownloader.Messages;
import org.lodder.subtools.multisubdownloader.gui.extra.table.CustomTable;
import org.lodder.subtools.multisubdownloader.gui.extra.table.SubtitleTableColumnName;
import org.lodder.subtools.multisubdownloader.gui.extra.table.SubtitleTableModel;
import org.lodder.subtools.sublibrary.model.Release;
import org.lodder.subtools.sublibrary.model.Subtitle;

public class SelectDialog extends MultiSubDialog {

  public enum SelectionType {
    OK(1), ALL(999999), CANCEL(-1);

    private int code;

    private SelectionType(int c) {
      code = c;
    }

    public int getSelectionCode() {
      return code;
    }
  }

  /**
     *
     */
  private static final long serialVersionUID = -4092909537478305235L;
  private SelectionType answer = SelectionType.CANCEL;
  private List<Subtitle> subtitles;
  private Release release;
  private CustomTable customTable;
  private JFrame frame;


  /**
   * Create the dialog.
   */
  public SelectDialog(JFrame frame, List<Subtitle> subtitles, Release release) {
    super(frame, Messages.getString("SelectDialog.SelectCorrectSubtitle"), false);
    this.subtitles = subtitles;
    this.release = release;
    this.frame = frame;
    initialize();
    pack();
    setDialogLocation(frame);
    setVisible(true);
  }

  private void initialize() {
    setBounds(100, 100, 850, 100);
    getContentPane().setLayout(new MigLayout("", "[grow,fill]", "[][::100px,fill][grow]"));
    JLabel lblNewLabel =
        new JLabel(Messages.getString("SelectDialog.SelectCorrectSubtitleThisRelease")
            + release.getFilename());
    getContentPane().add(lblNewLabel, "cell 0 0");
    {
      JScrollPane scrollPane = new JScrollPane();
      getContentPane().add(scrollPane, "cell 0 1,grow");
      customTable = createCustomTable();
      scrollPane.setViewportView(customTable);<commit_msg>Fix wait state of input dialog<commit_after>package org.lodder.subtools.multisubdownloader.gui.dialog;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

import net.miginfocom.swing.MigLayout;

import org.lodder.subtools.multisubdownloader.Messages;
import org.lodder.subtools.multisubdownloader.gui.extra.table.CustomTable;
import org.lodder.subtools.multisubdownloader.gui.extra.table.SubtitleTableColumnName;
import org.lodder.subtools.multisubdownloader.gui.extra.table.SubtitleTableModel;
import org.lodder.subtools.sublibrary.model.Release;
import org.lodder.subtools.sublibrary.model.Subtitle;

public class SelectDialog extends MultiSubDialog {

  public enum SelectionType {
    OK(1), ALL(999999), CANCEL(-1);

    private int code;

    private SelectionType(int c) {
      code = c;
    }

    public int getSelectionCode() {
      return code;
    }
  }

  /**
     *
     */
  private static final long serialVersionUID = -4092909537478305235L;
  private SelectionType answer = SelectionType.CANCEL;
  private List<Subtitle> subtitles;
  private Release release;
  private CustomTable customTable;
  private JFrame frame;


  /**
   * Create the dialog.
   */
  public SelectDialog(JFrame frame, List<Subtitle> subtitles, Release release) {
    super(frame, Messages.getString("SelectDialog.SelectCorrectSubtitle"), true);
    this.subtitles = subtitles;
    this.release = release;
    this.frame = frame;
    initialize();
    pack();
    setDialogLocation(frame);
    setVisible(true);
  }

  private void initialize() {
    setBounds(100, 100, 850, 100);
    getContentPane().setLayout(new MigLayout("", "[grow,fill]", "[][::100px,fill][grow]"));
    JLabel lblNewLabel =
        new JLabel(Messages.getString("SelectDialog.SelectCorrectSubtitleThisRelease")
            + release.getFilename());
    getContentPane().add(lblNewLabel, "cell 0 0");
    {
      JScrollPane scrollPane = new JScrollPane();
      getContentPane().add(scrollPane, "cell 0 1,grow");
      customTable = createCustomTable();
      scrollPane.setViewportView(customTable);
{'fraction_non_alphanumeric': 0.11179361179361179, 'fraction_numerical': 0.018837018837018837, 'mean_word_length': 4.368131868131868, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5716105', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1501, 'n_words': 292}