<commit_before>package org.jetbrains.android.formatter;

import com.intellij.application.options.CodeStyleAbstractPanel;
import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

/**
* @author Eugene.Kudelevsky
*/
public class AndroidXmlCodeStylePanel extends CodeStyleAbstractPanel {
  private final JPanel myPanel;
  private final JBCheckBox myUseCustomSettings;
  private final List<MyFileSpecificPanel> myCodeStylePanels;
  private final JPanel myFileSpecificCodeStylesPanel;

  AndroidXmlCodeStylePanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) {
    super(XMLLanguage.INSTANCE, currentSettings, settings);

    myPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
    myPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 2, 2, 2));
    myUseCustomSettings = new JBCheckBox("Use custom formatting settings for Android XML files");
    myPanel.add(myUseCustomSettings);

    myCodeStylePanels = new ArrayList<MyFileSpecificPanel>();
    myFileSpecificCodeStylesPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
    myPanel.add(myFileSpecificCodeStylesPanel);

    myUseCustomSettings.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        UIUtil.setEnabled(myFileSpecificCodeStylesPanel, myUseCustomSettings.isSelected(), true);<commit_msg>IDEA-96114 Android xml settings are broken (not visible) (cherry picked from commit fd8872cf6cf120e64dc6c49179f71521fc950ab8)<commit_after>package org.jetbrains.android.formatter;

import com.intellij.application.options.CodeStyleAbstractPanel;
import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

/**
* @author Eugene.Kudelevsky
*/
public class AndroidXmlCodeStylePanel extends CodeStyleAbstractPanel {
  private final JPanel myPanel;
  private final JBCheckBox myUseCustomSettings;
  private final List<MyFileSpecificPanel> myCodeStylePanels;
  private final JPanel myFileSpecificCodeStylesPanel;

  AndroidXmlCodeStylePanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) {
    super(XMLLanguage.INSTANCE, currentSettings, settings);
    myPanel = new JPanel(new BorderLayout());
    JPanel centerPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
    centerPanel.setBorder(IdeBorderFactory.createEmptyBorder(2, 2, 2, 2));
    myPanel.add(centerPanel, BorderLayout.CENTER);
    myUseCustomSettings = new JBCheckBox("Use custom formatting settings for Android XML files");
    myPanel.add(myUseCustomSettings, BorderLayout.NORTH);

    myCodeStylePanels = new ArrayList<MyFileSpecificPanel>();
    myFileSpecificCodeStylesPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
    centerPanel.add(myFileSpecificCodeStylesPanel);

    myUseCustomSettings.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        UIUtil.setEnabled(myFileSpecificCodeStylesPanel, myUseCustomSettings.isSelected(), true);
{'fraction_non_alphanumeric': 0.08922520894510956, 'fraction_numerical': 0.010390783826519088, 'mean_word_length': 6.49238578680203, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '5531097', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1297, 'n_words': 249}