if (editorPane != null)
  public void read(Reader in, Document doc, int pos) throws IOException,      BadLocationException  {    if (doc instanceof HTMLDocument)      {        Parser parser = getParser();        if (pos < 0 || pos > doc.getLength())          throw new BadLocationException("Bad location", pos);        if (parser == null)          throw new IOException("Parser is null.");                HTMLDocument hd = ((HTMLDocument) doc);        hd.setBase(editorPane.getPage());        ParserCallback pc = hd.getReader(pos);                // FIXME: What should ignoreCharSet be set to?                // parser.parse inserts html into the buffer        parser.parse(in, pc, false);        pc.flush();      }    else      // read in DefaultEditorKit is called.      // the string is inserted in the document as usual.      super.read(in, doc, pos);  }