<commit_before>package com.eddysystems.eddy;

import com.eddysystems.eddy.engine.Utility;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import java.awt.event.ActionListener;

public class EmailDialog extends DialogWrapper {
  private JTextPane weWouldLoveToTextPane;
  private JTextField emailTextField;
  private JPanel dialogPanel;

  public EmailDialog() {
    super(null,false, IdeModalityType.IDE);
    init();
    setTitle("eddy - Email Contact");
    Document doc = weWouldLoveToTextPane.getDocument();
    try {
      doc.insertString(0, "We would love to be able to contact you and ask for your feedback.\n\nPlease enter your email address if you'd like to participate.\n\nYou can always change or remove your email address in the plugin preferences.", new SimpleAttributeSet());
    } catch (BadLocationException e) {
      Utility.log("cannot instantiate email dialog: " + e);
      throw new RuntimeException(e);
    }
  }

  @Override
  protected ValidationInfo doValidate() {
    String email = emailTextField.getText();
    if (!"".equals(email) && !email.matches("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2}[a-zA-Z]*$"))
      return new ValidationInfo("Please enter a valid email address (or none at all)", emailTextField);
    return null;
  }

  @NotNull
  @Override
  protected Action[] createActions() {
    return new Action[]{getOKAction()};
  }<commit_msg>clarify language in email dialog<commit_after>package com.eddysystems.eddy;

import com.eddysystems.eddy.engine.Utility;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import java.awt.event.ActionListener;

public class EmailDialog extends DialogWrapper {
  private JTextPane weWouldLoveToTextPane;
  private JTextField emailTextField;
  private JPanel dialogPanel;

  public EmailDialog() {
    super(null,false, IdeModalityType.IDE);
    init();
    setTitle("eddy - Email Contact");
    Document doc = weWouldLoveToTextPane.getDocument();
    try {
      doc.insertString(0, "We would love to be able to contact you and ask for your feedback.\n\nPlease enter your email address if you'd like to participate (or leave blank if you don't).\n\nYou can always change or remove your email address in the plugin preferences.", new SimpleAttributeSet());
    } catch (BadLocationException e) {
      Utility.log("cannot instantiate email dialog: " + e);
      throw new RuntimeException(e);
    }
  }

  @Override
  protected ValidationInfo doValidate() {
    String email = emailTextField.getText();
    if (!"".equals(email) && !email.matches("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2}[a-zA-Z]*$"))
      return new ValidationInfo("Please enter a valid email address (or none at all)", emailTextField);
    return null;
  }

  @NotNull
  @Override
  protected Action[] createActions() {
    return new Action[]{getOKAction()};
  }
{'fraction_non_alphanumeric': 0.11762962962962963, 'fraction_numerical': 0.0035555555555555557, 'mean_word_length': 4.350237717908082, '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': '2966880', 'n_tokens_mistral': 1021, 'n_tokens_neox': 989, 'n_words': 270}