Provides a framework for creating, manipulating, displaying
and editing text documents.
Package Specification
The packages is divided into two parts. The first part defines and implements
the notion of text documents, whereas the second part defines and implements
a viewer for text documents.
Text Model
IDocument is the major text model abstraction. It provides content
management, position management using position categories, document partition
management, searching, and change notification. In order to be notified
about document changes, an object must implements IDocumentListener
and must be registered with the document. Position updating in responds
to a document change is performed by implementers of IDocumentPositionUpdater.
Partition updating in responds to a document change is performed by implements
of IDocumentPartitioner. In order to be notified about document
partition changes, objects must implement IDocumentParititoningListener
and must be registered with the document.
The package contains default implementations for document position updaters
and for documents. AbstractDocument uses ITextStorage
for storing and managing its content and ILineTracker to maintain
a line structure of its content. As defaults a gap text implementation
of ITextStore is provided, together with a line tracker understanding
the three standard line delimiters ("\r", "\n", "\r\n") and a line
tracker which can be freely configured to consider any given set of strings
as valid line delimiters.
Text Viewer
ITextViewer defines the concept of a document based, editiable
viewer. ITextViewer offers the following functionality:
-
present a document
-
event consumption (IEventConsumer)
-
viewport tracking and notification (IIViewportListener)
-
change notification (ITextListener, ITextInputListener)
-
listeners (combined view/model notification, input document)
-
standard text editing functions plus text hover support
-
visual region support
An ITextViewer supports the following plugins
-
IUndoManager for the undo/redo mechanism
-
IDoubleClickStrategy for partition type specific behavior on mouse
double click
-
IAutoIndentStrategy for content type specific behavior on
inserting a line break
-
ITextHover for content type specific behavior when overing over
text
The package provides default implementations for all these interfaces.