public void setDocument(Document document) {
    if (myDocument != null) {
      uninstallDocumentListener(true);
    }

    myDocument = document;
    installDocumentListener();
    if (myEditorField == null) return;

    myEditorField.setDocument(document);
  }
public void setDocument(Document document)