The following sections provide an overview of the various editor kits. With minor variations, this information applies to all editor kits.
is the abstract base class for all editor kits. It has a number of
methods that define the model (e.g.,
createDefaultDocument( )), the view (e.g.,
getViewFactory( )), the
getActions( )), and
the I/O strategy (
read( ) and
write( )) for a given type of
document content. Figure
23-2 shows the
class and the many classes and interfaces it interacts with.
Figure 23-2. EditorKit class diagram
This figure shows several important things about the
EditorKit class. First, each
EditorKit instance is typically associated
with a single
in some cases, it doesn’t care). The
EditorKit defines how to create a default
Document as well as how to read and
Document to a stream. In
EditorKit may define
ViewFactory responsible for
View objects for each
Element in the
Document. Finally, the diagram shows that an
EditorKit may define a set of
Actions that it supports.
The other classes shown in the diagram are the subclasses of
AbstractAction. We’ll look at each of these
classes, as well as some inner classes not shown on the diagram,
throughout this chapter.
EditorKit defines the
properties shown in Table ...