A plain document that maintains no character attributes. The
default element structure for this document is a map of the lines in
the text. The Element returned by getDefaultRootElement is
a map of the lines, and each child element represents a line.
This model does not maintain any character level attributes,
but each line can be tagged with an arbitrary set of attributes.
Line to offset, and offset to line translations can be quickly
performed using the default root element. The structure information
of the DocumentEvent's fired by edits will indicate the line
structure changes.
The default content storage management is performed by a
gapped buffer implementation (GapContent). It supports
editing reasonably large documents with good efficiency when
the edits are contiguous or clustered, as is typical.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is appropriate
for short term storage or RMI between applications running the same
version of Swing. A future release of Swing will provide support for
long term persistence.
Updates document structure as a result of text insertion. This
will happen within a write lock. Since this document simply
maps out lines, we refresh the line map.
Updates any document structure as a result of text removal.
This will happen within a write lock. Since the structure
represents a line map, this just checks to see if the
removal spans lines. If it does, the two lines outside
of the removal area are joined together.
Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, California, 94303, U.S.A. All Rights Reserved.