<commit_before>package com.intellij.openapi.fileTypes.ex;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.fileTypes.impl.FileTypeRenderer;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.ListScrollingUtil;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.Comparator;

public class FileTypeChooser extends DialogWrapper{
  private DefaultListModel myModel = new DefaultListModel();
  private JList myList = new JList(myModel);
  private String myExtension;

  public FileTypeChooser(String extension) {
    super(true);
    myExtension=extension;

    FileType[] fileTypes = FileTypeManager.getInstance().getRegisteredFileTypes();
    Arrays.sort(fileTypes, new Comparator<FileType>() {
      public int compare(final FileType fileType1, final FileType fileType2) {
        if (fileType1 == null){
          return 1;
        }
        if (fileType2 == null){
          return -1;
        }
        return fileType1.getDescription().compareToIgnoreCase(fileType2.getDescription());  
      }
    });
    for(int i = 0; i < fileTypes.length; i++){
      FileType type = fileTypes[i];
      if (!type.isReadOnly()) {
        myModel.addElement(type);
      }
    }
    setTitle("Register New Extension");
    init();
  }

  protected JComponent createCenterPanel(){
    JPanel panel=new JPanel(new GridBagLayout());
    JLabel label = new JLabel("The extension '" + myExtension + "' is not associated with a registered file type. Please choose one:");
    label.setUI(new MultiLineLabelUI());<commit_msg>Removed UNKOWN from the list of file types one is able to map extension to.<commit_after>package com.intellij.openapi.fileTypes.ex;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.fileTypes.impl.FileTypeRenderer;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.ListScrollingUtil;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.Comparator;

public class FileTypeChooser extends DialogWrapper{
  private DefaultListModel myModel = new DefaultListModel();
  private JList myList = new JList(myModel);
  private String myExtension;

  public FileTypeChooser(String extension) {
    super(true);
    myExtension=extension;

    FileType[] fileTypes = FileTypeManager.getInstance().getRegisteredFileTypes();
    Arrays.sort(fileTypes, new Comparator<FileType>() {
      public int compare(final FileType fileType1, final FileType fileType2) {
        if (fileType1 == null){
          return 1;
        }
        if (fileType2 == null){
          return -1;
        }
        return fileType1.getDescription().compareToIgnoreCase(fileType2.getDescription());  
      }
    });
    for(int i = 0; i < fileTypes.length; i++){
      FileType type = fileTypes[i];
      if (!type.isReadOnly() && type != StdFileTypes.UNKNOWN) {
        myModel.addElement(type);
      }
    }
    setTitle("Register New Extension");
    init();
  }

  protected JComponent createCenterPanel(){
    JPanel panel=new JPanel(new GridBagLayout());
    JLabel label = new JLabel("The extension '" + myExtension + "' is not associated with a registered file type. Please choose one:");
    label.setUI(new MultiLineLabelUI());
{'fraction_non_alphanumeric': 0.10695187165775401, 'fraction_numerical': 0.004375303840544483, 'mean_word_length': 4.163111668757842, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5998930', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1206, 'n_words': 269}