[previous] [up] [next]     [index]
Next: Styles Up: Editor Structure and Terminology Previous: Editor Structure and Terminology

Administrators

Two extra layers of administration manage the display-editor and editor-snip connections. An editor never communicates directly with a display; instead, it always communicates with a editor administrator, an instance of the editor-admin% class, which relays information to the display. Similarly, a snip communicates with a snip administrator, an instance of the snip-admin% class.

The administrative layers make the editor hierarchy flexible without forcing every part of an editor assembly to contain the functionality of several parts. For example, a text editor can be a single item within another editor; without administrators, the text% class would also have to contain all the functionality of a display (for the containing editor) and a snip (for the embedded editor). Using administrators, an editor class can serve as both a containing and an embedded editor without directly implementing the display and snip functionality.

A snip belongs to at most one editor via a single administrator. A editor also has only one administrator at a time. However, the administrator that connects the an editor to the standard display (i.e., an editor canvas) can work with other such administrators. In particular, the administrator of a editor-canvas% (each one has its own administrator) can work with other editor-canvas% administrators, allowing an editor to be displayed in multiple editor-canvas% windows at the same time.

When an editor is displayed by multiple canvases, one of the canvases' administrators is used as the editor's primary administrator. To handle user and update events for other canvases, the editor's administrator is temporarily changed and then restored through the editor's set-admin method. The return value of the editor's get-admin method thus depends on the context of the call.



PLT