This document describes how the editor is instantiated, and handles events, for the Composer window. This is very similar to its use in the mail compose window, and will relate to most embedding applications. For details on how the editor is created for text widgets, see the text widgets doc. The editor then acts upon the document being edited.
Solid arrows indicate common interaction paths, open arrows less important paths.
Some aspects of this picture deserve comment. The editor is agnostic to who is driving it, and it's not tied to any specific front-end or environment. Third, note that the document being edited does not know that it is being edited. Editor acts on the document, but the document doesn't need to know anything about the editor. The editor shell creates the editor when the time is right, holds the owning reference to the editor object, and releases it when the XUL window is closed.