@Override
  public Element getState() {
    Element element = new Element("x");
    if (!myMapping.isEmpty()) {
      List<Map.Entry<VirtualFilePointer, Charset>> mappings = new ArrayList<>(myMapping.entrySet());
      ContainerUtil.quickSort(mappings, Comparator.comparing(e -> e.getKey().getUrl()));
      for (Map.Entry<VirtualFilePointer, Charset> mapping : mappings) {
        VirtualFilePointer file = mapping.getKey();
        Charset charset = mapping.getValue();
        Element child = new Element("file");
        element.addContent(child);
        child.setAttribute("url", file.getUrl());
        child.setAttribute("charset", charset.name());
      }
    }
    if (myProjectCharset != null) {
      Element child = new Element("file");
      element.addContent(child);
      child.setAttribute("url", PROJECT_URL);
      child.setAttribute("charset", myProjectCharset.name());
    }

    if (myNative2AsciiForPropertiesFiles) {
      element.setAttribute("native2AsciiForPropertiesFiles", Boolean.toString(true));
    }

    if (myDefaultCharsetForPropertiesFiles != null) {
      element.setAttribute("defaultCharsetForPropertiesFiles", myDefaultCharsetForPropertiesFiles.name());
    }
    if (myDefaultConsoleCharset != null) {
      element.setAttribute("defaultCharsetForConsole", myDefaultConsoleCharset.name());
    }
    if (myBomForNewUtf8Files != BOMForNewUTF8Files.NEVER) {
      element.setAttribute("addBOMForNewFiles", myBomForNewUtf8Files.getExternalName());
    }

    return element;
  }
@Override
  public Element getState()