<commit_before>// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@

package example;

import java.awt.*;
import java.awt.event.ActionListener;
import java.util.stream.Stream;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

public final class MainPanel extends JPanel {
  private MainPanel() {
    super(new BorderLayout());

    JRadioButton r1 = new JRadioButton("prevent KeyStroke autoStartsEdit");
    JRadioButton r2 = new JRadioButton("prevent mouse from starting edit");
    JRadioButton r3 = new JRadioButton("start cell editing only F2");
    JRadioButton r4 = new JRadioButton("isCellEditable retrun false");

    String[] columnNames = {"CellEditable:false", "Integer", "String"};
    Object[][] data = {
      {"aaa", 12, "eee"}, {"bbb", 5, "ggg"},
      {"CCC", 92, "fff"}, {"DDD", 0, "hhh"}
    };
    TableModel model = new DefaultTableModel(data, columnNames) {
      @Override public Class<?> getColumnClass(int column) {
        return getValueAt(0, column).getClass();
      }

      @Override public boolean isCellEditable(int row, int col) {
        return col != 0 && !r4.isSelected();
      }
    };
    JTable table = new JTable(model);
    table.setAutoCreateRowSorter(true);
    table.setShowGrid(false);
    // table.setShowHorizontalLines(false);
    // table.setShowVerticalLines(false);
    table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
<commit_msg>docs: fix typo retrun should be return<commit_after>// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@

package example;

import java.awt.*;
import java.awt.event.ActionListener;
import java.util.stream.Stream;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

public final class MainPanel extends JPanel {
  private MainPanel() {
    super(new BorderLayout());
    JRadioButton r1 = new JRadioButton("prevent KeyStroke autoStartsEdit");
    JRadioButton r2 = new JRadioButton("prevent mouse from starting edit");
    JRadioButton r3 = new JRadioButton("start cell editing only F2");
    JRadioButton r4 = new JRadioButton("isCellEditable return false");

    String[] columnNames = {"CellEditable:false", "Integer", "String"};
    Object[][] data = {
      {"aaa", 12, "eee"}, {"bbb", 5, "ggg"},
      {"CCC", 92, "fff"}, {"DDD", 0, "hhh"}
    };
    TableModel model = new DefaultTableModel(data, columnNames) {
      @Override public Class<?> getColumnClass(int column) {
        return getValueAt(0, column).getClass();
      }

      @Override public boolean isCellEditable(int row, int col) {
        return col != 0 && !r4.isSelected();
      }
    };
    JTable table = new JTable(model);
    table.setAutoCreateRowSorter(true);
    table.setShowGrid(false);
    // table.setShowHorizontalLines(false);
    // table.setShowVerticalLines(false);
    table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

{'fraction_non_alphanumeric': 0.14061456245824983, 'fraction_numerical': 0.01068804275217101, 'mean_word_length': 3.9259868421052633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5321513', 'n_tokens_mistral': 930, 'n_tokens_neox': 904, 'n_words': 228}